summaryrefslogtreecommitdiffstats
path: root/logforwarder/src/apps/vespa-logforwarder-start/cf-handler.h
blob: d6c7f2e2076e5449031c51ae9d1eb9032a2a23be (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once

#include <vespa/config/config.h>
#include <vespa/config-logforwarder.h>

using cloud::config::LogforwarderConfig;

class CfHandler {
private:
    bool _childRunning;
    void startChild(const vespalib::string &prefix);
    config::ConfigSubscriber _subscriber;
    config::ConfigHandle<LogforwarderConfig>::UP _handle;
    void subscribe(const std::string & configId, uint64_t timeoutMS);
    void doConfigure();
public:
    CfHandler();
    virtual ~CfHandler();
    void start(const char *configId);
    void check();
};