public class FailoverTransport extends Object implements CompositeTransport
| Constructor and Description |
|---|
FailoverTransport() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(boolean rebalance,
String u) |
void |
add(boolean rebalance,
URI[] u) |
FutureResponse |
asyncRequest(Object command,
ResponseCallback responseCallback)
An asynchronous request response where the Receipt will be returned in
the future.
|
void |
connectionInterruptProcessingComplete(ConnectionId connectionId) |
void |
disposeTransport(Transport transport) |
int |
getBackupPoolSize() |
Transport |
getConnectedTransport() |
URI |
getConnectedTransportURI() |
int |
getConnectFailures() |
int |
getCurrentBackups() |
long |
getInitialReconnectDelay() |
int |
getMaxCacheSize() |
int |
getMaxReconnectAttempts() |
long |
getMaxReconnectDelay() |
X509Certificate[] |
getPeerCertificates() |
int |
getReceiveCounter()
Returns a counter which gets incremented as data is read from the transport.
|
long |
getReconnectDelay() |
double |
getReconnectDelayExponent() |
String |
getRemoteAddress() |
int |
getStartupMaxReconnectAttempts() |
ConnectionStateTracker |
getStateTracker() |
long |
getTimeout() |
TransportListener |
getTransportListener()
Returns the current transport listener
|
String |
getUpdateURIsURL() |
int |
getWarnAfterReconnectAttempts() |
WireFormat |
getWireFormat()
Retrieves the WireFormat instance associated with this Transport instance.
|
void |
handleConnectionControl(ConnectionControl control) |
void |
handleTransportFailure(IOException e) |
void |
handleTransportFailure(Transport failed,
IOException e) |
boolean |
isBackup() |
boolean |
isConnected() |
boolean |
isConnectedToPriority() |
boolean |
isDisposed() |
boolean |
isFaultTolerant()
Indicates if the transport can handle faults
|
protected boolean |
isPriority(URI uri) |
boolean |
isPriorityBackup() |
boolean |
isRandomize() |
boolean |
isRebalanceUpdateURIs() |
boolean |
isReconnectSupported() |
boolean |
isTrackMessages() |
boolean |
isTrackTransactionProducers() |
boolean |
isUpdateURIsSupported() |
boolean |
isUseExponentialBackOff() |
<T> T |
narrow(Class<T> target) |
void |
oneway(Object o)
A one way asynchronous send
|
void |
reconnect(boolean rebalance) |
void |
reconnect(URI uri)
reconnect to another location
|
void |
remove(boolean rebalance,
URI[] u) |
Object |
request(Object command)
A synchronous request response
|
Object |
request(Object command,
int timeout)
A synchronous request response
|
protected void |
restoreTransport(Transport t) |
void |
setBackup(boolean backup) |
void |
setBackupPoolSize(int backupPoolSize) |
void |
setInitialReconnectDelay(long initialReconnectDelay) |
void |
setMaxCacheSize(int maxCacheSize) |
void |
setMaxReconnectAttempts(int maxReconnectAttempts) |
void |
setMaxReconnectDelay(long maxReconnectDelay) |
void |
setNestedExtraQueryOptions(String nestedExtraQueryOptions) |
void |
setPeerCertificates(X509Certificate[] certificates)
Sets the certificates provided by the connected peer.
|
void |
setPriorityBackup(boolean priorityBackup) |
void |
setPriorityURIs(String priorityURIs) |
void |
setRandomize(boolean randomize) |
void |
setRebalanceUpdateURIs(boolean rebalanceUpdateURIs) |
void |
setReconnectDelay(long reconnectDelay) |
void |
setReconnectDelayExponent(double reconnectDelayExponent) |
void |
setReconnectSupported(boolean value) |
void |
setStartupMaxReconnectAttempts(int startupMaxReconnectAttempts) |
void |
setTimeout(long timeout) |
void |
setTrackMessages(boolean trackMessages) |
void |
setTrackTransactionProducers(boolean trackTransactionProducers) |
void |
setTransportListener(TransportListener commandListener)
Registers an inbound command listener
|
void |
setUpdateURIsSupported(boolean value) |
void |
setUpdateURIsURL(String updateURIsURL) |
void |
setUseExponentialBackOff(boolean useExponentialBackOff) |
void |
setWarnAfterReconnectAttempts(int warnAfterReconnectAttempts)
Sets the number of Connect / Reconnect attempts that must occur before a warn message
is logged indicating that the transport is not connected.
|
void |
start() |
void |
stop() |
String |
toString() |
void |
updateURIs(boolean rebalance,
URI[] updatedURIs)
Provide a list of available alternative locations
|
public FailoverTransport()
public final void disposeTransport(Transport transport)
public final void handleTransportFailure(IOException e) throws InterruptedException
InterruptedExceptionpublic final void handleTransportFailure(Transport failed, IOException e) throws InterruptedException
InterruptedExceptionpublic final void handleConnectionControl(ConnectionControl control)
public long getInitialReconnectDelay()
public void setInitialReconnectDelay(long initialReconnectDelay)
public long getMaxReconnectDelay()
public void setMaxReconnectDelay(long maxReconnectDelay)
public long getReconnectDelay()
public void setReconnectDelay(long reconnectDelay)
public double getReconnectDelayExponent()
public void setReconnectDelayExponent(double reconnectDelayExponent)
public Transport getConnectedTransport()
public URI getConnectedTransportURI()
public int getMaxReconnectAttempts()
public void setMaxReconnectAttempts(int maxReconnectAttempts)
public int getStartupMaxReconnectAttempts()
public void setStartupMaxReconnectAttempts(int startupMaxReconnectAttempts)
public long getTimeout()
public void setTimeout(long timeout)
public boolean isRandomize()
public void setRandomize(boolean randomize)
randomize - The randomize to set.public boolean isBackup()
public void setBackup(boolean backup)
public int getBackupPoolSize()
public void setBackupPoolSize(int backupPoolSize)
public int getCurrentBackups()
public boolean isTrackMessages()
public void setTrackMessages(boolean trackMessages)
public boolean isTrackTransactionProducers()
public void setTrackTransactionProducers(boolean trackTransactionProducers)
public int getMaxCacheSize()
public void setMaxCacheSize(int maxCacheSize)
public boolean isPriorityBackup()
public void setPriorityBackup(boolean priorityBackup)
public void setPriorityURIs(String priorityURIs)
public void oneway(Object o) throws IOException
Transportoneway in interface TransportIOExceptionpublic FutureResponse asyncRequest(Object command, ResponseCallback responseCallback) throws IOException
TransportasyncRequest in interface TransportresponseCallback - TODOIOExceptionpublic Object request(Object command) throws IOException
Transportrequest in interface TransportIOExceptionpublic Object request(Object command, int timeout) throws IOException
Transportrequest in interface TransportIOExceptionpublic void add(boolean rebalance, URI[] u)
add in interface CompositeTransportpublic void remove(boolean rebalance, URI[] u)
remove in interface CompositeTransportpublic void reconnect(boolean rebalance)
public TransportListener getTransportListener()
TransportgetTransportListener in interface Transportpublic void setTransportListener(TransportListener commandListener)
TransportsetTransportListener in interface Transportprotected void restoreTransport(Transport t) throws Exception, IOException
ExceptionIOExceptionpublic boolean isUseExponentialBackOff()
public void setUseExponentialBackOff(boolean useExponentialBackOff)
public String getRemoteAddress()
getRemoteAddress in interface Transportpublic boolean isFaultTolerant()
TransportisFaultTolerant in interface Transportprotected boolean isPriority(URI uri)
public boolean isDisposed()
isDisposed in interface Transportpublic boolean isConnected()
isConnected in interface Transportpublic void reconnect(URI uri) throws IOException
Transportreconnect in interface TransportIOException - on failure of if not supportedpublic boolean isReconnectSupported()
isReconnectSupported in interface Transportpublic void setReconnectSupported(boolean value)
public boolean isUpdateURIsSupported()
isUpdateURIsSupported in interface Transportpublic void setUpdateURIsSupported(boolean value)
public void updateURIs(boolean rebalance, URI[] updatedURIs) throws IOException
TransportupdateURIs in interface TransportIOExceptionpublic String getUpdateURIsURL()
public void setUpdateURIsURL(String updateURIsURL)
updateURIsURL - the updateURIsURL to setpublic boolean isRebalanceUpdateURIs()
public void setRebalanceUpdateURIs(boolean rebalanceUpdateURIs)
rebalanceUpdateURIs - the rebalanceUpdateURIs to setpublic int getReceiveCounter()
TransportgetReceiveCounter in interface Transportpublic int getConnectFailures()
public void connectionInterruptProcessingComplete(ConnectionId connectionId)
public ConnectionStateTracker getStateTracker()
public boolean isConnectedToPriority()
public void setNestedExtraQueryOptions(String nestedExtraQueryOptions)
public int getWarnAfterReconnectAttempts()
public void setWarnAfterReconnectAttempts(int warnAfterReconnectAttempts)
warnAfterReconnectAttempts - The number of failed connection attempts that must happen before a warning is logged.public X509Certificate[] getPeerCertificates()
getPeerCertificates in interface Transportpublic void setPeerCertificates(X509Certificate[] certificates)
TransportsetPeerCertificates in interface Transportcertificates - the Certificates provided by the peer.public WireFormat getWireFormat()
TransportgetWireFormat in interface TransportCopyright © 2005–2020 The Apache Software Foundation. All rights reserved.