Class TerracottaCacheCluster

  • All Implemented Interfaces:
    CacheCluster

    public class TerracottaCacheCluster
    extends java.lang.Object
    implements CacheCluster
    CacheCluster implementation that delegates to an underlying cache cluster. The underlying CacheCluster can be changed dynamically
    Author:
    Abhishek Sanoujam
    • Constructor Detail

      • TerracottaCacheCluster

        public TerracottaCacheCluster()
    • Method Detail

      • setUnderlyingCacheCluster

        public void setUnderlyingCacheCluster​(CacheCluster newCacheCluster)
        Set the underlying cache
        Parameters:
        newCacheCluster -
      • getCurrentNode

        public ClusterNode getCurrentNode()
        Retrieves the ClusterNode instance that corresponds to the current node.
        Specified by:
        getCurrentNode in interface CacheCluster
        Returns:
        the ClusterNode instance that corresponds to the current node
      • getNodes

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

        public ClusterScheme getScheme()
        Get scheme name for this cluster info.
        Specified by:
        getScheme in interface CacheCluster
        Returns:
        a scheme name for the cluster information. Currently TERRACOTTA is the only scheme supported.
      • isClusterOnline

        public boolean isClusterOnline()
        Find out if the current node is connected to the cluster or not
        Specified by:
        isClusterOnline in interface CacheCluster
        Returns:
        true if cluster is online otherwise false
      • waitUntilNodeJoinsCluster

        public ClusterNode waitUntilNodeJoinsCluster()
        Waits until the current node has successfully joined the cluster.
        Specified by:
        waitUntilNodeJoinsCluster in interface CacheCluster
        Returns:
        the ClusterNode instance that corresponds to the current node