Class ConsumerNodesRegistry

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, org.apache.curator.framework.recipes.cache.PathChildrenCacheListener

    public class ConsumerNodesRegistry
    extends org.apache.curator.framework.recipes.cache.PathChildrenCache
    implements org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
    • Nested Class Summary

      • Nested classes/interfaces inherited from class org.apache.curator.framework.recipes.cache.PathChildrenCache

        org.apache.curator.framework.recipes.cache.PathChildrenCache.StartMode
    • Constructor Summary

      Constructors 
      Constructor Description
      ConsumerNodesRegistry​(org.apache.curator.framework.CuratorFramework curatorClient, java.util.concurrent.ExecutorService executorService, ConsumerNodesRegistryPaths registryPaths, java.lang.String consumerNodeId, int deathOfConsumerAfterSeconds, java.time.Clock clock)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addLeaderLatchListener​(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)  
      void childEvent​(org.apache.curator.framework.CuratorFramework client, org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)  
      java.lang.String getConsumerId()  
      boolean isLeader()  
      boolean isRegistered​(java.lang.String consumerNodeId)  
      java.util.List<java.lang.String> listConsumerNodes()  
      void refresh()  
      void removeLeaderLatchListener​(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)  
      void start()  
      void stop()  
      • Methods inherited from class org.apache.curator.framework.recipes.cache.PathChildrenCache

        clear, clearAndRefresh, clearDataBytes, clearDataBytes, close, ensurePath, getCurrentData, getCurrentData, getListenable, handleException, rebuild, rebuildNode, remove, start, start
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ConsumerNodesRegistry

        public ConsumerNodesRegistry​(org.apache.curator.framework.CuratorFramework curatorClient,
                                     java.util.concurrent.ExecutorService executorService,
                                     ConsumerNodesRegistryPaths registryPaths,
                                     java.lang.String consumerNodeId,
                                     int deathOfConsumerAfterSeconds,
                                     java.time.Clock clock)
    • Method Detail

      • start

        public void start()
                   throws java.lang.Exception
        Overrides:
        start in class org.apache.curator.framework.recipes.cache.PathChildrenCache
        Throws:
        java.lang.Exception
      • stop

        public void stop()
                  throws java.io.IOException
        Throws:
        java.io.IOException
      • childEvent

        public void childEvent​(org.apache.curator.framework.CuratorFramework client,
                               org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)
                        throws java.lang.Exception
        Specified by:
        childEvent in interface org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
        Throws:
        java.lang.Exception
      • isRegistered

        public boolean isRegistered​(java.lang.String consumerNodeId)
      • isLeader

        public boolean isLeader()
      • listConsumerNodes

        public java.util.List<java.lang.String> listConsumerNodes()
      • refresh

        public void refresh()
      • getConsumerId

        public java.lang.String getConsumerId()
      • addLeaderLatchListener

        public void addLeaderLatchListener​(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)
      • removeLeaderLatchListener

        public void removeLeaderLatchListener​(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)