aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/frt/frtconfigrequestfactory.h
blob: d2db71ffa6d0ab0e8f1c0cdf9d530700835c0106 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/config/common/compressiontype.h>
#include <vespa/config/common/vespa_version.h>
#include <vespa/vespalib/util/time.h>
#include <memory>

namespace config {

class FRTConfigRequest;
class ConfigKey;
class Connection;
struct ConfigState;

/**
 * Factory for creating config requests depending on protocol version;
 */
class FRTConfigRequestFactory
{
public:
    FRTConfigRequestFactory(int traceLevel, const VespaVersion & vespaVersion, const CompressionType & compressionType);
    ~FRTConfigRequestFactory();

    std::unique_ptr<FRTConfigRequest>
    createConfigRequest(const ConfigKey & key, Connection * connection,
                        const ConfigState & state, vespalib::duration serverTimeout) const;
private:
    const int             _traceLevel;
    const VespaVersion    _vespaVersion;
    vespalib::string      _hostName;
    const CompressionType _compressionType;
};

} // namespace config