13 #include <boost/shared_ptr.hpp> 83 void setName(
const std::string& name);
118 void setRole(
const std::string& role);
138 return (auto_failover_);
146 auto_failover_ = auto_failover;
239 std::map<int, StateConfigPtr> states_;
284 void setHAMode(
const std::string& ha_mode);
PeerConfigPtr getPeerConfig(const std::string &name) const
Returns configuration of the specified server.
void setSyncLeases(const bool sync_leases)
Sets boolean flag indicating whether the active servers should synchronize their lease databases upon...
StateMachineConfig()
Constructor.
uint32_t max_unacked_clients_
Maximum number of unacked clients.
Configuration specific to a single HA state.
StatePausing
State machine pausing modes.
void setAutoFailover(const bool auto_failover)
Enables/disables auto-failover function for the server.
void setMaxUnackedClients(const uint32_t max_unacked_clients)
Set maximum number of clients which may fail to communicate with the DHCP server before entering part...
PeerConfigMap peers_
Map of peers' configurations.
HAMode getHAMode() const
Returns mode of operation.
void setThisServerName(const std::string &this_server_name)
Sets name of this server.
util::StatePausing getPausing() const
Returns pausing mode for the given state.
void setName(const std::string &name)
Sets server name.
State machine configuration information.
void setHAMode(const std::string &ha_mode)
Sets new mode of operation.
void setPausing(const std::string &pausing)
Sets pausing mode for the gievn state.
std::map< std::string, PeerConfigPtr > PeerConfigMap
Map of the servers' configurations.
static Role stringToRole(const std::string &role)
Decodes role provided as a string.
std::string this_server_name_
This server name.
void setMaxResponseDelay(const uint32_t max_response_delay)
Sets new max response delay.
uint32_t getSyncTimeout() const
Returns timeout for lease database synchronization.
StateConfigPtr getStateConfig(const int state)
Returns pointer to the state specific configuration.
StateConfig(const int state)
Constructor.
PeerConfigPtr getFailoverPeerConfig() const
Returns configuration of the partner which takes part in failover.
uint32_t max_response_delay_
Max delay in response to heartbeats.
Role getRole() const
Returns server's role.
uint32_t getMaxResponseDelay() const
Returns max response delay.
PeerConfigMap getAllServersConfig() const
Returns configurations of all servers.
bool sync_leases_
Synchronize databases on startup?
bool amSendingLeaseUpdates() const
Returns boolean flag indicating whether lease updates should be sent to the partner.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
StateMachineConfigPtr state_machine_
State machine configuration.
void setSyncTimeout(const uint32_t sync_timeout)
Sets new lease database syncing timeout in milliseconds.
uint32_t getMaxAckDelay() const
Returns maximum time for a client trying to communicate with DHCP server to complete the transaction.
uint32_t sync_page_limit_
Page size limit while synchronizing leases.
uint32_t heartbeat_delay_
Heartbeat delay in milliseconds.
uint32_t max_ack_delay_
Maximum DHCP message ack delay.
uint32_t getHeartbeatDelay() const
Returns heartbeat delay in milliseconds.
std::string getLogLabel() const
Returns a string identifying a server used in logging.
Exception thrown when configuration validation fails.
std::string getThisServerName() const
Returns name of this server.
uint32_t sync_timeout_
Timeout for syncing lease database (ms)
void setHeartbeatDelay(const uint32_t heartbeat_delay)
Sets new heartbeat delay in milliseconds.
void setSendLeaseUpdates(const bool send_lease_updates)
Sets boolean flag indicating whether lease updates should be sent to the partner.
boost::shared_ptr< StateConfig > StateConfigPtr
Pointer to the state configuration.
void setMaxAckDelay(const uint32_t max_ack_delay)
Sets maximum time for a client trying to communicate with DHCP server to completed the transaction.
bool send_lease_updates_
Send lease updates to partner?
This is a base class for exceptions thrown from the DNS library module.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void validate() const
Validates configuration.
PeerConfigMap getOtherServersConfig() const
Returns configuration of other servers.
static std::string HAModeToString(const HAMode &ha_mode)
Returns HA mode name.
uint32_t getSyncPageLimit() const
Returns maximum number of leases per page to be fetched during database synchronization.
bool isAutoFailover() const
Checks if the auto-failover function is enabled for the server.
void setRole(const std::string &role)
Sets servers role.
HAConfigValidationError(const char *file, size_t line, const char *what)
Role
Server's role in the High Availability setup.
static std::string pausingToString(const util::StatePausing &pausing)
Returns pausing mode in the textual form.
boost::shared_ptr< StateMachineConfig > StateMachineConfigPtr
Pointer to a state machine configuration.
uint32_t getMaxUnackedClients() const
Returns maximum number of clients which may fail to communicate with the DHCP server before entering ...
static std::string roleToString(const HAConfig::PeerConfig::Role &role)
Returns role name.
PeerConfigPtr getThisServerConfig() const
Returns configuration of this server.
PeerConfigPtr selectNextPeerConfig(const std::string &name)
Creates and returns pointer to the new peer's configuration.
std::string getName() const
Returns server name.
This file defines the class StateModel.
static util::StatePausing stringToPausing(const std::string &pausing)
Converts pausing mode from the textual form.
int getState() const
Returns identifier of the state.
bool amSyncingLeases() const
Returns boolean flag indicating whether the active servers should synchronize their lease databases u...
void setSyncPageLimit(const uint32_t sync_page_limit)
Sets new page limit size for leases fetched from the partner during database synchronization.
http::Url getUrl() const
Returns URL of the server's control channel.
void setUrl(const http::Url &url)
Sets server's URL.
StateMachineConfigPtr getStateMachineConfig() const
Returns state machine configuration.
static HAMode stringToHAMode(const std::string &ha_mode)
Decodes HA mode provided as string.
boost::shared_ptr< HAConfig > HAConfigPtr
Pointer to the High Availability configuration structure.
HAMode ha_mode_
Mode of operation.
Storage for High Availability configuration.
boost::shared_ptr< PeerConfig > PeerConfigPtr
Pointer to the server's configuration.