Kea 2.2.0
netconf_cfg_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2018-2021 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>
14#include <boost/pointer_cast.hpp>
15#include <map>
16#include <string>
17
18namespace isc {
19namespace netconf {
20
21class NetconfConfig;
23typedef boost::shared_ptr<NetconfConfig> NetconfConfigPtr;
24
33public:
34
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
96private:
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
125public:
126
129
131 virtual ~NetconfCfgMgr() = default;
132
138 return (boost::dynamic_pointer_cast<NetconfConfig>(getContext()));
139 }
140
147 virtual std::string getConfigSummary(const uint32_t selection);
148
154 std::list<std::list<std::string>> jsonPathsToRedact() const;
155
156protected:
157
165 parse(isc::data::ConstElementPtr config, bool check_only);
166
178};
179
181typedef boost::shared_ptr<NetconfCfgMgr> NetconfCfgMgrPtr;
182
183} // namespace isc::netconf
184} // namespace isc
185
186#endif // NETCONF_CFG_MGR_H
Wrapper class that holds hooks libraries configuration.
Definition: hooks_config.h:36
Ctrl Netconf Configuration Manager.
virtual process::ConfigPtr createNewContext()
Creates a new, blank NetconfConfig context.
virtual std::string getConfigSummary(const uint32_t selection)
Returns configuration summary in the textual format.
NetconfConfigPtr getNetconfConfig()
Convenience method that returns the Netconf configuration context.
virtual isc::data::ConstElementPtr parse(isc::data::ConstElementPtr config, bool check_only)
Parses configuration of Netconf.
std::list< std::list< std::string > > jsonPathsToRedact() const
Return a list of all paths that contain passwords or secrets for kea-netconf.
virtual ~NetconfCfgMgr()=default
Destructor.
Netconf Configuration Context.
NetconfConfig()
Default constructor.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
const isc::hooks::HooksConfig & getHooksConfig() const
Returns const reference to configured hooks libraries.
CfgServersMapPtr & getCfgServersMap()
Returns non-const reference to the managed servers map.
const CfgServersMapPtr & getCfgServersMap() const
Returns const reference to the managed servers map.
isc::hooks::HooksConfig & getHooksConfig()
Returns non-const reference to configured hooks libraries.
void extractConfiguredGlobals(isc::data::ConstElementPtr config)
Saves scalar elements from the global scope of a configuration.
void addConfiguredGlobal(const std::string &name, isc::data::ConstElementPtr value)
Adds a parameter to the collection configured globals.
isc::data::ConstElementPtr getConfiguredGlobals() const
Returns pointer to configured global parameters.
Base class for all configurations.
Definition: config_base.h:33
Configuration Manager.
Definition: d_cfg_mgr.h:108
ConfigPtr & getContext()
Fetches the configuration context.
Definition: d_cfg_mgr.h:151
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
boost::shared_ptr< NetconfCfgMgr > NetconfCfgMgrPtr
Defines a shared pointer to NetconfCfgMgr.
boost::shared_ptr< CfgServersMap > CfgServersMapPtr
Defines a pointer to map of CfgServers.
boost::shared_ptr< NetconfConfig > NetconfConfigPtr
Pointer to a configuration context.
boost::shared_ptr< ConfigBase > ConfigPtr
Non-const pointer to the ConfigBase.
Definition: config_base.h:176
Defines the logger used by the top-level component of kea-lfc.
A collection of classes for housing and parsing the application configuration necessary for the Netco...