aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/EmptyBucketsMessage.java
blob: 0960f91b10dfb62d1a4ae381c7a3e82de90100a5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.documentapi.messagebus.protocol;

import com.yahoo.document.BucketId;

import java.util.ArrayList;
import java.util.List;

/**
 * @author banino
 */
public class EmptyBucketsMessage extends VisitorMessage {

    private final List<BucketId> bids = new ArrayList<BucketId>();

    EmptyBucketsMessage() {
        // must be deserialized into
    }

    public EmptyBucketsMessage(List<BucketId> bids) {
        this.bids.addAll(bids);
    }

    public List<BucketId> getBucketIds() {
        return bids;
    }

    public void setBucketIds(List<BucketId> bids) {
        this.bids.clear();
        this.bids.addAll(bids);
    }

    @Override
    public DocumentReply createReply() {
        return new VisitorReply(DocumentProtocol.REPLY_EMPTYBUCKETS);
    }

    @Override
    public int getType() {
        return DocumentProtocol.MESSAGE_EMPTYBUCKETS;
    }
}