org.terracotta.toolkit.cluster
Interface ClusterInfo


public interface ClusterInfo

The ClusterInfo interface provides access to cluster events and metadata.

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 any operations involving transfer of network data are enabled on the current node.
 ClusterNode getCurrentNode()
          Retrieves the ClusterNode instance that corresponds to the current node.
 Set<ClusterNode> getNodes()
          Returns a collection that contains a snapshot of the nodes that are part of the cluster at the time of the method call.
 void removeClusterListener(ClusterListener listener)
          Removes a cluster events listener.
 

Method Detail

addClusterListener

void addClusterListener(ClusterListener listener)
Adds a cluster events listener.

If the cluster events listener instance has already been registered before, this method will not register it again.

If the node has already joined the cluster, and additionally if operations have already been enabled on this node, then the corresponding events will be fired immediately

Parameters:
listener - the cluster listener instance that will be registered

removeClusterListener

void removeClusterListener(ClusterListener listener)
Removes a cluster events listener.

If the cluster events listener instance was not registered before, this method will have no effect.

Parameters:
listener - the cluster listener instance that will be unregistered

getCurrentNode

ClusterNode getCurrentNode()
Retrieves the ClusterNode instance that corresponds to the current node.

Returns:
the ClusterNode instance that corresponds to the current node, will return null cluster not initialized

areOperationsEnabled

boolean areOperationsEnabled()
Indicates whether any operations involving transfer of network data are enabled on the current node.

Returns:
true if network operations are enabled on the current node; false otherwise

getNodes

Set<ClusterNode> getNodes()
Returns a collection that contains a snapshot of the nodes that are part of the cluster at the time of the method call. The returned Set is not mutable.

Returns:
the snapshot of the nodes in the cluster


Copyright © 2014 Terracotta, Inc.. All Rights Reserved.