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