Kea  1.9.9-git
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. 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...
 

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

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

Constructor.

Definition at line 24 of file cfg_db_access.cc.

Member Function Documentation

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

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

Definition at line 36 of file cfg_db_access.cc.

References getAccessString(), and host_db_access_.

+ Here is the call graph for this function:

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 45 of file cfg_db_access.cc.

References getAccessString(), and host_db_access_.

Referenced by createManagers().

+ Here is the call graph for this function:

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

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 30 of file cfg_db_access.cc.

References getAccessString(), and lease_db_access_.

Referenced by createManagers().

+ Here is the call graph for this function:

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

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

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().

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

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

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

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 126 of file cfg_db_access.h.

Referenced by createManagers(), getIPReservationsUnique(), and setIPReservationsUnique().

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


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