aboutsummaryrefslogtreecommitdiffstats
path: root/config/src/vespa/config/frt/frtsourcefactory.cpp
blob: 1c7405347308960ae6c8d48d94f0661b91d26096 (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
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

#include "frtsourcefactory.h"
#include "frtsource.h"
#include "frtconfigagent.h"
#include "connectionfactory.h"

namespace config {

FRTSourceFactory::FRTSourceFactory(std::unique_ptr<ConnectionFactory> connectionFactory, const TimingValues & timingValues, int traceLevel, const VespaVersion & vespaVersion, const CompressionType & compressionType)
    : _connectionFactory(std::move(connectionFactory)),
      _requestFactory(traceLevel, vespaVersion, compressionType),
      _timingValues(timingValues)
{
}

FRTSourceFactory::~FRTSourceFactory() = default;

std::unique_ptr<Source>
FRTSourceFactory::createSource(std::shared_ptr<IConfigHolder> holder, const ConfigKey & key) const
{
    return std::make_unique<FRTSource>(_connectionFactory, _requestFactory,
                                       std::make_unique<FRTConfigAgent>(std::move(holder), _timingValues), key);
}

} // namespace config