Kea  1.5.0
isc::db::ReconnectCtl Class Reference

Warehouses DB reconnect control values. More...

#include <database_connection.h>

Public Member Functions

 ReconnectCtl (const std::string &backend_type, unsigned int max_retries, unsigned int retry_interval)
 Constructor. More...
 
std::string backendType () const
 Returns the type of the caller backend. More...
 
bool checkRetries ()
 Decrements the number of retries remaining. More...
 
unsigned int maxRetries ()
 Returns the maximum number for retries allowed. 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...
 

Detailed Description

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 76 of file database_connection.h.

Constructor & Destructor Documentation

◆ ReconnectCtl()

isc::db::ReconnectCtl::ReconnectCtl ( const std::string &  backend_type,
unsigned int  max_retries,
unsigned int  retry_interval 
)
inline

Constructor.

Parameters
backend_typetype of the caller backend.
max_retriesmaximum number of reconnect attempts to make
retry_intervalamount of time to between reconnect attempts

Definition at line 82 of file database_connection.h.

Member Function Documentation

◆ backendType()

std::string isc::db::ReconnectCtl::backendType ( ) const
inline

Returns the type of the caller backend.

Definition at line 88 of file database_connection.h.

◆ checkRetries()

bool isc::db::ReconnectCtl::checkRetries ( )
inline

Decrements the number of retries remaining.

Each call decrements the number of retries by one until zero is reached.

Returns
true the number of retries remaining is greater than zero.

Definition at line 96 of file database_connection.h.

◆ maxRetries()

unsigned int isc::db::ReconnectCtl::maxRetries ( )
inline

Returns the maximum number for retries allowed.

Definition at line 101 of file database_connection.h.

◆ retriesLeft()

unsigned int isc::db::ReconnectCtl::retriesLeft ( )
inline

Returns the number for retries remaining.

Definition at line 106 of file database_connection.h.

◆ retryInterval()

unsigned int isc::db::ReconnectCtl::retryInterval ( )
inline

Returns the amount of time to wait between reconnect attempts.

Definition at line 111 of file database_connection.h.


The documentation for this class was generated from the following file: