Kea  1.5.0
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. More...
 
 ConfigControlInfo (const ConfigControlInfo &other)
 Copy Constructor. More...
 
void addConfigDatabase (const std::string &access_str)
 Sets configuration database access string. More...
 
void clear ()
 Empties the contents of the class, including the database list. More...
 
bool equals (const ConfigControlInfo &other) const
 Compares two objects for equality. More...
 
const ConfigDbInfofindConfigDb (const std::string &param_name, const std::string &param_value)
 Retrieves the datbase with the given access parameter value. More...
 
const ConfigDbInfoListgetConfigDatabases () const
 Retrieves the list of databases. More...
 
virtual isc::data::ElementPtr toElement () const
 Unparse a configuration object. More...
 
- Public Member Functions inherited from isc::data::CfgToElement
virtual ~CfgToElement ()
 Destructor. More...
 

Static Public Member Functions

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

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"|"cql">,
"name": <"db name">,
"host": <"db host name">,
:
},
{
# next config db
}
]
}

Definition at line 138 of file config_ctl_info.h.

Constructor & Destructor Documentation

◆ ConfigControlInfo() [1/2]

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

Constructor.

Definition at line 142 of file config_ctl_info.h.

◆ ConfigControlInfo() [2/2]

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

Copy Constructor.

Definition at line 45 of file config_ctl_info.cc.

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 52 of file config_ctl_info.cc.

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

+ 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 89 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 83 of file config_ctl_info.cc.

◆ 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 106 of file config_ctl_info.cc.

◆ findConfigDb()

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

Retrieves the datbase 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 68 of file config_ctl_info.cc.

◆ 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 161 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 94 of file config_ctl_info.cc.

References isc::data::Element::createList(), and isc::data::Element::createMap().

+ Here is the call graph for this function:

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