Kea 2.7.5
|
Base class for all configurations. More...
#include <config_base.h>
Modifiers and accesors for the configuration objects. | |
| |
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. | |
virtual isc::data::ElementPtr | toElement () const |
Converts to Element representation. | |
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. | |
void | copy (ConfigBase &new_config) const |
Copies the current configuration to a new configuration. | |
Additional Inherited Members | |
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. | |
Static Public Member Functions inherited from isc::data::UserContext | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. | |
Protected Attributes inherited from isc::data::UserContext | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) | |
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 33 of file config_base.h.
|
inline |
Sets logging specific configuration.
logging_info | New logging configuration. |
Definition at line 50 of file config_base.h.
void isc::process::ConfigBase::applyLoggingCfg | ( | ) | const |
Apply logging configuration to log4cplus.
Definition at line 23 of file config_base.cc.
References isc::log::getRootLoggerName(), and isc::log::LoggerManager::process().
|
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.
new_config | this configuration will be copied to new_config |
Definition at line 77 of file config_base.cc.
Referenced by isc::dhcp::SrvConfig::copy().
bool isc::process::ConfigBase::equals | ( | const ConfigBase & | other | ) | const |
Compares two configuration.
other | the other configuration to compare to |
Definition at line 39 of file config_base.cc.
Referenced by isc::dhcp::SrvConfig::equals().
|
inline |
Fetches a read-only copy of the configuration control information.
Definition at line 106 of file config_base.h.
Referenced by isc::dhcp::SrvConfig::toElement().
|
inline |
Returns the last commit timestamp.
Definition at line 140 of file config_base.h.
|
inline |
Returns logging specific configuration.
Definition at line 43 of file config_base.h.
Referenced by isc::dhcp::SrvConfig::toElement().
|
inline |
Returns the server's logical name.
Definition at line 134 of file config_base.h.
|
virtual |
Merges specified configuration into this configuration.
This method merges logging and config control configuration into this configuration. The new logging configuration replaces the existing configuration if the new logging configuration is non-empty. The new config control configuration replaces the existing configuration if the new logging configuration is non-null and non-empty.
merge
may modify the data in the other
object. Therefore, the caller must not rely on the data held in the other
object after the call to merge
. Also, the data held in other
must not be modified after the call to merge
because it may affect the merged configuration.If a derivation of this class implements the merge
method it should call ConfigBase::merge
.
other | the other configuration to be merged into this configuration. |
Definition at line 96 of file config_base.cc.
References isc::util::Optional< T >::get().
Referenced by isc::dhcp::SrvConfig::merge().
|
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.
config_ctl_info | pointer to the configuration value to store. |
Definition at line 118 of file config_base.h.
|
inline |
Sets the last commit timestamp.
last_commit_time | last commit timestamp. |
Definition at line 146 of file config_base.h.
|
inline |
Sets the server's logical name.
server_tag | a unique string name which identifies this server from any other configured servers |
Definition at line 127 of file config_base.h.
|
virtual |
Converts to Element representation.
This creates a Map element with the following content (expressed as JSON): {{{ { "Server": { : } } }}}
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.
Implements isc::data::CfgToElement.
Reimplemented in isc::agent::CtrlAgentCfgContext, isc::d2::D2CfgContext, isc::d2::DScalarContext, isc::dhcp::SrvConfig, and isc::netconf::NetconfConfig.
Definition at line 118 of file config_base.cc.
References isc::data::Element::create(), isc::data::Element::createList(), isc::data::Element::createMap(), isc::util::Optional< T >::get(), and isc::util::Optional< T >::unspecified().
Referenced by isc::agent::CtrlAgentCfgContext::toElement(), isc::d2::D2CfgContext::toElement(), and isc::netconf::NetconfConfig::toElement().