Kea
1.9.9-git
|
Warehouses DB reconnect control values. More...
#include <database_connection.h>
Public Member Functions | |
ReconnectCtl (const std::string &backend_type, const std::string &timer_name, unsigned int max_retries, unsigned int retry_interval, OnFailAction action) | |
Constructor. More... | |
bool | alterServiceState () |
Return true if the connection loss should affect the service, false otherwise. More... | |
std::string | backendType () const |
Returns the type of the caller backend. More... | |
bool | checkRetries () |
Decrements the number of retries remaining. More... | |
bool | exitOnFailure () |
Return true if the connection recovery mechanism should shut down the server on failure, false otherwise. More... | |
unsigned int | maxRetries () |
Returns the maximum number of retries allowed. More... | |
void | resetRetries () |
Resets the retries count. More... | |
unsigned int | retriesLeft () |
Returns the number for retries remaining. More... | |
unsigned int | retryInterval () |
Returns the amount of time to wait between reconnect attempts. More... | |
std::string | timerName () const |
Returns the associated timer name. More... | |
Static Public Member Functions | |
static OnFailAction | onFailActionFromText (const std::string &text) |
Convert string to action. More... | |
static std::string | onFailActionToText (OnFailAction action) |
Convert action to string. More... | |
Warehouses DB reconnect control values.
When a DatabaseConnection loses connectivity to its backend, it creates an instance of this class based on its configuration parameters and passes the instance into connection's DB lost callback. This allows the layer(s) above the connection to know how to proceed.
Definition at line 93 of file database_connection.h.
|
inline |
Constructor.
backend_type | type of the caller backend. |
timer_name | timer associated to this object. |
max_retries | maximum number of reconnect attempts to make. |
retry_interval | amount of time to between reconnect attempts. |
action | which should be taken on connection loss. |
Definition at line 102 of file database_connection.h.
|
inline |
Return true if the connection loss should affect the service, false otherwise.
Definition at line 151 of file database_connection.h.
References isc::db::STOP_RETRY_EXIT.
|
inline |
Returns the type of the caller backend.
Definition at line 110 of file database_connection.h.
|
inline |
Decrements the number of retries remaining.
Each call decrements the number of retries by one until zero is reached.
Definition at line 125 of file database_connection.h.
|
inline |
Return true if the connection recovery mechanism should shut down the server on failure, false otherwise.
Definition at line 157 of file database_connection.h.
References isc::db::SERVE_RETRY_EXIT, and isc::db::STOP_RETRY_EXIT.
|
inline |
Returns the maximum number of retries allowed.
Definition at line 130 of file database_connection.h.
|
static |
Convert string to action.
text | The text to be converted to action type. |
Definition at line 293 of file database_connection.cc.
References isc_throw.
|
static |
Convert action to string.
action | The action type to be converted to text. |
Definition at line 280 of file database_connection.cc.
|
inline |
Resets the retries count.
Definition at line 145 of file database_connection.h.
|
inline |
Returns the number for retries remaining.
Definition at line 135 of file database_connection.h.
|
inline |
Returns the amount of time to wait between reconnect attempts.
Definition at line 140 of file database_connection.h.
|
inline |
Returns the associated timer name.
Definition at line 117 of file database_connection.h.