blob: ceaa0db1011957191eead7a3839aa85679f81f43 (
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.
#pragma once
#include <vespa/config-logforwarder.h>
#include <vespa/config/subscription/configsubscriber.h>
using cloud::config::LogforwarderConfig;
class CfHandler {
private:
config::ConfigSubscriber _subscriber;
config::ConfigHandle<LogforwarderConfig>::UP _handle;
std::unique_ptr<LogforwarderConfig> _lastConfig;
time_t _lastCertFileChange = 0;
void subscribe(const std::string & configId, std::chrono::milliseconds timeout);
void doConfigure();
bool certFileChanged();
public:
CfHandler();
virtual ~CfHandler();
vespalib::string clientCertFile() const;
void start(const char *configId);
void check();
virtual void gotConfig(const LogforwarderConfig&) = 0;
};
|