aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/vespa/documentapi/messagebus/messages/statbucketmessage.h
blob: 640a28317d1cf680cf240884abf1504c5cad3547 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

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

namespace documentapi {

class StatBucketMessage : public DocumentMessage {
private:
    document::BucketId _bucketId;
    string _documentSelection;
    string _bucketSpace;

protected:
    DocumentReply::UP doCreateReply() const override;

public:
    /**
     * Constructs a new message with no content.
     */
    StatBucketMessage();

    /**
     * Constructs a new message with initial content.
     *
     * @param bucketId The bucket whose list to retrieve.
     */
    StatBucketMessage(document::BucketId bucket, const string& documentSelection);

    ~StatBucketMessage();

    /**
     * Returns the bucket to stat.
     *
     * @return The bucket id.
     */
    document::BucketId getBucketId() const { return _bucketId; }

    /**
     * Set the bucket to stat.
     *
     * @param bucketId The identifier to set.
     */
    void setBucketId(document::BucketId bucketId) { _bucketId = bucketId; };

    /**
     * Returns the document selection used to filter the documents
     * returned.
     *
     * @return The selection string.
     */
    const string &getDocumentSelection() const { return _documentSelection; };

    /**
     * Sets the document selection used to filter the documents returned.
     *
     * @param value The selection string to set.
     */
    void setDocumentSelection(const string &value) { _documentSelection = value; };

    const string &getBucketSpace() const { return _bucketSpace; }
    void setBucketSpace(const string &value) { _bucketSpace = value; }
    uint32_t getType() const override;
    string toString() const override { return "statbucketmessage"; }
};

}