Index
All Classes and Interfaces|All Packages|Serialized Form
A
- addLeaderLatchListener(LeaderLatchListener) - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Adds the specified
LeaderLatchListener
.
B
- build() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor.ServiceDescriptorBuilder
- builder() - Static method in class org.kiwiproject.curator.leader.ServiceDescriptor
C
- check() - Method in class org.kiwiproject.curator.leader.health.ManagedLeaderLatchHealthCheck
E
- equals(Object) - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
F
- from(CuratorFramework, Environment, ServiceDescriptor, LeaderLatchListener...) - Static method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Static factory method to create a
ManagedLeaderLatchCreator
.
G
- getHealthCheck() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Returns the health check (if registered) after
start()
has been called. - getHostname() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- getId() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
- getLatchPath() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
- getLatchState() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Get the current latch state.
- getLatchState() - Method in class org.kiwiproject.curator.leader.resource.LeaderResource
-
Get information about the leader latch that this service participates in.
- getLeader() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Get the leader of this latch.
- getLeaderLatch() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Returns the
ManagedLeaderLatch
created afterstart()
has been called. - getListeners() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Returns a list containing all registered
LeaderLatchListener
s afterstart()
has been called. - getName() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- getParticipants() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Get the participants (i.e.
- getPort() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- getVersion() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- gotLeaderLatch() - Method in class org.kiwiproject.curator.leader.resource.GotLeaderLatchResource
-
Returns a 204 (No Content) response if available.
- GotLeaderLatchResource - Class in org.kiwiproject.curator.leader.resource
-
JAX-RS resource providing a single endpoint that allows clients to determine whether this service participates in a leader latch.
- GotLeaderLatchResource() - Constructor for class org.kiwiproject.curator.leader.resource.GotLeaderLatchResource
H
- hashCode() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- hasLeadership() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Returns whether this instance is the leader, or throws a
ManagedLeaderLatchException
if Curator is not started yet, this latch is not started yet, or there are no latch participants yet. - hasLeadership() - Method in class org.kiwiproject.curator.leader.resource.LeaderResource
-
Checks whether this service is the latch leader.
- hostname(String) - Method in class org.kiwiproject.curator.leader.ServiceDescriptor.ServiceDescriptorBuilder
I
- isClosed() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Check if the latch is closed.
- isLeaderLatchStarted() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Has this instance created and started a
ManagedLeaderLatch
? - isStarted() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Check if the latch is started.
L
- leaderLatchId(String, String, String, int) - Static method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Utility method to generate a standard latch id for a service.
- leaderLatchId(ServiceDescriptor) - Static method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Utility method to generate a standard latch id for a service.
- leaderLatchPath(String) - Static method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Utility method to generate a standard latch path for a service.
- LeaderResource - Class in org.kiwiproject.curator.leader.resource
-
JAX-RS resource providing endpoints for checking leadership and participant information.
- LeaderResource(ManagedLeaderLatch) - Constructor for class org.kiwiproject.curator.leader.resource.LeaderResource
M
- ManagedLeaderLatch - Class in org.kiwiproject.curator.leader
-
Wrapper around Curator's
LeaderLatch
which standardizes the id and latch path in ZooKeeper, and which registers with Dropwizard so that it manages the lifecycle (mainly to ensure the latch is stopped when the Dropwizard app stops). - ManagedLeaderLatch(CuratorFramework, String, String, LeaderLatchListener...) - Constructor for class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Construct a latch with a specific ID and standard latch path.
- ManagedLeaderLatch(CuratorFramework, ServiceDescriptor, LeaderLatchListener...) - Constructor for class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Construct a latch with a standard ID and latch path.
- ManagedLeaderLatchCreator - Class in org.kiwiproject.curator.leader
-
Entry point to initialize
ManagedLeaderLatch
, which wraps an Apache CuratorLeaderLatch
and allows for easy determination whether a JVM process is the leader in a group of JVMs connected to a ZooKeeper cluster. - ManagedLeaderLatchException - Exception in org.kiwiproject.curator.leader.exception
-
Exception that is thrown when there is some unexpected error relating to a managed Curator leader latch.
- ManagedLeaderLatchException() - Constructor for exception org.kiwiproject.curator.leader.exception.ManagedLeaderLatchException
- ManagedLeaderLatchException(String) - Constructor for exception org.kiwiproject.curator.leader.exception.ManagedLeaderLatchException
- ManagedLeaderLatchException(String, Throwable) - Constructor for exception org.kiwiproject.curator.leader.exception.ManagedLeaderLatchException
- ManagedLeaderLatchException(Throwable) - Constructor for exception org.kiwiproject.curator.leader.exception.ManagedLeaderLatchException
- ManagedLeaderLatchHealthCheck - Class in org.kiwiproject.curator.leader.health
-
Simple check to determine if the leader latch is started (healthy) or otherwise (not healthy).
- ManagedLeaderLatchHealthCheck(ManagedLeaderLatch) - Constructor for class org.kiwiproject.curator.leader.health.ManagedLeaderLatchHealthCheck
-
New health check instance for the given leader latch.
N
- name(String) - Method in class org.kiwiproject.curator.leader.ServiceDescriptor.ServiceDescriptorBuilder
O
- org.kiwiproject.curator.leader - package org.kiwiproject.curator.leader
- org.kiwiproject.curator.leader.exception - package org.kiwiproject.curator.leader.exception
- org.kiwiproject.curator.leader.health - package org.kiwiproject.curator.leader.health
- org.kiwiproject.curator.leader.resource - package org.kiwiproject.curator.leader.resource
P
- port(int) - Method in class org.kiwiproject.curator.leader.ServiceDescriptor.ServiceDescriptorBuilder
S
- ServiceDescriptor - Class in org.kiwiproject.curator.leader
-
Value class that contains metadata about a service that participates in a leader latch.
- ServiceDescriptor.ServiceDescriptorBuilder - Class in org.kiwiproject.curator.leader
- start() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Starts the latch, possibly creating non-existent znodes in ZooKeeper first.
- start() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Starts the leader latch, performing the following actions: Creates a new
ManagedLeaderLatch
, starts it, and tells the Dropwizard lifecycle to manage (stop) it Creates and registers aManagedLeaderLatchHealthCheck
unless explicitly disabled viawithoutHealthCheck()
Creates and registers the JAX-RS REST endpoints unless explicitly disabled viawithoutResources()
- start(CuratorFramework, Environment, ServiceDescriptor, LeaderLatchListener...) - Static method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
If you want a
ManagedLeaderLatch
and you want the standard options (a health check and JAX-RS REST resources) and you might need references to them, use this method to create and start a latch. - startLeaderLatch(CuratorFramework, Environment, ServiceDescriptor, LeaderLatchListener...) - Static method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
If the only thing you want is a
ManagedLeaderLatch
and you want the standard options (a health check and JAX-RS REST resources) and you do not need references to them, use this method to create and start a latch. - stop() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Stops the latch.
T
- toString() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
- toString() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor.ServiceDescriptorBuilder
- toString() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
V
- version(String) - Method in class org.kiwiproject.curator.leader.ServiceDescriptor.ServiceDescriptorBuilder
W
- whenLeader(Runnable) - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Perform the given
action
synchronously only if this latch is currently the leader. - whenLeader(Supplier<T>) - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Perform the given action defined by
resultSupplier
synchronously only if this latch is currently the leader, returning the result ofresultSupplier
. - whenLeaderAsync(Runnable) - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Perform the given
action
asynchronously only if this latch is currently the leader. - whenLeaderAsync(Supplier<T>) - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Perform the given action defined by
resultSupplier
asynchronously only if this latch is currently the leader, returning aCompletableFuture
whose result will be the result of theresultSupplier
. - whenLeaderAsync(Supplier<T>, Executor) - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Same as
ManagedLeaderLatch.whenLeaderAsync(Supplier)
but uses suppliedexecutor
instead ofCompletableFuture
's default executor. - withoutHealthCheck() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Configures without a health check.
- withoutResources() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Configures without REST resources to check for leadership and if a leader latch is present.
All Classes and Interfaces|All Packages|Serialized Form