blob: beca68b52ec32cc303cc869fadf9ca4bf2dbcbb8 (
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
|
// 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;
vespalib::string clientKeyFile() const;
void start(const char *configId);
void check();
virtual void gotConfig(const LogforwarderConfig&) = 0;
};
|