public class GridRouterClientImpl extends Object implements GridClient
GridClient router implementation.| Modifier and Type | Method and Description |
|---|---|
void |
addTopologyListener(GridClientTopologyListener lsnr)
Adds topology listener.
|
void |
close()
Closes client instance.
|
GridClientCompute |
compute()
Gets a default compute projection.
|
boolean |
connected()
Indicates whether client is connected to remote Grid.
|
GridClientData |
data()
Gets a data projection for a default grid cache with
null name. |
GridClientData |
data(String cacheName)
Gets a data projection for grid cache with name cacheName.
|
UUID |
id()
Gets a unique client identifier.
|
void |
removeTopologyListener(GridClientTopologyListener lsnr)
Removes previously added topology listener.
|
GridClientClusterState |
state()
Get client cluster state projection, for perform activate/deactivate operation on cluster.
|
void |
stop(boolean wait)
Closes client.
|
Collection<GridClientTopologyListener> |
topologyListeners()
Gets an unmodifiable snapshot of topology listeners list.
|
public void stop(boolean wait)
wait - If true will wait for all pending requests to be proceeded.public UUID id()
id in interface GridClientpublic GridClientData data() throws GridClientException
null name.data in interface GridClientnull name.GridClientException - If client was closed.public GridClientData data(String cacheName) throws GridClientException
data in interface GridClientcacheName - Grid cache name for which data projection should be obtained.GridClientException - If client was closed or no configuration with given name was provided.public GridClientCompute compute()
GridClientLoadBalancer provided in client configuration or
according to affinity if projection call involves affinity key.
More restricted projection configurations may be created with GridClientCompute methods.
compute in interface GridClientGridClientComputepublic GridClientClusterState state()
state in interface GridClientGridClientClusterStatepublic void addTopologyListener(GridClientTopologyListener lsnr)
GridClientConfiguration.getTopologyRefreshFrequency() milliseconds. If any node was added or removed,
a listener will be notified.addTopologyListener in interface GridClientlsnr - Listener to add.public void removeTopologyListener(GridClientTopologyListener lsnr)
removeTopologyListener in interface GridClientlsnr - Listener to remove.public Collection<GridClientTopologyListener> topologyListeners()
topologyListeners in interface GridClientpublic boolean connected()
GridClientDisconnectedException.
Connection status is updated in background together with topology update.
See GridClientConfiguration.getTopologyRefreshFrequency() for more
details on how background topology update works.
Note that due to asynchronous nature of topology update and connectivity detection this method gives no guarantees for subsequent calls for projections methods. It can be used only fo diagnostic and monitoring purposes.
connected in interface GridClientpublic void close()
GridClientFactory.stop(clientId).
The method is invoked automatically on objects managed by the
try-with-resources statement.
close in interface AutoCloseableclose in interface GridClient
Follow @ApacheIgnite
Ignite Fabric : ver. 2.2.0 Release Date : September 15 2017