Kea  1.5.0
netconf_cfg_mgr.h
Go to the documentation of this file.
1 // Copyright (C) 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 NETCONF_CFG_MGR_H
8 #define NETCONF_CFG_MGR_H
9 
10 #include <cc/data.h>
11 #include <hooks/hooks_config.h>
12 #include <process/d_cfg_mgr.h>
13 #include <netconf/netconf_config.h>
14 #include <boost/pointer_cast.hpp>
15 #include <map>
16 #include <string>
17 
18 namespace isc {
19 namespace netconf {
20 
21 class NetconfConfig;
23 typedef boost::shared_ptr<NetconfConfig> NetconfConfigPtr;
24 
33 public:
34 
36  NetconfConfig();
37 
42  return (isc::data::ConstElementPtr(configured_globals_));
43  }
44 
47 
52  void addConfiguredGlobal(const std::string& name,
54  configured_globals_->set(name, value);
55  }
56 
61  return (servers_map_);
62  }
63 
68  return (servers_map_);
69  }
70 
75  return (hooks_config_);
76  }
77 
82  return (hooks_config_);
83  }
84 
94  virtual isc::data::ElementPtr toElement() const;
95 
96 private:
97 
103  NetconfConfig(const NetconfConfig& orig);
104 
108  NetconfConfig& operator=(const NetconfConfig& rhs);
109 
111  isc::data::ElementPtr configured_globals_;
112 
114  CfgServersMapPtr servers_map_;
115 
117  isc::hooks::HooksConfig hooks_config_;
118 };
119 
125 public:
126 
128  NetconfCfgMgr();
129 
131  virtual ~NetconfCfgMgr();
132 
138  return (boost::dynamic_pointer_cast<NetconfConfig>(getContext()));
139  }
140 
147  virtual std::string getConfigSummary(const uint32_t selection);
148 
149 protected:
150 
158  parse(isc::data::ConstElementPtr config, bool check_only);
159 
171 };
172 
174 typedef boost::shared_ptr<NetconfCfgMgr> NetconfCfgMgrPtr;
175 
176 } // namespace isc::netconf
177 } // namespace isc
178 
179 #endif // NETCONF_CFG_MGR_H
isc::process::ConfigBase
Base class for all configurations.
Definition: config_base.h:31
isc::process::DCfgMgrBase
Configuration Manager.
Definition: d_cfg_mgr.h:106
isc::netconf::NetconfConfig
Netconf Configuration Context.
Definition: netconf_cfg_mgr.h:32
isc::netconf::NetconfConfig::NetconfConfig
NetconfConfig()
Default constructor.
Definition: netconf_cfg_mgr.cc:23
isc::netconf::NetconfConfig::getHooksConfig
isc::hooks::HooksConfig & getHooksConfig()
Returns non-const reference to configured hooks libraries.
Definition: netconf_cfg_mgr.h:74
isc::netconf::NetconfCfgMgr::getNetconfConfig
NetconfConfigPtr getNetconfConfig()
Convenience method that returns the Netconf configuration context.
Definition: netconf_cfg_mgr.h:137
isc::netconf::CfgServersMapPtr
boost::shared_ptr< CfgServersMap > CfgServersMapPtr
Defines a pointer to map of CfgServers.
Definition: netconf_config.h:261
isc::netconf::NetconfConfig::extractConfiguredGlobals
void extractConfiguredGlobals(isc::data::ConstElementPtr config)
Saves scalar elements from the global scope of a configuration.
Definition: netconf_cfg_mgr.cc:34
isc::netconf::NetconfConfig::addConfiguredGlobal
void addConfiguredGlobal(const std::string &name, isc::data::ConstElementPtr value)
Adds a parameter to the collection configured globals.
Definition: netconf_cfg_mgr.h:52
isc::netconf::NetconfCfgMgr::NetconfCfgMgr
NetconfCfgMgr()
Constructor.
Definition: netconf_cfg_mgr.cc:49
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::netconf::NetconfConfig::getCfgServersMap
CfgServersMapPtr & getCfgServersMap()
Returns non-const reference to the managed servers map.
Definition: netconf_cfg_mgr.h:60
isc::hooks::HooksConfig
Wrapper class that holds hooks libraries configuration.
Definition: hooks_config.h:36
isc::netconf::NetconfConfigPtr
boost::shared_ptr< NetconfConfig > NetconfConfigPtr
Pointer to a configuration context.
Definition: netconf_cfg_mgr.h:21
isc::netconf::NetconfCfgMgr
Ctrl Netconf Configuration Manager.
Definition: netconf_cfg_mgr.h:124
netconf_config.h
A collection of classes for housing and parsing the application configuration necessary for the Netco...
isc::netconf::NetconfCfgMgr::~NetconfCfgMgr
virtual ~NetconfCfgMgr()
Destructor.
Definition: netconf_cfg_mgr.cc:53
isc::netconf::NetconfCfgMgr::getConfigSummary
virtual std::string getConfigSummary(const uint32_t selection)
Returns configuration summary in the textual format.
Definition: netconf_cfg_mgr.cc:57
isc::netconf::NetconfConfig::getConfiguredGlobals
isc::data::ConstElementPtr getConfiguredGlobals() const
Returns pointer to configured global parameters.
Definition: netconf_cfg_mgr.h:41
isc::netconf::NetconfCfgMgr::createNewContext
virtual process::ConfigPtr createNewContext()
Creates a new, blank NetconfConfig context.
Definition: netconf_cfg_mgr.cc:87
isc::process::DCfgMgrBase::getContext
ConfigPtr & getContext()
Fetches the configuration context.
Definition: d_cfg_mgr.h:149
isc::netconf::NetconfConfig::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition: netconf_cfg_mgr.cc:146
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::netconf::NetconfConfig::getCfgServersMap
const CfgServersMapPtr & getCfgServersMap() const
Returns const reference to the managed servers map.
Definition: netconf_cfg_mgr.h:67
hooks_config.h
isc::netconf::NetconfCfgMgr::parse
virtual isc::data::ConstElementPtr parse(isc::data::ConstElementPtr config, bool check_only)
Parses configuration of Netconf.
Definition: netconf_cfg_mgr.cc:92
isc::netconf::NetconfConfig::getHooksConfig
const isc::hooks::HooksConfig & getHooksConfig() const
Returns const reference to configured hooks libraries.
Definition: netconf_cfg_mgr.h:81
isc::netconf::NetconfCfgMgrPtr
boost::shared_ptr< NetconfCfgMgr > NetconfCfgMgrPtr
Defines a shared pointer to NetconfCfgMgr.
Definition: netconf_cfg_mgr.h:174