Kea
1.9.9-git
|
Holds access parameters and the configuration of the lease and hosts database connection. More...
#include <cfg_db_access.h>
Public Member Functions | |
CfgDbAccess () | |
Constructor. More... | |
void | createManagers () const |
Creates instance of lease manager and host data sources according to the configuration specified. More... | |
std::string | getHostDbAccessString () const |
Retrieves host database access string. More... | |
std::list< std::string > | getHostDbAccessStringList () const |
Retrieves host database access string. More... | |
bool | getIPReservationsUnique () const |
Returns the setting indicating if the IP reservations are unique or can be non unique. More... | |
std::string | getLeaseDbAccessString () const |
Retrieves lease database access string. More... | |
void | setAppendedParameters (const std::string &appended_parameters) |
Sets parameters which will be appended to the database access strings. More... | |
void | setHostDbAccessString (const std::string &host_db_access, bool front=false) |
Sets host database access string. More... | |
void | setIPReservationsUnique (const bool unique) |
Modifies the setting imposing whether the IP reservations are unique or can be non unique. More... | |
void | setLeaseDbAccessString (const std::string &lease_db_access) |
Sets lease database access string. More... | |
Protected Member Functions | |
std::string | getAccessString (const std::string &access_string) const |
Returns lease or host database access string. More... | |
Protected Attributes | |
std::string | appended_parameters_ |
Parameters to be appended to the database access strings. More... | |
std::list< std::string > | host_db_access_ |
Holds host database access strings. More... | |
bool | ip_reservations_unique_ |
Holds the setting whether IP reservations should be unique or can be non-unique. More... | |
std::string | lease_db_access_ |
Holds lease database access string. More... | |
Holds access parameters and the configuration of the lease and hosts database connection.
The database access strings use the same format as the strings passed to the isc::dhcp::LeaseMgrFactory::create function.
Definition at line 25 of file cfg_db_access.h.
isc::dhcp::CfgDbAccess::CfgDbAccess | ( | ) |
Constructor.
Definition at line 24 of file cfg_db_access.cc.
void isc::dhcp::CfgDbAccess::createManagers | ( | ) | const |
Creates instance of lease manager and host data sources according to the configuration specified.
Definition at line 56 of file cfg_db_access.cc.
References isc::dhcp::HostMgr::addBackend(), isc::dhcp::HostMgr::checkCacheBackend(), isc::dhcp::HostMgr::create(), isc::dhcp::LeaseMgrFactory::create(), isc::dhcp::LeaseMgrFactory::destroy(), getHostDbAccessStringList(), getLeaseDbAccessString(), isc::dhcp::HostMgr::instance(), ip_reservations_unique_, isc_throw, isc::dhcp::HostDataSourceFactory::registeredFactory(), and setIPReservationsUnique().
|
protected |
Returns lease or host database access string.
access_string | without additional (appended) parameters. |
Definition at line 93 of file cfg_db_access.cc.
References appended_parameters_.
Referenced by getHostDbAccessString(), getHostDbAccessStringList(), and getLeaseDbAccessString().
std::string isc::dhcp::CfgDbAccess::getHostDbAccessString | ( | ) | const |
Retrieves host database access string.
Definition at line 36 of file cfg_db_access.cc.
References getAccessString(), and host_db_access_.
std::list< std::string > isc::dhcp::CfgDbAccess::getHostDbAccessStringList | ( | ) | const |
Retrieves host database access string.
Definition at line 45 of file cfg_db_access.cc.
References getAccessString(), and host_db_access_.
Referenced by createManagers().
|
inline |
Returns the setting indicating if the IP reservations are unique or can be non unique.
Definition at line 99 of file cfg_db_access.h.
References ip_reservations_unique_.
std::string isc::dhcp::CfgDbAccess::getLeaseDbAccessString | ( | ) | const |
Retrieves lease database access string.
Definition at line 30 of file cfg_db_access.cc.
References getAccessString(), and lease_db_access_.
Referenced by createManagers().
|
inline |
Sets parameters which will be appended to the database access strings.
appended_parameters | String holding collection of parameters in the following format: "parameter0=value0 parameter1=value1 ...". |
Definition at line 35 of file cfg_db_access.h.
References appended_parameters_.
|
inline |
Sets host database access string.
host_db_access | New host database access string. |
front | Add at front if true, at back if false (default). |
Definition at line 62 of file cfg_db_access.h.
References host_db_access_.
|
inline |
Modifies the setting imposing whether the IP reservations are unique or can be non unique.
This flag can be set to false
when the server is explicitly configured to allow multiple hosts to have the same IP reservation in a subnet. In that case, the createManagers
function will attempt to use this setting for HostMgr
.
Note that the HostMgr
can reject the new setting if any of the host backends used does not support specifying multipe hosts with the same IP address in a subnet.
unique | new setting to be used by HostMgr . |
Definition at line 90 of file cfg_db_access.h.
References ip_reservations_unique_.
Referenced by createManagers().
|
inline |
Sets lease database access string.
lease_db_access | New lease database access string. |
Definition at line 48 of file cfg_db_access.h.
References lease_db_access_.
|
protected |
Parameters to be appended to the database access strings.
Definition at line 116 of file cfg_db_access.h.
Referenced by getAccessString(), and setAppendedParameters().
|
protected |
Holds host database access strings.
Definition at line 122 of file cfg_db_access.h.
Referenced by getHostDbAccessString(), getHostDbAccessStringList(), setHostDbAccessString(), and isc::dhcp::CfgHostDbAccess::toElement().
|
protected |
Holds the setting whether IP reservations should be unique or can be non-unique.
Definition at line 126 of file cfg_db_access.h.
Referenced by createManagers(), getIPReservationsUnique(), and setIPReservationsUnique().
|
protected |
Holds lease database access string.
Definition at line 119 of file cfg_db_access.h.
Referenced by getLeaseDbAccessString(), setLeaseDbAccessString(), and isc::dhcp::CfgLeaseDbAccess::toElement().