Kea 2.5.8
isc::process::ConfigControlInfo Class Reference

Embodies configuration information used during a server's configuration process. More...

#include <config_ctl_info.h>

+ Inheritance diagram for isc::process::ConfigControlInfo:

Public Member Functions

 ConfigControlInfo ()
 Constructor.
 
 ConfigControlInfo (const ConfigControlInfo &other)
 Copy Constructor.
 
void addConfigDatabase (const std::string &access_str)
 Sets configuration database access string.
 
void clear ()
 Empties the contents of the class, including the database list.
 
bool equals (const ConfigControlInfo &other) const
 Compares two objects for equality.
 
const ConfigDbInfofindConfigDb (const std::string &param_name, const std::string &param_value)
 Retrieves the database with the given access parameter value.
 
const ConfigDbInfoListgetConfigDatabases () const
 Retrieves the list of databases.
 
const util::Optional< uint16_t > & getConfigFetchWaitTime () const
 Returns configured config-fetch-wait-time value.
 
void merge (const ConfigControlInfo &other)
 Merges specified configuration into this configuration.
 
void setConfigFetchWaitTime (const util::Optional< uint16_t > &config_fetch_wait_time)
 Sets new value of the config-fetch-wait-time.
 
virtual isc::data::ElementPtr toElement () const
 Unparse a configuration object.
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor.
 
virtual isc::data::ElementPtr toElement () const =0
 Unparse a configuration object.
 

Static Public Member Functions

static const ConfigDbInfoEMPTY_DB ()
 Fetches the not-found value returned by database list searches.
 

Detailed Description

Embodies configuration information used during a server's configuration process.

This is class conveys the configuration control information described by the following JSON text:

"config-control" :
{
"config-databases":
[
{
# first config db
# common database access parameters
"type": <"mysql"|"postgresql">,
"name": <"db name">,
"host": <"db host name">,
:
},
{
# next config db
}
]
}

Definition at line 141 of file config_ctl_info.h.

Constructor & Destructor Documentation

◆ ConfigControlInfo() [1/2]

isc::process::ConfigControlInfo::ConfigControlInfo ( )
inline

Constructor.

Definition at line 145 of file config_ctl_info.h.

◆ ConfigControlInfo() [2/2]

isc::process::ConfigControlInfo::ConfigControlInfo ( const ConfigControlInfo other)

Copy Constructor.

Definition at line 48 of file config_ctl_info.cc.

References addConfigDatabase().

+ Here is the call graph for this function:

Member Function Documentation

◆ addConfigDatabase()

void isc::process::ConfigControlInfo::addConfigDatabase ( const std::string &  access_str)

Sets configuration database access string.

Parameters
access_strdatabase access string.
Exceptions
BadValueif an entry exists that matches the parameters in the given access string, or if the access string is invalid.

Definition at line 56 of file config_ctl_info.cc.

References isc_throw, and isc::process::ConfigDbInfo::setAccessString().

Referenced by ConfigControlInfo().

+ Here is the call graph for this function:

◆ clear()

void isc::process::ConfigControlInfo::clear ( )

Empties the contents of the class, including the database list.

Definition at line 91 of file config_ctl_info.cc.

◆ EMPTY_DB()

const ConfigDbInfo & isc::process::ConfigControlInfo::EMPTY_DB ( )
static

Fetches the not-found value returned by database list searches.

Returns
a reference to the empty ConfigDBInfo.

Definition at line 85 of file config_ctl_info.cc.

Referenced by findConfigDb().

◆ equals()

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

Compares two objects for equality.

Parameters
otherAn object to be compared with this object.
Returns
true if objects are equal, false otherwise.

Definition at line 122 of file config_ctl_info.cc.

References isc::util::Optional< T >::get().

+ Here is the call graph for this function:

◆ findConfigDb()

const ConfigDbInfo & isc::process::ConfigControlInfo::findConfigDb ( const std::string &  param_name,
const std::string &  param_value 
)

Retrieves the database with the given access parameter value.

Returns
A reference to the matching database or the not-found value available via EMPTY_DB().

Definition at line 72 of file config_ctl_info.cc.

References EMPTY_DB().

+ Here is the call graph for this function:

◆ getConfigDatabases()

const ConfigDbInfoList & isc::process::ConfigControlInfo::getConfigDatabases ( ) const
inline

Retrieves the list of databases.

The entries in the list are stored in the order they were added to it (FIFO).

Returns
a reference to a const list of databases.

Definition at line 189 of file config_ctl_info.h.

◆ getConfigFetchWaitTime()

const util::Optional< uint16_t > & isc::process::ConfigControlInfo::getConfigFetchWaitTime ( ) const
inline

Returns configured config-fetch-wait-time value.

This value specifies the time period in seconds between the attempts to fetch the server configuration updates via the configuration backends. The value of 0 means that the mechanism to periodically fetch the configuration updates is disabled.

Returns
Time period between the subsequent attempts to fetch server configuration updates in seconds.

Definition at line 171 of file config_ctl_info.h.

◆ merge()

void isc::process::ConfigControlInfo::merge ( const ConfigControlInfo other)

Merges specified configuration into this configuration.

If the other configuration is non-empty it completely replaces this configuration.

Parameters
otherthe other configuration to be merged into this configuration.

Definition at line 97 of file config_ctl_info.cc.

◆ setConfigFetchWaitTime()

void isc::process::ConfigControlInfo::setConfigFetchWaitTime ( const util::Optional< uint16_t > &  config_fetch_wait_time)
inline

Sets new value of the config-fetch-wait-time.

Parameters
config_fetch_wait_timeNew value of the parameter which specifies a time period in seconds between the attempts to fetch the server configuration updates. The value of 0 disables the periodic attempts to fetch the updates.

Definition at line 157 of file config_ctl_info.h.

◆ toElement()

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

Unparse a configuration object.

Returns
a pointer to unparsed configuration.

Implements isc::data::CfgToElement.

Definition at line 104 of file config_ctl_info.cc.

References isc::data::Element::create(), isc::data::Element::createList(), isc::data::Element::createMap(), and isc::util::Optional< T >::unspecified().

+ Here is the call graph for this function:

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