15#include <boost/algorithm/string.hpp>
16#include <boost/lexical_cast.hpp>
27 : appended_parameters_(), lease_db_access_(
"type=memfile"),
28 host_db_access_(), ip_reservations_unique_(true),
29 extended_info_tables_enabled_(false) {
49 std::list<std::string> ret;
51 if (!dbaccess.empty()) {
72 .arg(redacted).arg(err.what());
85 for (std::string& hds : host_db_access_list) {
96 .arg(redacted).arg(err.what());
111 "non unique IP reservations (ip-reservations-unique=false) "
112 "because some host backends in use do not support this "
119 std::ostringstream s;
A generic exception that is thrown if a function is called in a prohibited way.
static std::string redactedAccessString(const ParameterMap ¶meters)
Redact database access string.
static ParameterMap parse(const std::string &dbaccess)
Parse database access string.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
Exception thrown on failure to open database but permit retries.
bool ip_reservations_unique_
Holds the setting whether IP reservations should be unique or can be non-unique.
std::string getAccessString(const std::string &access_string) const
Returns lease or host database access string.
void createManagers() const
Creates instance of lease manager and host data sources according to the configuration specified.
std::string getHostDbAccessString() const
Retrieves host database access string.
std::list< std::string > host_db_access_
Holds host database access strings.
std::string appended_parameters_
Parameters to be appended to the database access strings.
CfgDbAccess()
Constructor.
std::list< std::string > getHostDbAccessStringList() const
Retrieves host database access string.
void setIPReservationsUnique(const bool unique)
Modifies the setting imposing whether the IP reservations are unique or can be non unique.
std::string lease_db_access_
Holds lease database access string.
std::string getLeaseDbAccessString() const
Retrieves lease database access string.
static bool registeredFactory(const std::string &db_type)
Check if a host data source factory was registered.
static void create()
Creates new instance of the HostMgr.
static void addBackend(const std::string &access)
Add an alternate host backend (aka host data source).
static bool checkCacheBackend(bool logging=false)
Check for the cache host backend.
static HostMgr & instance()
Returns a sole instance of the HostMgr.
static void recreate(const std::string &dbaccess, bool preserve_callbacks=true)
Recreate an instance of a lease manager with optionally preserving registered callbacks.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
isc::log::Logger dhcpsrv_logger("dhcpsrv")
DHCP server library Logger.
const isc::log::MessageID DHCPSRV_LEASE_MGR_DB_OPEN_CONNECTION_WITH_RETRY_FAILED
const isc::log::MessageID DHCPSRV_HOST_MGR_DB_OPEN_CONNECTION_WITH_RETRY_FAILED
Defines the logger used by the top-level component of kea-lfc.