public class ConsumerNodesRegistry
extends pl.allegro.tech.hermes.common.cache.zookeeper.StartableCache
implements org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
| Constructor and Description |
|---|
ConsumerNodesRegistry(org.apache.curator.framework.CuratorFramework curatorClient,
java.util.concurrent.ExecutorService executorService,
java.lang.String prefix,
java.lang.String consumerNodeId) |
| Modifier and Type | Method and Description |
|---|---|
void |
childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event) |
java.lang.String |
getId() |
boolean |
isLeader() |
boolean |
isRegistered(java.lang.String consumerNodeId) |
java.util.List<java.lang.String> |
list() |
void |
registerLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener... leaderListener) |
void |
start() |
public ConsumerNodesRegistry(org.apache.curator.framework.CuratorFramework curatorClient,
java.util.concurrent.ExecutorService executorService,
java.lang.String prefix,
java.lang.String consumerNodeId)
public void start()
throws java.lang.Exception
start in class org.apache.curator.framework.recipes.cache.PathChildrenCachejava.lang.Exceptionpublic void childEvent(org.apache.curator.framework.CuratorFramework client,
org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent event)
throws java.lang.Exception
childEvent in interface org.apache.curator.framework.recipes.cache.PathChildrenCacheListenerjava.lang.Exceptionpublic boolean isRegistered(java.lang.String consumerNodeId)
public void registerLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener... leaderListener)
public boolean isLeader()
public java.util.List<java.lang.String> list()
public java.lang.String getId()