Kea 2.7.6
isc::dhcp::CfgDbAccess Class Reference

Holds access parameters and the configuration of the lease and hosts database connection. More...

#include <cfg_db_access.h>

+ Inheritance diagram for isc::dhcp::CfgDbAccess:

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ CfgDbAccess()

isc::dhcp::CfgDbAccess::CfgDbAccess ( )

Constructor.

Definition at line 26 of file cfg_db_access.cc.

Member Function Documentation

◆ createManagers()

◆ getAccessString()

std::string isc::dhcp::CfgDbAccess::getAccessString ( const std::string & access_string) const
protected

Returns lease or host database access string.

Parameters
access_stringwithout additional (appended) parameters.

Definition at line 118 of file cfg_db_access.cc.

References appended_parameters_.

Referenced by getHostDbAccessString(), getHostDbAccessStringList(), and getLeaseDbAccessString().

◆ getExtendedInfoTablesEnabled()

bool isc::dhcp::CfgDbAccess::getExtendedInfoTablesEnabled ( ) const
inline

Returns the setting indicating if lease extended info tables are enabled.

Returns
true if lease extended info tables are enabled or false if they are disabled.

Definition at line 116 of file cfg_db_access.h.

References extended_info_tables_enabled_.

◆ getHostDbAccessString()

std::string isc::dhcp::CfgDbAccess::getHostDbAccessString ( ) const

Retrieves host database access string.

Returns
Host database access string with additional parameters specified with CfgDbAccess::setAppendedParameters.

Definition at line 39 of file cfg_db_access.cc.

References getAccessString(), and host_db_access_.

+ Here is the call graph for this function:

◆ getHostDbAccessStringList()

std::list< std::string > isc::dhcp::CfgDbAccess::getHostDbAccessStringList ( ) const

Retrieves host database access string.

Returns
Database access strings with additional parameters specified with CfgDbAccess::setAppendedParameters

Definition at line 48 of file cfg_db_access.cc.

References getAccessString(), and host_db_access_.

Referenced by createManagers().

+ Here is the call graph for this function:

◆ getIPReservationsUnique()

bool isc::dhcp::CfgDbAccess::getIPReservationsUnique ( ) const
inline

Returns the setting indicating if the IP reservations are unique or can be non unique.

Returns
true if the IP reservations must be unique or false if the reservations can be non unique.

Definition at line 99 of file cfg_db_access.h.

References ip_reservations_unique_.

◆ getLeaseDbAccessString()

std::string isc::dhcp::CfgDbAccess::getLeaseDbAccessString ( ) const

Retrieves lease database access string.

Returns
Lease database access string with additional parameters specified with CfgDbAccess::setAppendedParameters.

Definition at line 33 of file cfg_db_access.cc.

References getAccessString(), and lease_db_access_.

Referenced by createManagers().

+ Here is the call graph for this function:

◆ setAppendedParameters()

void isc::dhcp::CfgDbAccess::setAppendedParameters ( const std::string & appended_parameters)
inline

Sets parameters which will be appended to the database access strings.

Parameters
appended_parametersString 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_.

◆ setExtendedInfoTablesEnabled()

void isc::dhcp::CfgDbAccess::setExtendedInfoTablesEnabled ( const bool enabled)
inline

Modifies the setting whether the lease extended info tables are enabled.

Parameters
enablednew setting to be used by LeaseMgr.

Definition at line 107 of file cfg_db_access.h.

References extended_info_tables_enabled_.

◆ setHostDbAccessString()

void isc::dhcp::CfgDbAccess::setHostDbAccessString ( const std::string & host_db_access,
bool front = false )
inline

Sets host database access string.

Parameters
host_db_accessNew host database access string.
frontAdd at front if true, at back if false (default).

Definition at line 62 of file cfg_db_access.h.

References host_db_access_.

◆ setIPReservationsUnique()

void isc::dhcp::CfgDbAccess::setIPReservationsUnique ( const bool unique)
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.

Parameters
uniquenew setting to be used by HostMgr.

Definition at line 90 of file cfg_db_access.h.

References ip_reservations_unique_.

Referenced by createManagers().

◆ setLeaseDbAccessString()

void isc::dhcp::CfgDbAccess::setLeaseDbAccessString ( const std::string & lease_db_access)
inline

Sets lease database access string.

Parameters
lease_db_accessNew lease database access string.

Definition at line 48 of file cfg_db_access.h.

References lease_db_access_.

Member Data Documentation

◆ appended_parameters_

std::string isc::dhcp::CfgDbAccess::appended_parameters_
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().

◆ extended_info_tables_enabled_

bool isc::dhcp::CfgDbAccess::extended_info_tables_enabled_
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().

◆ host_db_access_

std::list<std::string> isc::dhcp::CfgDbAccess::host_db_access_
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().

◆ ip_reservations_unique_

bool isc::dhcp::CfgDbAccess::ip_reservations_unique_
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().

◆ lease_db_access_

std::string isc::dhcp::CfgDbAccess::lease_db_access_
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().


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