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 
17 namespace isc {
18 namespace agent {
19 
20 class CtrlAgentCfgContext;
22 typedef boost::shared_ptr<CtrlAgentCfgContext> CtrlAgentCfgContextPtr;
23 
32 public:
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 
126 private:
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 
159 public:
160 
162  CtrlAgentCfgMgr();
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 
183 protected:
184 
192  parse(isc::data::ConstElementPtr config, bool check_only);
193 
205 };
206 
208 typedef boost::shared_ptr<CtrlAgentCfgMgr> CtrlAgentCfgMgrPtr;
209 
210 } // namespace isc::agent
211 } // namespace isc
212 
213 #endif // CTRL_AGENT_CFG_MGR_H
isc::process::ConfigBase
Base class for all configurations.
Definition: config_base.h:31
isc::agent::CtrlAgentCfgMgr::~CtrlAgentCfgMgr
virtual ~CtrlAgentCfgMgr()
Destructor.
Definition: ca_cfg_mgr.cc:37
isc::agent::CtrlAgentCfgContext::getControlSocketInfoSummary
std::string getControlSocketInfoSummary() const
Returns socket configuration summary in a textual format.
Definition: ca_cfg_mgr.cc:130
isc::process::DCfgMgrBase
Configuration Manager.
Definition: d_cfg_mgr.h:106
isc::agent::CtrlAgentCfgMgr::createNewContext
virtual process::ConfigPtr createNewContext()
Creates a new, blank CtrlAgentCfgContext context.
Definition: ca_cfg_mgr.cc:64
isc::agent::CtrlAgentCfgMgr::getConfigSummary
virtual std::string getConfigSummary(const uint32_t selection)
Returns configuration summary in the textual format.
Definition: ca_cfg_mgr.cc:41
isc::agent::CtrlAgentCfgContext::getHttpPort
uint16_t getHttpPort() const
Returns the TCP post the HTTP server will listen on.
Definition: ca_cfg_mgr.h:97
isc::agent::CtrlAgentCfgContext::clone
virtual process::ConfigPtr clone()
Creates a clone of this context object.
Definition: ca_cfg_mgr.h:43
isc::agent::CtrlAgentCfgMgr::CtrlAgentCfgMgr
CtrlAgentCfgMgr()
Constructor.
Definition: ca_cfg_mgr.cc:33
isc::agent::CtrlAgentCfgContext::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: ca_cfg_mgr.cc:147
isc::agent::CtrlAgentCfgMgr::getCtrlAgentCfgContext
CtrlAgentCfgContextPtr getCtrlAgentCfgContext()
Convenience method that returns the Control Agent configuration context.
Definition: ca_cfg_mgr.h:171
isc::agent::CtrlAgentCfgMgrPtr
boost::shared_ptr< CtrlAgentCfgMgr > CtrlAgentCfgMgrPtr
Defines a shared pointer to CtrlAgentCfgMgr.
Definition: ca_cfg_mgr.h:208
isc::agent::CtrlAgentCfgContext::getControlSocketInfo
isc::data::ConstElementPtr getControlSocketInfo(const std::string &service) const
Returns information about control socket.
Definition: ca_cfg_mgr.cc:118
isc::process::ConfigPtr
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the SrvConfig.
Definition: config_base.h:119
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::agent::CtrlAgentCfgContext::getHttpHost
std::string getHttpHost() const
Returns http-host parameter.
Definition: ca_cfg_mgr.h:85
isc::agent::CtrlAgentCfgContext
Control Agent Configuration Context.
Definition: ca_cfg_mgr.h:31
isc::hooks::HooksConfig
Wrapper class that holds hooks libraries configuration.
Definition: hooks_config.h:36
isc::agent::CtrlAgentCfgContext::getHooksConfig
isc::hooks::HooksConfig & getHooksConfig()
Returns non-const reference to configured hooks libraries.
Definition: ca_cfg_mgr.h:104
isc::agent::CtrlAgentCfgContext::CtrlAgentCfgContext
CtrlAgentCfgContext()
Default constructor.
Definition: ca_cfg_mgr.cc:23
isc::agent::CtrlAgentCfgContext::setHttpHost
void setHttpHost(const std::string &host)
Sets http-host parameter.
Definition: ca_cfg_mgr.h:77
isc::agent::CtrlAgentCfgContext::setControlSocketInfo
void setControlSocketInfo(const isc::data::ConstElementPtr &control_socket, const std::string &service)
Sets information about the control socket.
Definition: ca_cfg_mgr.cc:124
isc::agent::CtrlAgentCfgContextPtr
boost::shared_ptr< CtrlAgentCfgContext > CtrlAgentCfgContextPtr
Pointer to a configuration context.
Definition: ca_cfg_mgr.h:20
isc::agent::CtrlAgentCfgContext::getHooksConfig
const isc::hooks::HooksConfig & getHooksConfig() const
Returns const reference to configured hooks libraries.
Definition: ca_cfg_mgr.h:111
isc::agent::CtrlAgentCfgMgr::parse
virtual isc::data::ConstElementPtr parse(isc::data::ConstElementPtr config, bool check_only)
Parses configuration of the Control Agent.
Definition: ca_cfg_mgr.cc:69
isc::process::DCfgMgrBase::getContext
ConfigPtr & getContext()
Fetches the configuration context.
Definition: d_cfg_mgr.h:149
data.h
d_cfg_mgr.h
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
isc::agent::CtrlAgentCfgContext::setHttpPort
void setHttpPort(const uint16_t port)
Sets http port.
Definition: ca_cfg_mgr.h:92
hooks_config.h
isc::agent::CtrlAgentCfgMgr
Ctrl Agent Configuration Manager.
Definition: ca_cfg_mgr.h:158