Kea  1.5.0
isc::process::ConfigBase Class Reference

Base class for all configurations. More...

#include <config_base.h>

+ Inheritance diagram for isc::process::ConfigBase:

Modifiers and accesors for the configuration objects.

Warning
References to the objects returned by accessors are only valid during the lifetime of the SrvConfig object which returned them.
const process::LoggingInfoStoragegetLoggingInfo () const
 Returns logging specific configuration. More...
 
void addLoggingInfo (const process::LoggingInfo &logging_info)
 Sets logging specific configuration. More...
 
void applyLoggingCfg () const
 Apply logging configuration to log4cplus. More...
 
bool equals (const ConfigBase &other) const
 Compares two configuration. More...
 
virtual isc::data::ElementPtr toElement () const
 Converts to Element representation. More...
 
process::ConstConfigControlInfoPtr getConfigControlInfo () const
 Fetches a read-only copy of the configuration control information. More...
 
void setConfigControlInfo (const process::ConfigControlInfoPtr &config_ctl_info)
 Set the configuration control information. More...
 
void copy (ConfigBase &new_config) const
 Copies the current configuration to a new configuration. More...
 

Additional Inherited Members

- Public Member Functions inherited from isc::data::UserContext
void contextToElement (data::ElementPtr map) const
 Merge unparse a user_context object. More...
 
data::ConstElementPtr getContext () const
 Returns const pointer to the user context. More...
 
void setContext (const data::ConstElementPtr &ctx)
 Sets user context. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 
- Static Public Member Functions inherited from isc::data::UserContext
static data::ElementPtr toElement (data::ConstElementPtr map)
 Copy extracting comments an Element map. More...
 
- Protected Attributes inherited from isc::data::UserContext
data::ConstElementPtr user_context_
 Pointer to the user context (may be NULL) More...
 

Detailed Description

Base class for all configurations.

This is a common base class that represents configurations. SrvConfig, D2CfgContext, CtrlAgentCfgContext and possibly other classes holding configurations are derived from this.

It should contain only those elements that are applicable to really every daemon we may have. Before adding anything here, please consider whether it would be usable by all of the following: DHCP servers, DDNS update daemon, Control Agent, Netconf daemon, DHCP relay, DHCP client.

This class currently holds information about common server configuration.

Definition at line 31 of file config_base.h.

Member Function Documentation

◆ addLoggingInfo()

void isc::process::ConfigBase::addLoggingInfo ( const process::LoggingInfo logging_info)
inline

Sets logging specific configuration.

Parameters
logging_infoNew logging configuration.

Definition at line 48 of file config_base.h.

Referenced by copy().

◆ applyLoggingCfg()

void isc::process::ConfigBase::applyLoggingCfg ( ) const

Apply logging configuration to log4cplus.

Definition at line 19 of file config_base.cc.

References isc::log::LoggerManager::process().

+ Here is the call graph for this function:

◆ copy()

void isc::process::ConfigBase::copy ( ConfigBase new_config) const
protected

Copies the current configuration to a new configuration.

This method copies only the parameters defined in this class. Since derived classes are expected to provide their own copy methods, this one is protected and can be used only by descendant classes.

Parameters
new_configthis configuration will be copied to new_config

Definition at line 69 of file config_base.cc.

References addLoggingInfo().

+ Here is the call graph for this function:

◆ equals()

bool isc::process::ConfigBase::equals ( const ConfigBase other) const

Compares two configuration.

Parameters
otherthe other configuration to compare to

Definition at line 31 of file config_base.cc.

◆ getConfigControlInfo()

process::ConstConfigControlInfoPtr isc::process::ConfigBase::getConfigControlInfo ( ) const
inline

Fetches a read-only copy of the configuration control information.

Returns
pointer to the const ConfigControlInfo

Definition at line 82 of file config_base.h.

Referenced by isc::dhcp::SrvConfig::toElement().

◆ getLoggingInfo()

const process::LoggingInfoStorage& isc::process::ConfigBase::getLoggingInfo ( ) const
inline

Returns logging specific configuration.

Definition at line 41 of file config_base.h.

◆ setConfigControlInfo()

void isc::process::ConfigBase::setConfigControlInfo ( const process::ConfigControlInfoPtr config_ctl_info)
inline

Set the configuration control information.

Updates the internal pointer to the configuration control information with the given pointer value. If the given pointer is empty, the internal pointer will be reset.

Parameters
config_ctl_infopointer to the configuration value to store.

Definition at line 94 of file config_base.h.

◆ toElement()

ElementPtr isc::process::ConfigBase::toElement ( ) const
virtual

Converts to Element representation.

This creates a Map element with the following content (expressed as JSON): {{{ { "Logging": { : } } }}}

Note that it will not contain the configuration control information (i.e. "config-control"), as this is not a top-level element, rather it belongs within the configured process element.

Returns
Element representation.

Implements isc::data::CfgToElement.

Reimplemented in isc::d2::DScalarContext, isc::dhcp::SrvConfig, isc::agent::CtrlAgentCfgContext, isc::d2::D2CfgContext, and isc::netconf::NetconfConfig.

Definition at line 86 of file config_base.cc.

References isc::asiodns::logger.


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