aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/main/java/com/yahoo/documentapi/messagebus/protocol/GetBucketStateReply.java
blob: f816a332a40785c1d1793f5a6496babc1700ca4f (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
43
44
45
46
47
48
49
50
51
// 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 java.util.ArrayList;
import java.util.List;

/**
 * This is a reply to a {@link GetBucketStateMessage}. It contains the state of the bucket id requested by the message.
 *
 * @author Simon Thoresen Hult
 */
public class GetBucketStateReply extends DocumentReply {

    private List<DocumentState> state;

    /**
     * Constructs a new reply with no content.
     */
    public GetBucketStateReply() {
        super(DocumentProtocol.REPLY_GETBUCKETSTATE);
        state = new ArrayList<DocumentState>();
    }

    /**
     * Constructs a new reply with initial content.
     *
     * @param state The state to set.
     */
    public GetBucketStateReply(List<DocumentState> state) {
        super(DocumentProtocol.REPLY_GETBUCKETSTATE);
        this.state = state;
    }

    /**
     * Sets the bucket state of this.
     *
     * @param state The state to set.
     */
    public void setBucketState(List<DocumentState> state) {
        this.state = state;
    }

    /**
     * Returns the bucket state contained in this.
     *
     * @return The state object.
     */
    public List<DocumentState> getBucketState() {
        return state;
    }
}