| Kea 3.0.2-git

isc::agent::CtrlAgentCfgContext Class Reference

Control Agent Configuration Context. More...

`#include <ca_cfg_mgr.h>`

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

## Public Member Functions
| CtrlAgentCfgContext ()
| Default constructor.
virtual process::ConfigPtr | clone ()
| Creates a clone of this context object.
const isc::http::HttpAuthConfigPtr & | getAuthConfig () const
| Returns HTTP authentication configuration.
std::string | getCertFile () const
| Returns cert-file parameter.
bool | getCertRequired () const
| Returns cert-required parameter.
isc::data::ConstElementPtr | getControlSocketInfo (const std::string &service) const
| Returns information about control socket.
std::string | getControlSocketInfoSummary () const
| Returns socket configuration summary in a textual format.
isc::hooks::HooksConfig & | getHooksConfig ()
| Returns non-const reference to configured hooks libraries.
const isc::hooks::HooksConfig & | getHooksConfig () const
| Returns const reference to configured hooks libraries.
const isc::http::CfgHttpHeaders & | getHttpHeaders () const
| Returns http-headers parameter.
std::string | getHttpHost () const
| Returns http-host parameter.
uint16_t | getHttpPort () const
| Returns the TCP post the HTTP server will listen on.
std::string | getKeyFile () const
| Returns key-file parameter.
std::string | getTrustAnchor () const
| Returns trust-anchor parameter.
void | setAuthConfig (const isc::http::HttpAuthConfigPtr &auth_config)
| Sets HTTP authentication configuration.
void | setCertFile (const std::string &cert)
| Sets cert-file parameter.
void | setCertRequired (bool required)
| Sets cert-required parameter.
void | setControlSocketInfo (const isc::data::ConstElementPtr &control_socket, const std::string &service)
| Sets information about the control socket.
void | setHttpHeaders (const isc::http::CfgHttpHeaders &headers)
| Sets http-headers parameter.
void | setHttpHost (const std::string &host)
| Sets http-host parameter.
void | setHttpPort (const uint16_t port)
| Sets http port.
void | setKeyFile (const std::string &key)
| Sets key-file parameter.
void | setTrustAnchor (const std::string &ca)
| Sets trust-anchor parameter.
virtual isc::data::ElementPtr | toElement () const
| Unparse a configuration object.
const process::LoggingInfoStorage & | getLoggingInfo () const
| Returns logging specific configuration.
void | addLoggingInfo (const process::LoggingInfo &logging_info)
| Sets logging specific configuration.
void | applyLoggingCfg () const
| Apply logging configuration to log4cplus.
bool | equals (const ConfigBase &other) const
| Compares two configuration.
virtual void | merge (ConfigBase &other)
| Merges specified configuration into this configuration.
process::ConstConfigControlInfoPtr | getConfigControlInfo () const
| Fetches a read-only copy of the configuration control information.
void | setConfigControlInfo (const process::ConfigControlInfoPtr &config_ctl_info)
| Set the configuration control information.
void | setServerTag (const util::Optional< std::string > &server_tag)
| Sets the server's logical name.
util::Optional< std::string > | getServerTag () const
| Returns the server's logical name.
boost::posix_time::ptime | getLastCommitTime () const
| Returns the last commit timestamp.
void | setLastCommitTime (const boost::posix_time::ptime &last_commit_time)
| Sets the last commit timestamp.
Public Member Functions inherited from isc::data::UserContext
void | contextToElement (data::ElementPtr map) const
| Merge unparse a user_context object.
data::ConstElementPtr | getContext () const
| Returns const pointer to the user context.
void | setContext (const data::ConstElementPtr &ctx)
| Sets user context.
Public Member Functions inherited from isc::data::CfgToElement
virtual | ~CfgToElement ()
| Destructor.

## Additional Inherited Members
Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr | toElement (data::ConstElementPtr map)
| Copy an Element map.
void | copy (ConfigBase &new_config) const
| Copies the current configuration to a new configuration.
Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr | user_context_
| Pointer to the user context (may be NULL).

## Detailed Description

Control Agent Configuration Context.

Implement the storage container for configuration context. It provides a single enclosure for the storage of configuration parameters and any other Control Agent specific information that needs to be accessible during configuration parsing as well as to the application as a whole. It is derived from the context base class, ConfigBase.

