aboutsummaryrefslogtreecommitdiffstats
path: root/documentapi/src/vespa/documentapi/messagebus/routablefactories60.h
blob: e91c9a773f25621f4c8a381ab8c9d28ab7bc53e6 (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
// Copyright 2018 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include "routablefactories52.h"

namespace documentapi {
/**
 * This class encapsulates all the {@link RoutableFactory} classes needed to implement factories for the document
 * routable. When adding new factories to this class, please KEEP THE THEM ORDERED alphabetically like they are now.
 */
class RoutableFactories60 : public RoutableFactories52 {
public:
    RoutableFactories60() = delete;

    // TODO dedupe bucket space codec code

    class CreateVisitorMessageFactory : public RoutableFactories52::CreateVisitorMessageFactory {
        bool encodeBucketSpace(vespalib::stringref bucketSpace, vespalib::GrowableByteBuffer& buf) const override;
        string decodeBucketSpace(document::ByteBuffer&) const override;
    public:
        CreateVisitorMessageFactory(const document::DocumentTypeRepo& r)
            : RoutableFactories52::CreateVisitorMessageFactory(r) {}
    };

    class StatBucketMessageFactory : public RoutableFactories52::StatBucketMessageFactory {
        bool encodeBucketSpace(vespalib::stringref bucketSpace, vespalib::GrowableByteBuffer& buf) const override;
        string decodeBucketSpace(document::ByteBuffer&) const override;
    public:
        StatBucketMessageFactory() = default;
    };

    class GetBucketListMessageFactory : public RoutableFactories52::GetBucketListMessageFactory {
        bool encodeBucketSpace(vespalib::stringref bucketSpace, vespalib::GrowableByteBuffer& buf) const override;
        string decodeBucketSpace(document::ByteBuffer&) const override;
    public:
        GetBucketListMessageFactory() = default;
    };

    static void doEncodeBucketSpace(vespalib::stringref bucketSpace, vespalib::GrowableByteBuffer& buf);
    static string doDecodeBucketSpace(document::ByteBuffer&);
};

}