|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ClusterInfo
The ClusterInfo interface provides access to cluster events and meta data.
Note that only client nodes are taken into account for the cluster events and meta data, information about server nodes is not available.
See ClusterListener for more information about the events themselves.
| Method Summary | ||
|---|---|---|
void |
addClusterListener(ClusterListener listener)
Adds a cluster events listener. |
|
boolean |
areOperationsEnabled()
Indicates whether operations are enabled on the current node. |
|
ClusterTopology |
getClusterTopology()
Retrieves a view of the topology of the cluster, as seen from the current node. |
|
ClusterNode |
getCurrentNode()
Retrieves the ClusterNode instance that corresponds to the current node. |
|
|
getKeysForLocalValues(Map<K,?> map)
Retrieve a set of keys for map values that are faulted on the current node out of a clustered map for which partialness is supported. |
|
|
getKeysForOrphanedValues(Map<K,?> map)
Retrieve a set of keys for map values that are not faulted anywhere out of a clustered map for which partialness is supported. |
|
Map<?,Set<ClusterNode>> |
getNodesWithObjects(Collection<?> objects)
Determine where a collection of clustered objects is faulted. |
|
String |
getUniversallyUniqueClientID()
Returns a universally unique identifier for the life-time of this client in the cluster. |
|
boolean |
isClusterInitialized()
Indicates whether the cluster infrastructure was initialized when this info instance was created. |
|
boolean |
isNodeJoined()
Indicates whether the current node has joined the cluster. |
|
void |
removeClusterListener(ClusterListener listener)
Removes a cluster events listener. |
|
ClusterNode |
waitUntilNodeJoinsCluster()
Waits until the current node has successfully joined the cluster. |
|
| Method Detail |
|---|
boolean isClusterInitialized()
Note that a cluster needs to be initialized for any of the other methods to function. If there's a chance that the code that's using this cluster info instance is using it with an uninitialized cluster infrastructure, the return value of this method should be checked before using the cluster info.
true when the cluster was initialized; or false when this was not the caseString getUniversallyUniqueClientID()
It will be the same for the entire life-time of this cluster client. However once the client is restarted, this identifier will be different. No two identifiers will ever be the same for different life-times or for different clients.
void addClusterListener(ClusterListener listener)
If the cluster events listener instance has already been registered before, this method will not register it again.
When the cluster is already joined or the operations have already been enabled, those events will be immediately triggered on the listener when it's registered.
listener - the cluster listener instance that will be registeredvoid removeClusterListener(ClusterListener listener)
If the cluster events listener instance was not registered before, this method will have no effect.
listener - the cluster listener instance that will be unregisteredClusterTopology getClusterTopology()
Note that the returned topology instance will be updated internally as nodes joined and leave the cluster. If you
want a snapshot of the current nodes in the cluster, you should use the
ClusterTopology.getNodes() method.
ClusterNode getCurrentNode()
ClusterNode instance that corresponds to the current node.
ClusterNode instance that corresponds to the current nodeboolean isNodeJoined()
true if the current node has joined the cluster; false otherwiseboolean areOperationsEnabled()
true if operations are enabled on the current node; false otherwiseClusterNode waitUntilNodeJoinsCluster()
ClusterNode instance that corresponds to the current node
Map<?,Set<ClusterNode>> getNodesWithObjects(Collection<?> objects)
throws UnclusteredObjectException
Each object will be a key in the map that is returned, with sets of nodes as values that indicate where the objects are faulted.
objects - the objects that will be checked
this never returns null, so null checks aren't needed
UnclusteredObjectException - when any of the objects isn't clustered
<K> Set<K> getKeysForOrphanedValues(Map<K,?> map)
throws UnclusteredObjectException
map - the map with the values that will be checked
an empty set if the map doesn't support partialness;
this never returns null, so null checks aren't needed
UnclusteredObjectException - when the map isn't clustered
<K> Set<K> getKeysForLocalValues(Map<K,?> map)
throws UnclusteredObjectException
map - the map with the values that will be checked
an empty set if the map doesn't support partialness;
this never returns null, so null checks aren't needed
UnclusteredObjectException - when the map isn't clustered
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||