Class ConsumerNodesRegistry

java.lang.Object
org.apache.curator.framework.recipes.cache.PathChildrenCache
pl.allegro.tech.hermes.consumers.registry.ConsumerNodesRegistry
All Implemented Interfaces:
Closeable, 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
  • Field Summary

    Fields inherited from class org.apache.curator.framework.recipes.cache.PathChildrenCache

    defaultThreadFactorySupplier
  • Constructor Summary

    Constructors
    Constructor
    Description
    ConsumerNodesRegistry(org.apache.curator.framework.CuratorFramework curatorClient, ExecutorService executorService, ConsumerNodesRegistryPaths registryPaths, String consumerNodeId, long deathOfConsumerAfterSeconds, Clock clock)
     
  • Method Summary

    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)
     
     
    boolean
     
    boolean
    isRegistered(String consumerNodeId)
     
     
    void
     
    void
    removeLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)
     
    void
     
    void
     

    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 Details

    • ConsumerNodesRegistry

      public ConsumerNodesRegistry(org.apache.curator.framework.CuratorFramework curatorClient, ExecutorService executorService, ConsumerNodesRegistryPaths registryPaths, String consumerNodeId, long deathOfConsumerAfterSeconds, Clock clock)
  • Method Details

    • start

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

      public void stop() throws IOException
      Throws:
      IOException
    • childEvent

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

      public boolean isRegistered(String consumerNodeId)
    • isLeader

      public boolean isLeader()
    • listConsumerNodes

      public List<String> listConsumerNodes()
    • refresh

      public void refresh()
    • getConsumerId

      public 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)