7#ifndef LEASE_MGR_FACTORY_H
8#define LEASE_MGR_FACTORY_H
14#include <boost/scoped_ptr.hpp>
73 static void create(
const std::string& dbaccess);
92 static void recreate(
const std::string& dbaccess,
93 bool preserve_callbacks =
true);
145 bool no_log =
false);
172 static std::map<std::string, std::pair<Factory, DBVersion>> map_;
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
std::map< std::string, std::string > ParameterMap
Database configuration parameter map.
static void create(const std::string &dbaccess)
Create an instance of a lease manager.
static TrackingLeaseMgr & instance()
Return current lease manager.
static bool registerFactory(const std::string &db_type, const Factory &factory, bool no_log=false, DBVersion db_version=DBVersion())
Register a lease mgr factory.
static std::list< std::string > getDBVersions()
Return extended version info for registered backends.
static void destroy()
Destroy lease manager.
static bool registeredFactory(const std::string &db_type)
Check if a lease mgr factory was registered.
static bool haveInstance()
Indicates if the lease manager has been instantiated.
std::function< TrackingLeaseMgrPtr(const db::DatabaseConnection::ParameterMap &)> Factory
Type of lease mgr factory.
std::function< std::string()> DBVersion
Type of lease mgr version.
static bool deregisterFactory(const std::string &db_type, bool no_log=false)
Deregister a lease mgr factory.
static void logRegistered()
Logs out all registered backends.
static void recreate(const std::string &dbaccess, bool preserve_callbacks=true)
Recreate an instance of a lease manager with optionally preserving registered callbacks.
No lease manager exception.
NoLeaseManager(const char *file, size_t line, const char *what)
Introduces callbacks into the LeaseMgr.
std::unique_ptr< TrackingLeaseMgr > TrackingLeaseMgrPtr
TrackingLeaseMgr pointer.
Defines the logger used by the top-level component of kea-lfc.