public class FailoverSingleServer extends Object implements FailoverMethod
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SERVER_RETRIES
The default number of times to rety a conection to this server
|
FAILOVER_EXCHANGE, NO_FAILOVER, RANDOM, ROUND_ROBIN, SINGLE_BROKER
Constructor and Description |
---|
FailoverSingleServer(BrokerDetails brokerDetail) |
FailoverSingleServer(ConnectionURL connectionDetails) |
Modifier and Type | Method and Description |
---|---|
void |
attainedConnection()
Notification to the Failover method that a connection has been attained.
|
boolean |
failoverAllowed()
Check if failover is possible for this method
|
BrokerDetails |
getCurrentBrokerDetails()
If there is no current BrokerDetails the null will be returned.
|
BrokerDetails |
getNextBrokerDetails()
Move to the next BrokerDetails if one is available.
|
int |
getRetries() |
String |
methodName() |
void |
reset()
Reset the Failover to initial conditions
|
void |
setBroker(BrokerDetails broker)
Set the currently active broker to be the new value.
|
protected void |
setCurrentRetries(int currentRetries) |
void |
setRetries(int retries)
Set the retries for this method
|
String |
toString() |
public static final int DEFAULT_SERVER_RETRIES
public FailoverSingleServer(ConnectionURL connectionDetails)
public FailoverSingleServer(BrokerDetails brokerDetail)
public void reset()
FailoverMethod
reset
in interface FailoverMethod
protected void setCurrentRetries(int currentRetries)
public boolean failoverAllowed()
FailoverMethod
failoverAllowed
in interface FailoverMethod
public void attainedConnection()
FailoverMethod
attainedConnection
in interface FailoverMethod
public BrokerDetails getCurrentBrokerDetails()
FailoverMethod
getCurrentBrokerDetails
in interface FailoverMethod
public BrokerDetails getNextBrokerDetails()
FailoverMethod
getNextBrokerDetails
in interface FailoverMethod
public void setBroker(BrokerDetails broker)
FailoverMethod
setBroker
in interface FailoverMethod
broker
- The new BrokerDetail valuepublic void setRetries(int retries)
FailoverMethod
setRetries
in interface FailoverMethod
retries
- the maximum number of time to retry this Methodpublic int getRetries()
public String methodName()
methodName
in interface FailoverMethod
Copyright © 2006–2016 The Apache Software Foundation. All rights reserved.