summaryrefslogtreecommitdiffstats
path: root/storageapi/src/vespa/storageapi/messageapi/bucketinforeply.h
blob: d5b174e4f2e7c398589fc29a85bb5c8cffe57dab (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
// Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
/**
 * @class storage::api::BucketInfoReply
 * @ingroup messageapi
 *
 * @brief Superclass for storage replies which returns bucket info in reply.
 *
 * A bucket info reply contains information about the state of a bucket. This
 * can be altered from before the operation if this was a write operation or if
 * the bucket was repaired in the process.
 */

#pragma once

#include "bucketreply.h"
#include "bucketinfocommand.h"
#include <vespa/storageapi/buckets/bucketinfo.h>

namespace storage {
namespace api {

class BucketInfoReply : public BucketReply {
    BucketInfo _result;

protected:
    BucketInfoReply(const BucketInfoCommand& cmd,
                    const ReturnCode& code = ReturnCode(ReturnCode::OK));

public:
    DECLARE_POINTER_TYPEDEFS(BucketInfoReply);

    const BucketInfo& getBucketInfo() const { return _result; };
    void setBucketInfo(const BucketInfo& info) { _result = info; }
    void print(std::ostream& out, bool verbose, const std::string& indent) const override;
};

} // api
} // storage