client-cpp
0.10.0
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
FailoverCommon.hpp
Go to the documentation of this file.
1
/*
2
* Copyright 2014-2016 CyberVision, Inc.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
17
18
#ifndef FAILOVERCOMMON_HPP_
19
#define FAILOVERCOMMON_HPP_
20
21
#include <cstddef>
22
23
namespace
kaa {
24
25
enum class
KaaFailoverReason
{
29
ALL_BOOTSTRAP_SERVERS_NA
,
30
34
NO_OPERATIONS_SERVERS_RECEIVED
,
35
39
ALL_OPERATIONS_SERVERS_NA
,
40
44
CURRENT_BOOTSTRAP_SERVER_NA
,
45
49
CURRENT_OPERATIONS_SERVER_NA
,
50
54
NO_CONNECTIVITY
,
55
60
ENDPOINT_NOT_REGISTERED
,
61
65
CREDENTIALS_REVOKED
66
};
67
68
enum class
FailoverStrategyAction
{
72
NOOP
,
73
77
RETRY_CURRENT_SERVER
,
78
85
USE_NEXT_BOOTSTRAP_SERVER
,
86
90
USE_NEXT_OPERATIONS_SERVER
,
91
95
STOP_CLIENT
96
};
97
98
class
FailoverStrategyDecision
{
99
public
:
100
FailoverStrategyDecision
(
FailoverStrategyAction
action, std::size_t retryPeriod = 0)
101
: action_(action), retryPeriod_(retryPeriod) {}
102
103
FailoverStrategyAction
getAction
()
const
{
104
return
action_;
105
}
106
107
std::size_t
getRetryPeriod
()
const
{
108
return
retryPeriod_;
109
}
110
111
private
:
112
FailoverStrategyAction
action_;
113
std::size_t retryPeriod_ = 0;
114
};
115
116
}
117
118
#endif
/* FAILOVERCOMMON_HPP_ */
kaa::KaaFailoverReason
KaaFailoverReason
Definition:
FailoverCommon.hpp:25
kaa::KaaFailoverReason::ALL_OPERATIONS_SERVERS_NA
kaa::FailoverStrategyDecision
Definition:
FailoverCommon.hpp:98
kaa::FailoverStrategyDecision::FailoverStrategyDecision
FailoverStrategyDecision(FailoverStrategyAction action, std::size_t retryPeriod=0)
Definition:
FailoverCommon.hpp:100
kaa::FailoverStrategyAction::USE_NEXT_OPERATIONS_SERVER
kaa::KaaFailoverReason::ALL_BOOTSTRAP_SERVERS_NA
kaa::KaaFailoverReason::NO_OPERATIONS_SERVERS_RECEIVED
kaa::FailoverStrategyDecision::getAction
FailoverStrategyAction getAction() const
Definition:
FailoverCommon.hpp:103
kaa::FailoverStrategyAction::NOOP
kaa::FailoverStrategyAction::STOP_CLIENT
kaa::FailoverStrategyAction::USE_NEXT_BOOTSTRAP_SERVER
kaa::KaaFailoverReason::CURRENT_BOOTSTRAP_SERVER_NA
kaa::FailoverStrategyDecision::getRetryPeriod
std::size_t getRetryPeriod() const
Definition:
FailoverCommon.hpp:107
kaa::KaaFailoverReason::ENDPOINT_NOT_REGISTERED
kaa::KaaFailoverReason::NO_CONNECTIVITY
kaa::KaaFailoverReason::CURRENT_OPERATIONS_SERVER_NA
kaa::FailoverStrategyAction::RETRY_CURRENT_SERVER
kaa::FailoverStrategyAction
FailoverStrategyAction
Definition:
FailoverCommon.hpp:68
kaa::KaaFailoverReason::CREDENTIALS_REVOKED
architec
Documents
kaa
client
client-multi
client-cpp
kaa
failover
FailoverCommon.hpp
Generated on Mon Oct 31 2016 16:51:43 for client-cpp by
1.8.6