public class WanConnectionManager extends Object implements com.hazelcast.nio.ConnectionListener
WanReplicationPublisher.| Constructor and Description |
|---|
WanConnectionManager(com.hazelcast.instance.Node node,
com.hazelcast.spi.discovery.integration.DiscoveryService discoveryService) |
| Modifier and Type | Method and Description |
|---|---|
List<com.hazelcast.nio.Address> |
awaitAndGetTargetEndpoints()
Returns a list of currently live endpoints.
|
void |
connectionAdded(com.hazelcast.nio.Connection connection) |
void |
connectionRemoved(com.hazelcast.nio.Connection connection) |
WanConnectionWrapper |
getConnection(com.hazelcast.nio.Address target)
Returns either the connection wrapper for the requested
target
or for the first target in the endpoint list if the provided
target is not in the endpoint list. |
List<com.hazelcast.nio.Address> |
getTargetEndpoints()
Return a snapshot of the list of currently known target endpoints to
which replication is made.
|
void |
init(WanConfigurationContext configurationContext)
Initialise the connection manager.
|
boolean |
isConnected()
Tests if connected to a configured target cluster endpoint
over WAN.
|
void |
removeTargetEndpoint(com.hazelcast.nio.Address targetAddress,
String reason,
Throwable cause) |
void |
shutdown()
Shuts down this connection manager.
|
public WanConnectionManager(com.hazelcast.instance.Node node,
com.hazelcast.spi.discovery.integration.DiscoveryService discoveryService)
public void init(WanConfigurationContext configurationContext)
DiscoveryService and schedule a task to rerun discovery.configurationContext - the configuration context for the WAN publisherpublic List<com.hazelcast.nio.Address> awaitAndGetTargetEndpoints()
running is false (this
connection manager is shutting down) at which point it can return an empty
list.public void shutdown()
public WanConnectionWrapper getConnection(com.hazelcast.nio.Address target)
target
or for the first target in the endpoint list if the provided
target is not in the endpoint list. The method may return
null if this method fails to create a connection, either because
it cannot connect in the expected time or it has failed to authorize.
The method will check if the connection is alive before returning the
wrapper.target - the address for which a connection is requestednullpublic boolean isConnected()
true if there is at least one alive connection, false otherwisepublic void removeTargetEndpoint(com.hazelcast.nio.Address targetAddress,
String reason,
Throwable cause)
public List<com.hazelcast.nio.Address> getTargetEndpoints()
removeTargetEndpoint(Address, String, Throwable)public void connectionAdded(com.hazelcast.nio.Connection connection)
connectionAdded in interface com.hazelcast.nio.ConnectionListenerpublic void connectionRemoved(com.hazelcast.nio.Connection connection)
connectionRemoved in interface com.hazelcast.nio.ConnectionListenerCopyright © 2020 Hazelcast, Inc.. All Rights Reserved.