21#include <boost/shared_ptr.hpp>
22#include <boost/noncopyable.hpp>
71class CfgMgr :
public boost::noncopyable {
93 const std::string explicit_path =
"");
100 std::string
validatePath(
const std::string data_path)
const;
242 family_ = family == AF_INET ? AF_INET : AF_INET6;
272 void mergeIntoCfg(
const SrvConfigPtr& taget_config,
const uint32_t seq);
296 typedef std::map<uint32_t, SrvConfigPtr> SrvConfigMap;
300 SrvConfigMap external_configs_;
Defines elements for storing the names of client classes.
Exception(const char *file, size_t line, const char *what)
Constructor for a given type for exceptions with file name and file line number.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
CfgMgr()
Protected constructor.
virtual ~CfgMgr()=default
virtual destructor
const D2ClientConfigPtr & getD2ClientConfig() const
Fetches the DHCP-DDNS configuration pointer.
D2ClientMgr & getD2ClientMgr()
Fetches the DHCP-DDNS manager.
uint16_t getFamily() const
Returns address family.
void setFamily(uint16_t family)
Sets address family (AF_INET or AF_INET6)
std::string validatePath(const std::string data_path) const
Validates a file path against the supported directory for DHDP data.
void clear()
Remove current, staging, and external configurations.
SrvConfigPtr createExternalCfg()
Creates an external configuration and returns pointer to it.
void setD2ClientConfig(D2ClientConfigPtr &new_config)
Updates the DHCP-DDNS client configuration to the given value.
static CfgMgr & instance()
returns a single instance of Configuration Manager
void mergeIntoStagingCfg(const uint32_t seq)
Merges external configuration with the given sequence number into the staging configuration.
void mergeIntoCurrentCfg(const uint32_t seq)
Merges external configuration with the given sequence number into the current configuration.
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.
bool ddnsEnabled()
Convenience method for checking if DHCP-DDNS updates are enabled.
std::string getDataDir(bool reset=false, const std::string explicit_path="")
Fetches the supported DHCP data directory.
void commit()
Commits the staging configuration.
void clearStagingConfiguration()
Remove staging configuration.
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
D2ClientMgr isolates Kea from the details of being a D2 client.
DuplicateListeningIface(const char *file, size_t line, const char *what)
Defines the D2ClientMgr class.
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< D2ClientMgr > D2ClientMgrPtr
Defines a pointer for D2ClientMgr instances.
boost::shared_ptr< PathChecker > PathCheckerPtr
Defines a pointer to a PathChecker.
Defines the logger used by the top-level component of kea-lfc.