Kea 2.7.6
|
Holds access parameters and the configuration of the lease and hosts database connection. More...
#include <cfg_db_access.h>
Public Member Functions | |
CfgDbAccess () | |
Constructor. | |
void | createManagers () const |
Creates instance of lease manager and host data sources according to the configuration specified. | |
bool | getExtendedInfoTablesEnabled () const |
Returns the setting indicating if lease extended info tables are enabled. | |
std::string | getHostDbAccessString () const |
Retrieves host database access string. | |
std::list< std::string > | getHostDbAccessStringList () const |
Retrieves host database access string. | |
bool | getIPReservationsUnique () const |
Returns the setting indicating if the IP reservations are unique or can be non unique. | |
std::string | getLeaseDbAccessString () const |
Retrieves lease database access string. | |
void | setAppendedParameters (const std::string &appended_parameters) |
Sets parameters which will be appended to the database access strings. | |
void | setExtendedInfoTablesEnabled (const bool enabled) |
Modifies the setting whether the lease extended info tables are enabled. | |
void | setHostDbAccessString (const std::string &host_db_access, bool front=false) |
Sets host database access string. | |
void | setIPReservationsUnique (const bool unique) |
Modifies the setting imposing whether the IP reservations are unique or can be non unique. | |
void | setLeaseDbAccessString (const std::string &lease_db_access) |
Sets lease database access string. | |
Protected Member Functions | |
std::string | getAccessString (const std::string &access_string) const |
Returns lease or host database access string. | |
Protected Attributes | |
std::string | appended_parameters_ |
Parameters to be appended to the database access strings. | |
bool | extended_info_tables_enabled_ |
Holds the setting whether the lease extended info tables are enabled or disabled. | |
std::list< std::string > | host_db_access_ |
Holds host database access strings. | |
bool | ip_reservations_unique_ |
Holds the setting whether IP reservations should be unique or can be non-unique. | |
std::string | lease_db_access_ |
Holds lease database access string. | |
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 26 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 59 of file cfg_db_access.cc.
References isc::dhcp::HostMgr::addBackend(), isc::dhcp::HostMgr::checkCacheBackend(), isc::dhcp::HostMgr::create(), isc::dhcp::DHCPSRV_HOST_MGR_DB_OPEN_CONNECTION_WITH_RETRY_FAILED, isc::dhcp::DHCPSRV_LEASE_MGR_DB_OPEN_CONNECTION_WITH_RETRY_FAILED, isc::dhcp::dhcpsrv_logger, getHostDbAccessStringList(), getLeaseDbAccessString(), isc::dhcp::HostMgr::instance(), ip_reservations_unique_, isc_throw, LOG_INFO, isc::db::DatabaseConnection::parse(), isc::dhcp::LeaseMgrFactory::recreate(), isc::db::DatabaseConnection::redactedAccessString(), isc::dhcp::HostDataSourceFactory::registeredFactory(), setIPReservationsUnique(), and isc::Exception::what().
|
protected |
Returns lease or host database access string.
access_string | without additional (appended) parameters. |
Definition at line 118 of file cfg_db_access.cc.
References appended_parameters_.
Referenced by getHostDbAccessString(), getHostDbAccessStringList(), and getLeaseDbAccessString().
|
inline |
Returns the setting indicating if lease extended info tables are enabled.
Definition at line 116 of file cfg_db_access.h.
References extended_info_tables_enabled_.
std::string isc::dhcp::CfgDbAccess::getHostDbAccessString | ( | ) | const |
Retrieves host database access string.
Definition at line 39 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 48 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 33 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 |
Modifies the setting whether the lease extended info tables are enabled.
enabled | new setting to be used by LeaseMgr . |
Definition at line 107 of file cfg_db_access.h.
References extended_info_tables_enabled_.
|
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 133 of file cfg_db_access.h.
Referenced by getAccessString(), and setAppendedParameters().
|
protected |
Holds the setting whether the lease extended info tables are enabled or disabled.
The default is disabled.
Definition at line 147 of file cfg_db_access.h.
Referenced by getExtendedInfoTablesEnabled(), and setExtendedInfoTablesEnabled().
|
protected |
Holds host database access strings.
Definition at line 139 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 143 of file cfg_db_access.h.
Referenced by createManagers(), getIPReservationsUnique(), and setIPReservationsUnique().
|
protected |
Holds lease database access string.
Definition at line 136 of file cfg_db_access.h.
Referenced by getLeaseDbAccessString(), setLeaseDbAccessString(), and isc::dhcp::CfgLeaseDbAccess::toElement().