Definition at line 33 of file ca_cfg_mgr.h.

## Constructor & Destructor Documentation

## ◆ CtrlAgentCfgContext()

isc::agent::CtrlAgentCfgContext::CtrlAgentCfgContext | ( |  | ) |

Default constructor.

Definition at line 25 of file ca_cfg_mgr.cc.

Referenced by clone().

## Member Function Documentation

## ◆ clone()

virtual process::ConfigPtr isc::agent::CtrlAgentCfgContext::clone | ( |  | ) |
| inline virtual

Creates a clone of this context object.

Note this method does not do deep copy the information about control sockets. That data is stored as ConstElementPtr (a shared pointer) to the actual data.

Returns
  A pointer to the new clone.

Definition at line 45 of file ca_cfg_mgr.h.

References CtrlAgentCfgContext().

Here is the call graph for this function:

## ◆ getAuthConfig()

const isc::http::HttpAuthConfigPtr & isc::agent::CtrlAgentCfgContext::getAuthConfig | ( |  | ) | const
| inline

Returns HTTP authentication configuration.

Note
  Only the basic HTTP authentication is supported.

Returns
  HTTP authentication configuration.

Definition at line 131 of file ca_cfg_mgr.h.

## ◆ getCertFile()

std::string isc::agent::CtrlAgentCfgContext::getCertFile | ( |  | ) | const
| inline

Returns cert-file parameter.

Returns
  Server certificate file name

Definition at line 160 of file ca_cfg_mgr.h.

## ◆ getCertRequired()

bool isc::agent::CtrlAgentCfgContext::getCertRequired | ( |  | ) | const
| inline

Returns cert-required parameter.

Returns
  True when client certificates are required, false when they are optional, the default is to require them (true).

Definition at line 190 of file ca_cfg_mgr.h.

## ◆ getControlSocketInfo()

data::ConstElementPtr isc::agent::CtrlAgentCfgContext::getControlSocketInfo | ( | const std::string & | service | ) | const

Returns information about control socket.

This method returns Element tree structure that describes the control socket (or null pointer if the socket is not defined for a particular server type). This information is expected to be compatible with data passed to isc::config::UnixCommandMgr::openCommandSocket.

Parameters

  service | server being controlled

Returns
  pointer to the Element that holds control-socket map (or NULL)

Definition at line 153 of file ca_cfg_mgr.cc.

## ◆ getControlSocketInfoSummary()

std::string isc::agent::CtrlAgentCfgContext::getControlSocketInfoSummary | ( |  | ) | const

Returns socket configuration summary in a textual format.

Definition at line 165 of file ca_cfg_mgr.cc.

## ◆ getHooksConfig() [1/2]

isc::hooks::HooksConfig & isc::agent::CtrlAgentCfgContext::getHooksConfig | ( |  | ) |
| inline

Returns non-const reference to configured hooks libraries.

Returns
  non-const reference to configured hooks libraries.

Definition at line 197 of file ca_cfg_mgr.h.

## ◆ getHooksConfig() [2/2]

const isc::hooks::HooksConfig & isc::agent::CtrlAgentCfgContext::getHooksConfig | ( |  | ) | const
| inline

Returns const reference to configured hooks libraries.

Returns
  const reference to configured hooks libraries.

Definition at line 204 of file ca_cfg_mgr.h.

## ◆ getHttpHeaders()

const isc::http::CfgHttpHeaders & isc::agent::CtrlAgentCfgContext::getHttpHeaders | ( |  | ) | const
| inline

Returns http-headers parameter.

Returns
  Collection of config HTTP headers.

Definition at line 113 of file ca_cfg_mgr.h.

## ◆ getHttpHost()

std::string isc::agent::CtrlAgentCfgContext::getHttpHost | ( |  | ) | const
| inline

Returns http-host parameter.

Returns
  Hostname or IP address where the agent's HTTP service is available.

Definition at line 87 of file ca_cfg_mgr.h.

## ◆ getHttpPort()

uint16_t isc::agent::CtrlAgentCfgContext::getHttpPort | ( |  | ) | const
| inline

Returns the TCP post the HTTP server will listen on.

Definition at line 99 of file ca_cfg_mgr.h.

## ◆ getKeyFile()

std::string isc::agent::CtrlAgentCfgContext::getKeyFile | ( |  | ) | const
| inline

