summaryrefslogtreecommitdiffstats
path: root/documentapi/src/vespa/documentapi/messagebus/messages/getbucketlistreply.h
blob: 3ded7f7d08b3b719c715bc013d1a1f56e3298639 (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 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "documentreply.h"
#include <vespa/document/bucket/bucketid.h>

namespace documentapi {

class GetBucketListReply : public DocumentReply {
public:
    class BucketInfo {
    public:
        document::BucketId _bucket;
        string        _bucketInformation;

        BucketInfo();
        BucketInfo(const document::BucketId &bucketId,
                   const string &bucketInformation);
        bool operator==(const BucketInfo &rhs) const;
    };

private:
    std::vector<BucketInfo> _buckets;

public:
    /**
     * Constructs a new reply with no content.
     */
    GetBucketListReply();

    /**
     * Returns the bucket state contained in this.
     *
     * @return The state object.
     */
    std::vector<BucketInfo> &getBuckets() { return _buckets; }

    /**
     * Returns a const reference to the bucket state contained in this.
     *
     * @return The state object.
     */
    const std::vector<BucketInfo> &getBuckets() const { return _buckets; }

    string toString() const override { return "getbucketlistreply"; }
};

std::ostream & operator<<(std::ostream &out, const GetBucketListReply::BucketInfo &info);

} // documentapi