public class ConsumerNodesRegistry
extends org.apache.curator.framework.recipes.cache.PathChildrenCache
implements org.apache.curator.framework.recipes.cache.PathChildrenCacheListener
| Constructor and 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) |
| Modifier and Type | Method and 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() |
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)
public void start()
throws java.lang.Exception
start in class org.apache.curator.framework.recipes.cache.PathChildrenCachejava.lang.Exceptionpublic void stop()
throws java.io.IOException
java.io.IOExceptionpublic 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 boolean isLeader()
public java.util.List<java.lang.String> listConsumerNodes()
public void refresh()
public java.lang.String getConsumerId()
public void addLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)
public void removeLeaderLatchListener(org.apache.curator.framework.recipes.leader.LeaderLatchListener listener)