Kea 1.5.0
ca_cfg_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2016-2018 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef CTRL_AGENT_CFG_MGR_H
8#define CTRL_AGENT_CFG_MGR_H
9
10#include <cc/data.h>
11#include <hooks/hooks_config.h>
12#include <process/d_cfg_mgr.h>
13#include <boost/pointer_cast.hpp>
14#include <map>
15#include <string>
16
17namespace isc {
18namespace agent {
19
20class CtrlAgentCfgContext;
22typedef boost::shared_ptr<CtrlAgentCfgContext> CtrlAgentCfgContextPtr;
23
32public:
33
36
44 return (process::ConfigPtr(new CtrlAgentCfgContext(*this)));
45 }
46
57 getControlSocketInfo(const std::string& service) const;
58
67 void setControlSocketInfo(const isc::data::ConstElementPtr& control_socket,
68 const std::string& service);
69
71 std::string getControlSocketInfoSummary() const;
72
77 void setHttpHost(const std::string& host) {
78 http_host_ = host;
79 }
80
85 std::string getHttpHost() const {
86 return (http_host_);
87 }
88
92 void setHttpPort(const uint16_t port) {
93 http_port_ = port;
94 }
95
97 uint16_t getHttpPort() const {
98 return (http_port_);
99 }
100
105 return (hooks_config_);
106 }
107
112 return (hooks_config_);
113 }
114
124 virtual isc::data::ElementPtr toElement() const;
125
126private:
127
135
139 CtrlAgentCfgContext& operator=(const CtrlAgentCfgContext& rhs);
140
142 std::map<std::string, isc::data::ConstElementPtr> ctrl_sockets_;
143
145 std::string http_host_;
146
148 uint16_t http_port_;
149
151 isc::hooks::HooksConfig hooks_config_;
152};
153
159public:
160
163
165 virtual ~CtrlAgentCfgMgr();
166
172 return (boost::dynamic_pointer_cast<CtrlAgentCfgContext>(getContext()));
173 }
174
181 virtual std::string getConfigSummary(const uint32_t selection);
182
183protected:
184
192 parse(isc::data::ConstElementPtr config, bool check_only);
193
205};
206
208typedef boost::shared_ptr<CtrlAgentCfgMgr> CtrlAgentCfgMgrPtr;
209
210} // namespace isc::agent
211} // namespace isc
212
213#endif // CTRL_AGENT_CFG_MGR_H
Control Agent Configuration Context.
Definition: ca_cfg_mgr.h:31
isc::hooks::HooksConfig & getHooksConfig()
Returns non-const reference to configured hooks libraries.
Definition: ca_cfg_mgr.h:104
void setControlSocketInfo(const isc::data::ConstElementPtr &control_socket, const std::string &service)
Sets information about the control socket.
Definition: ca_cfg_mgr.cc:124
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: ca_cfg_mgr.cc:147
void setHttpHost(const std::string &host)
Sets http-host parameter.
Definition: ca_cfg_mgr.h:77
CtrlAgentCfgContext()
Default constructor.
Definition: ca_cfg_mgr.cc:23
void setHttpPort(const uint16_t port)
Sets http port.
Definition: ca_cfg_mgr.h:92
isc::data::ConstElementPtr getControlSocketInfo(const std::string &service) const
Returns information about control socket.
Definition: ca_cfg_mgr.cc:118
std::string getHttpHost() const
Returns http-host parameter.
Definition: ca_cfg_mgr.h:85
std::string getControlSocketInfoSummary() const
Returns socket configuration summary in a textual format.
Definition: ca_cfg_mgr.cc:130
uint16_t getHttpPort() const
Returns the TCP post the HTTP server will listen on.
Definition: ca_cfg_mgr.h:97
const isc::hooks::HooksConfig & getHooksConfig() const
Returns const reference to configured hooks libraries.
Definition: ca_cfg_mgr.h:111
virtual process::ConfigPtr clone()
Creates a clone of this context object.
Definition: ca_cfg_mgr.h:43
Ctrl Agent Configuration Manager.
Definition: ca_cfg_mgr.h:158
CtrlAgentCfgMgr()
Constructor.
Definition: ca_cfg_mgr.cc:33
virtual std::string getConfigSummary(const uint32_t selection)
Returns configuration summary in the textual format.
Definition: ca_cfg_mgr.cc:41
CtrlAgentCfgContextPtr getCtrlAgentCfgContext()
Convenience method that returns the Control Agent configuration context.
Definition: ca_cfg_mgr.h:171
virtual process::ConfigPtr createNewContext()
Creates a new, blank CtrlAgentCfgContext context.
Definition: ca_cfg_mgr.cc:64
virtual isc::data::ConstElementPtr parse(isc::data::ConstElementPtr config, bool check_only)
Parses configuration of the Control Agent.
Definition: ca_cfg_mgr.cc:69
virtual ~CtrlAgentCfgMgr()
Destructor.
Definition: ca_cfg_mgr.cc:37
Wrapper class that holds hooks libraries configuration.
Definition: hooks_config.h:36
Base class for all configurations.
Definition: config_base.h:31
Configuration Manager.
Definition: d_cfg_mgr.h:106
ConfigPtr & getContext()
Fetches the configuration context.
Definition: d_cfg_mgr.h:149
boost::shared_ptr< CtrlAgentCfgContext > CtrlAgentCfgContextPtr
Pointer to a configuration context.
Definition: ca_cfg_mgr.h:22
boost::shared_ptr< CtrlAgentCfgMgr > CtrlAgentCfgMgrPtr
Defines a shared pointer to CtrlAgentCfgMgr.
Definition: ca_cfg_mgr.h:208
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< Element > ElementPtr
Definition: data.h:22
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the SrvConfig.
Definition: config_base.h:119
Defines the logger used by the top-level component of kea-dhcp-ddns.