Kea 2.7.5
netconf_cfg_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2018-2024 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>
13#include <process/d_cfg_mgr.h>
14
15#include <string>
16
17namespace isc {
18namespace netconf {
19
20class NetconfConfig;
22using NetconfConfigPtr = boost::shared_ptr<NetconfConfig>;
23
32public:
35
40 return (isc::data::ElementPtr(configured_globals_));
41 }
42
45
50 void addConfiguredGlobal(const std::string& name,
52 configured_globals_->set(name, value);
53 }
54
59 return (servers_map_);
60 }
61
66 return (servers_map_);
67 }
68
73 return (hooks_config_);
74 }
75
80 return (hooks_config_);
81 }
82
92 isc::data::ElementPtr toElement() const override final;
93
94private:
100 NetconfConfig(const NetconfConfig& orig);
101
105 NetconfConfig& operator=(const NetconfConfig& rhs);
106
108 isc::data::ElementPtr configured_globals_;
109
111 CfgServersMapPtr servers_map_;
112
114 isc::hooks::HooksConfig hooks_config_;
115}; // NetconfConfig
116
121class NetconfCfgMgr : public process::DCfgMgrBase {
122public:
125
127 virtual ~NetconfCfgMgr() = default;
128
134 return (boost::dynamic_pointer_cast<NetconfConfig>(getContext()));
135 }
136
143 std::string getConfigSummary(const uint32_t selection) override final;
144
150 std::list<std::list<std::string>> jsonPathsToRedact() const override final;
151
152protected:
159 isc::data::ConstElementPtr
160 parse(isc::data::ConstElementPtr config, bool check_only) override final;
161
172 process::ConfigPtr createNewContext() override final;
173}; // NetconfCfgMgr
174
177
178} // namespace netconf
179} // namespace isc
180
181#endif // NETCONF_CFG_MGR_H
Wrapper class that holds hooks libraries configuration.
Ctrl Netconf Configuration Manager.
NetconfConfigPtr getNetconfConfig()
Convenience method that returns the Netconf configuration context.
virtual ~NetconfCfgMgr()=default
Destructor.
Netconf Configuration Context.
NetconfConfig()
Default constructor.
isc::data::ElementPtr getConfiguredGlobals() const
Returns pointer to configured global parameters.
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.
isc::data::ElementPtr toElement() const override final
Unparse a configuration object.
void addConfiguredGlobal(const std::string &name, isc::data::ConstElementPtr value)
Adds a parameter to the collection configured globals.
Base class for all configurations.
Definition config_base.h:33
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
boost::shared_ptr< NetconfConfig > NetconfConfigPtr
Pointer to a configuration context.
boost::shared_ptr< NetconfCfgMgr > NetconfCfgMgrPtr
Defines a shared pointer to NetconfCfgMgr.
std::shared_ptr< CfgServersMap > CfgServersMapPtr
Defines a pointer to map of CfgServers.
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...
data::ConstElementPtr getContext() const
Returns const pointer to the user context.