Interface CacheCluster

  • All Known Implementing Classes:
    NoopCacheCluster, TerracottaCacheCluster

    public interface CacheCluster
    Allows you to explore the Terracotta cluster nodes and register for events about the cluster.
    Since:
    2.0
    Author:
    Geert Bevin, Abhishek Sanoujam
    • Method Detail

      • getScheme

        ClusterScheme getScheme()
        Get scheme name for this cluster info.
        Returns:
        a scheme name for the cluster information. Currently TERRACOTTA is the only scheme supported.
      • getCurrentNode

        ClusterNode getCurrentNode()
        Retrieves the ClusterNode instance that corresponds to the current node.
        Returns:
        the ClusterNode instance that corresponds to the current node
      • waitUntilNodeJoinsCluster

        ClusterNode waitUntilNodeJoinsCluster()
        Waits until the current node has successfully joined the cluster.
        Returns:
        the ClusterNode instance that corresponds to the current node
      • getNodes

        java.util.Collection<ClusterNode> getNodes()
        Get all the nodes in the cluster
        Returns:
        information on all the nodes in the cluster, including ID, hostname, and IP address.
      • isClusterOnline

        boolean isClusterOnline()
        Find out if the current node is connected to the cluster or not
        Returns:
        true if cluster is online otherwise false
      • addTopologyListener

        boolean addTopologyListener​(ClusterTopologyListener listener)
        Add a listener for cluster events
        Parameters:
        listener - Listener
        Returns:
        True if already listening
      • removeTopologyListener

        boolean removeTopologyListener​(ClusterTopologyListener listener)
        Remove a listener for cluster events
        Parameters:
        listener - Listener
        Returns:
        True if not listening
      • removeAllListeners

        void removeAllListeners()
        Removes all listeners for cluster events
      • getTopologyListeners

        java.util.List<ClusterTopologyListener> getTopologyListeners()
        Get all the topology listeners
        Returns:
        a list of all the topology listeners