Returns key-file parameter.

Returns
  Server private key file name

Definition at line 174 of file ca_cfg_mgr.h.

## ◆ getTrustAnchor()

std::string isc::agent::CtrlAgentCfgContext::getTrustAnchor | ( |  | ) | const
| inline

Returns trust-anchor parameter.

Returns
  Trust anchor aka Certificate Authority

Definition at line 146 of file ca_cfg_mgr.h.

## ◆ setAuthConfig()

void isc::agent::CtrlAgentCfgContext::setAuthConfig | ( | const isc::http::HttpAuthConfigPtr & | auth_config | ) |
| inline

Sets HTTP authentication configuration.

Note
  Only the basic HTTP authentication is supported.

Parameters

  auth_config | HTTP authentication configuration.

Definition at line 122 of file ca_cfg_mgr.h.

## ◆ setCertFile()

void isc::agent::CtrlAgentCfgContext::setCertFile | ( | const std::string & | cert | ) |
| inline

Sets cert-file parameter.

Parameters

  cert | Server certificate file name

Definition at line 153 of file ca_cfg_mgr.h.

## ◆ setCertRequired()

void isc::agent::CtrlAgentCfgContext::setCertRequired | ( | bool | required | ) |
| inline

Sets cert-required parameter.

Parameters

  required | Client certificates are required when true (the default) or optional when false

Definition at line 182 of file ca_cfg_mgr.h.

## ◆ setControlSocketInfo()

void isc::agent::CtrlAgentCfgContext::setControlSocketInfo | ( | const isc::data::ConstElementPtr & | control_socket,
|  | const std::string & | service )

Sets information about the control socket.

This method stores Element tree structure that describes the control socket. This information is expected to be compatible with data passed to isc::config::UnixCommandMgr::openCommandSocket.

Parameters

  control_socket | Element that holds control-socket map
  service | server being controlled

Definition at line 159 of file ca_cfg_mgr.cc.

## ◆ setHttpHeaders()

void isc::agent::CtrlAgentCfgContext::setHttpHeaders | ( | const isc::http::CfgHttpHeaders & | headers | ) |
| inline

Sets http-headers parameter.

Parameters

  headers | Collection of config HTTP headers.

Definition at line 106 of file ca_cfg_mgr.h.

## ◆ setHttpHost()

void isc::agent::CtrlAgentCfgContext::setHttpHost | ( | const std::string & | host | ) |
| inline

Sets http-host parameter.

Parameters

  host | Hostname or IP address where the agent's HTTP service will be available.

Definition at line 79 of file ca_cfg_mgr.h.

## ◆ setHttpPort()

void isc::agent::CtrlAgentCfgContext::setHttpPort | ( | const uint16_t | port | ) |
| inline

Sets http port.

Parameters

  port | sets the TCP port the HTTP server will listen on

Definition at line 94 of file ca_cfg_mgr.h.

## ◆ setKeyFile()

void isc::agent::CtrlAgentCfgContext::setKeyFile | ( | const std::string & | key | ) |
| inline

Sets key-file parameter.

Parameters

  key | Server private key file name

Definition at line 167 of file ca_cfg_mgr.h.

## ◆ setTrustAnchor()

void isc::agent::CtrlAgentCfgContext::setTrustAnchor | ( | const std::string & | ca | ) |
| inline

Sets trust-anchor parameter.

Parameters

  ca | Trust anchor aka Certificate Authority (can be a file name or a directory path).

Definition at line 139 of file ca_cfg_mgr.h.

## ◆ toElement()

ElementPtr isc::agent::CtrlAgentCfgContext::toElement | ( |  | ) | const
| virtual

Unparse a configuration object.

Returns an element which must parse into the same object, i.e.

for all valid config C parse(parse(C)->toElement()) == parse(C)
isc::agent::CtrlAgentCfgContext::toElement
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
Definition ca_cfg_mgr.cc:182
isc::config
Definition command_interpreter.cc:23

Returns
  a pointer to a configuration which can be parsed into the initial configuration object

Reimplemented from isc::process::ConfigBase.

Definition at line 182 of file ca_cfg_mgr.cc.

References isc::data::UserContext::contextToElement(), Element::create(), Element::createMap(), isc::data::UserContext::toElement(), and isc::process::ConfigBase::toElement().

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