public class DefaultFailoverManager extends Object implements FailoverManager
Constructor and Description |
---|
DefaultFailoverManager(KaaChannelManager channelManager,
ExecutorContext context) |
DefaultFailoverManager(KaaChannelManager channelManager,
ExecutorContext context,
FailoverStrategy failoverStrategy,
long failureResolutionTimeout,
TimeUnit timeUnit) |
Modifier and Type | Method and Description |
---|---|
FailoverDecision |
onFailover(FailoverStatus failoverStatus)
Needs to be invoked to determine a decision that resolves the failover.
|
void |
onServerChanged(TransportConnectionInfo connectionInfo)
Needs to be invoked as soon as current server is changed.
|
void |
onServerConnected(TransportConnectionInfo connectionInfo)
Needs to be invoked as soon as connection to the current server is established.
|
void |
onServerFailed(TransportConnectionInfo connectionInfo,
FailoverStatus status)
Needs to be invoked when a server fail occurs.
|
void |
setFailoverStrategy(FailoverStrategy failoverStrategy) |
public DefaultFailoverManager(KaaChannelManager channelManager, ExecutorContext context)
public DefaultFailoverManager(KaaChannelManager channelManager, ExecutorContext context, FailoverStrategy failoverStrategy, long failureResolutionTimeout, TimeUnit timeUnit)
public void onServerFailed(TransportConnectionInfo connectionInfo, FailoverStatus status)
FailoverManager
onServerFailed
in interface FailoverManager
connectionInfo
- the connection information of the failed server.TransportConnectionInfo
public void onServerChanged(TransportConnectionInfo connectionInfo)
FailoverManager
onServerChanged
in interface FailoverManager
connectionInfo
- the connection information of the newly connected server.TransportConnectionInfo
public void onServerConnected(TransportConnectionInfo connectionInfo)
FailoverManager
onServerConnected
in interface FailoverManager
connectionInfo
- the connection information of the current server,
to which connection was successfully established.TransportConnectionInfo
public void setFailoverStrategy(FailoverStrategy failoverStrategy)
setFailoverStrategy
in interface FailoverManager
failoverStrategy
- strategy that will be used to resolve failovers.FailoverStrategy
public FailoverDecision onFailover(FailoverStatus failoverStatus)
FailoverManager
onFailover
in interface FailoverManager
failoverStatus
- current status of the failover.FailoverDecision
,
FailoverStatus
Copyright © 2016. All rights reserved.