11#include <boost/shared_ptr.hpp>
40 ReconnectCtl(
const std::string& backend_type,
const std::string& timer_name,
41 unsigned int max_retries,
unsigned int retry_interval,
43 backend_type_(backend_type), timer_name_(timer_name),
44 max_retries_(max_retries), retries_left_(max_retries),
45 retry_interval_(retry_interval), action_(action), id_(
id) {
50 return (backend_type_);
54 unsigned int id()
const {
70 return (retries_left_ ? --retries_left_ :
false);
75 return (max_retries_);
80 return (retries_left_);
85 return (max_retries_ - retries_left_);
90 return (retry_interval_);
95 retries_left_ = max_retries_;
126 const std::string backend_type_;
129 std::string timer_name_;
132 unsigned int max_retries_;
135 unsigned int retries_left_;
138 unsigned int retry_interval_;
Warehouses reconnect control values.
unsigned int maxRetries() const
Returns the maximum number of retries allowed.
ReconnectCtl(const std::string &backend_type, const std::string &timer_name, unsigned int max_retries, unsigned int retry_interval, OnFailAction action, unsigned int id)
Constructor.
unsigned int retryInterval() const
Returns the amount of time to wait between reconnect attempts.
unsigned int retriesLeft() const
Returns the number for retries remaining.
void resetRetries()
Resets the retries count.
bool alterServiceState() const
Return true if the connection loss should affect the service, false otherwise.
std::string timerName() const
Returns the associated timer name.
static std::string onFailActionToText(OnFailAction action)
Convert action to string.
std::string backendType() const
Returns the type of the caller backend.
unsigned int retryIndex() const
Returns an index of current retry.
bool checkRetries()
Decrements the number of retries remaining.
unsigned int id() const
Returns the ID of the manager.
bool exitOnFailure() const
Return true if the connection recovery mechanism should shut down the server on failure,...
static OnFailAction onFailActionFromText(const std::string &text)
Convert string to action.
OnFailAction
Type of action to take on connection loss.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.