Kea: isc::agent::CtrlAgentCfgMgr Class Reference

| Kea 2.2.0

Public Member Functions | Protected Member Functions | List of all members
isc::agent::CtrlAgentCfgMgr Class Reference

Ctrl Agent Configuration Manager. More...

`#include <ca_cfg_mgr.h>`

Inheritance diagram for isc::agent::CtrlAgentCfgMgr:
[legend]

## Public Member Functions
| CtrlAgentCfgMgr ()
| Constructor. More...
virtual | ~CtrlAgentCfgMgr ()
| Destructor. More...
virtual std::string | getConfigSummary (const uint32_t selection) override
| Returns configuration summary in the textual format. More...
CtrlAgentCfgContextPtr | getCtrlAgentCfgContext ()
| Convenience method that returns the Control Agent configuration context. More...
Public Member Functions inherited from isc::process::DCfgMgrBase
| DCfgMgrBase (ConfigPtr context)
| Constructor. More...
virtual | ~DCfgMgrBase ()
| Destructor. More...
virtual std::string | getConfigSummary (const uint32_t selection)=0
| Returns configuration summary in the textual format. More...
ConfigPtr & | getContext ()
| Fetches the configuration context. More...
isc::data::ConstElementPtr | redactConfig (isc::data::ConstElementPtr const &config) const
| Redact the configuration. More...
isc::data::ConstElementPtr | simpleParseConfig (isc::data::ConstElementPtr config, bool check_only=false, const std::function< void()> &post_config_cb=nullptr)
| Acts as the receiver of new configurations. More...

## Protected Member Functions
virtual process::ConfigPtr | createNewContext () override
| Creates a new, blank CtrlAgentCfgContext context. More...
std::list< std::list< std::string > > | jsonPathsToRedact () const final override
| Return a list of all paths that contain passwords or secrets. More...
virtual isc::data::ConstElementPtr | parse (isc::data::ConstElementPtr config, bool check_only) override
| Parses configuration of the Control Agent. More...
Protected Member Functions inherited from isc::process::DCfgMgrBase
virtual ConfigPtr | createNewContext ()=0
| Abstract factory which creates a context instance. More...
virtual std::list< std::list< std::string > > | jsonPathsToRedact () const
| Return a list of all paths that contain passwords or secrets. More...
virtual isc::data::ConstElementPtr | parse (isc::data::ConstElementPtr config, bool check_only)
| Parses actual configuration. More...
void | resetContext ()
| Replaces existing context with a new, empty context. More...
virtual void | setCfgDefaults (isc::data::ElementPtr mutable_config)
| Adds default values to the given config. More...
void | setContext (ConfigPtr &context)
| Update the current context. More...

## Detailed Description

Ctrl Agent Configuration Manager.

Provides the mechanisms for managing the Control Agent application's configuration.

Definition at line 253 of file ca_cfg_mgr.h.

## Constructor & Destructor Documentation

## ◆ CtrlAgentCfgMgr()

isc::agent::CtrlAgentCfgMgr::CtrlAgentCfgMgr | ( |  | ) |

Constructor.

Definition at line 38 of file ca_cfg_mgr.cc.

## ◆ ~CtrlAgentCfgMgr()

isc::agent::CtrlAgentCfgMgr::~CtrlAgentCfgMgr | ( |  | ) |
| virtual

Destructor.

Definition at line 42 of file ca_cfg_mgr.cc.

## Member Function Documentation

## ◆ createNewContext()

ConfigPtr isc::agent::CtrlAgentCfgMgr::createNewContext | ( |  | ) |
| overrideprotectedvirtual

Creates a new, blank CtrlAgentCfgContext context.

This method is used at the beginning of configuration process to create a fresh, empty copy of a CtrlAgentCfgContext. This new context will be populated during the configuration process and will replace the existing context provided the configuration process completes without error.

Returns
  Returns a ConfigPtr to the new context instance.

Implements isc::process::DCfgMgrBase.

Definition at line 88 of file ca_cfg_mgr.cc.

## ◆ getConfigSummary()

std::string isc::agent::CtrlAgentCfgMgr::getConfigSummary | ( | const uint32_t | selection | ) |
| overridevirtual

Returns configuration summary in the textual format.

Parameters

  selection | Bitfield which describes the parts of the configuration to be returned. This parameter is ignored for the Control Agent.

Returns
  Summary of the configuration in the textual format.

Implements isc::process::DCfgMgrBase.

Definition at line 46 of file ca_cfg_mgr.cc.

References getCtrlAgentCfgContext().

Here is the call graph for this function:

## ◆ getCtrlAgentCfgContext()

CtrlAgentCfgContextPtr isc::agent::CtrlAgentCfgMgr::getCtrlAgentCfgContext | ( |  | ) |
| inline

Convenience method that returns the Control Agent configuration context.

Returns
  returns a pointer to the configuration context.

Definition at line 266 of file ca_cfg_mgr.h.

References isc::process::DCfgMgrBase::getContext().

Referenced by getConfigSummary(), and parse().

Here is the call graph for this function:

## ◆ jsonPathsToRedact()

std::list< std::list< std::string > > isc::agent::CtrlAgentCfgMgr::jsonPathsToRedact | ( |  | ) | const
| finaloverrideprotectedvirtual

Return a list of all paths that contain passwords or secrets.

Used in isc::process::DCfgMgrBase::redactConfig.

Returns
  the list of lists of sequential JSON map keys needed to reach the passwords and secrets.

Reimplemented from isc::process::DCfgMgrBase.

Definition at line 143 of file ca_cfg_mgr.cc.

## ◆ parse()

ConstElementPtr isc::agent::CtrlAgentCfgMgr::parse | ( | isc::data::ConstElementPtr | config,
|  | bool | check_only
| ) |  |
| overrideprotectedvirtual

Parses configuration of the Control Agent.

Parameters

  config | Pointer to a configuration specified for the agent.
  check_only | Boolean flag indicating if this method should only verify correctness of the provided configuration.

Returns
  Pointer to a result of configuration parsing.

Reimplemented from isc::process::DCfgMgrBase.

Definition at line 93 of file ca_cfg_mgr.cc.

References isc::agent::agent_logger, isc::agent::AgentSimpleParser::checkTlsSetup(), isc::config::CONTROL_RESULT_ERROR, isc::config::CONTROL_RESULT_SUCCESS, isc::config::createAnswer(), isc::agent::CTRL_AGENT_CONFIG_CHECK_FAIL, isc::agent::CTRL_AGENT_CONFIG_FAIL, getCtrlAgentCfgContext(), isc_throw, LOG_ERROR, isc::agent::AgentSimpleParser::parse(), isc::agent::AgentSimpleParser::setAllDefaults(), and isc::Exception::what().

Here is the call graph for this function:

The documentation for this class was generated from the following files:

- ca_cfg_mgr.h
- ca_cfg_mgr.cc