![]() |
Kea
1.5.0
|
HA peer configuration. More...
#include <ha_config.h>
Public Types | |
| enum | Role { PRIMARY, SECONDARY, STANDBY, BACKUP } |
| Server's role in the High Availability setup. More... | |
Public Member Functions | |
| PeerConfig () | |
| Constructor. More... | |
| std::string | getLogLabel () const |
| Returns a string identifying a server used in logging. More... | |
| std::string | getName () const |
| Returns server name. More... | |
| Role | getRole () const |
| Returns server's role. More... | |
| http::Url | getUrl () const |
| Returns URL of the server's control channel. More... | |
| bool | isAutoFailover () const |
| Checks if the auto-failover function is enabled for the server. More... | |
| void | setAutoFailover (const bool auto_failover) |
| Enables/disables auto-failover function for the server. More... | |
| void | setName (const std::string &name) |
| Sets server name. More... | |
| void | setRole (const std::string &role) |
| Sets servers role. More... | |
| void | setUrl (const http::Url &url) |
| Sets server's URL. More... | |
Static Public Member Functions | |
| static std::string | roleToString (const HAConfig::PeerConfig::Role &role) |
| Returns role name. More... | |
| static Role | stringToRole (const std::string &role) |
| Decodes role provided as a string. More... | |
HA peer configuration.
It holds configuration of one of the servers participating in the high availability configuration. It may represent configuration of this server or its partner.
Definition at line 47 of file ha_config.h.
Server's role in the High Availability setup.
The following roles are supported:
| Enumerator | |
|---|---|
| PRIMARY | |
| SECONDARY | |
| STANDBY | |
| BACKUP | |
Definition at line 64 of file ha_config.h.
| isc::ha::HAConfig::PeerConfig::PeerConfig | ( | ) |
Constructor.
Definition at line 18 of file ha_config.cc.
| std::string isc::ha::HAConfig::PeerConfig::getLogLabel | ( | ) | const |
Returns a string identifying a server used in logging.
The label is constructed from server name and server URL.
Definition at line 39 of file ha_config.cc.
|
inline |
Returns server name.
Definition at line 75 of file ha_config.h.
|
inline |
Returns server's role.
Definition at line 105 of file ha_config.h.
|
inline |
Returns URL of the server's control channel.
Definition at line 86 of file ha_config.h.
|
inline |
Checks if the auto-failover function is enabled for the server.
Definition at line 137 of file ha_config.h.
|
static |
Returns role name.
| role | Role which name should be returned. |
Definition at line 66 of file ha_config.cc.
References BACKUP, PRIMARY, SECONDARY, and STANDBY.
Referenced by isc::ha::HAService::HAService().
|
inline |
Enables/disables auto-failover function for the server.
| auto_failover | Boolean value indicating if auto-failover function should be enabled/disabled for the server. |
Definition at line 145 of file ha_config.h.
| void isc::ha::HAConfig::PeerConfig::setName | ( | const std::string & | name | ) |
Sets server name.
| name | Server name. |
| BadValue | if the server name is empty. |
Definition at line 23 of file ha_config.cc.
References isc_throw, name_, and isc::util::str::trim().
Here is the call graph for this function:| void isc::ha::HAConfig::PeerConfig::setRole | ( | const std::string & | role | ) |
Sets servers role.
The following are the supported roles in the textual form:
| role | Server role in the textual form. |
Definition at line 34 of file ha_config.cc.
|
inline |
|
static |