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
- checkLeadershipStatus() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Checks whether this instance is the leader, returning a
LeadershipStatusobject that callers can use to act upon. - CuratorNotStarted(CuratorFrameworkState) - Constructor for record class org.kiwiproject.curator.leader.LeadershipStatus.CuratorNotStarted
-
Creates an instance of a
CuratorNotStartedrecord class. - curatorState() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.CuratorNotStarted
-
Returns the value of the
curatorStaterecord component.
D
- doesNotHaveLeadership() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
This method is the negation of
ManagedLeaderLatch.hasLeadership().
E
- equals(Object) - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.CuratorNotStarted
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.IsLeader
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.LatchNotStarted
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.NoLatchParticipants
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.NotLeader
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.OtherError
-
Indicates whether some other object is "equal to" this one.
- equals(Object) - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- error() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.OtherError
-
Returns the value of the
errorrecord component.
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
ManagedLeaderLatchcreated afterstart()has been called. - getListeners() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatchCreator
-
Returns a list containing all registered
LeaderLatchListeners afterstart()has been called. - getManagedLatch() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
An "escape hatch" to get the
LeaderLatchmanaged by this object. - getName() - Method in class org.kiwiproject.curator.leader.ServiceDescriptor
- getParticipants() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Get the participants (i.e., Dropwizard services) in this latch.
- 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 record class org.kiwiproject.curator.leader.LeadershipStatus.CuratorNotStarted
-
Returns a hash code value for this object.
- hashCode() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.IsLeader
-
Returns a hash code value for this object.
- hashCode() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.LatchNotStarted
-
Returns a hash code value for this object.
- hashCode() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.NoLatchParticipants
-
Returns a hash code value for this object.
- hashCode() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.NotLeader
-
Returns a hash code value for this object.
- hashCode() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.OtherError
-
Returns a hash code value for this object.
- 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
ManagedLeaderLatchExceptionif Curator is not started yet or has been closed; this latch is not started yet or has been closed; or if there are no latch participants yet. - hasLeadership() - Method in class org.kiwiproject.curator.leader.resource.LeaderResource
-
Checks whether this service is the latch leader.
- hasLeadershipIgnoringErrors() - Method in class org.kiwiproject.curator.leader.ManagedLeaderLatch
-
Returns whether this instance is the leader, or false if there are any errors getting leadership status.
- 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.
- isErrorStatus() - Method in interface org.kiwiproject.curator.leader.LeadershipStatus.ErrorLeadershipStatus
- isErrorStatus() - Method in interface org.kiwiproject.curator.leader.LeadershipStatus
-
Check whether the status is from a bad latch state, where the Curator client or the
LeaderLatchmight not be started or there are no participants in the latch. - isErrorStatus() - Method in interface org.kiwiproject.curator.leader.LeadershipStatus.ValidLeadershipStatus
- IsLeader() - Constructor for record class org.kiwiproject.curator.leader.LeadershipStatus.IsLeader
-
Creates an instance of a
IsLeaderrecord class. - 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.
- isValidStatus() - Method in interface org.kiwiproject.curator.leader.LeadershipStatus
-
Check whether the status is from a valid state, where the Curator client and the
LeaderLatchare both started, and there are latch participants.
L
- LatchNotStarted(LeaderLatch.State) - Constructor for record class org.kiwiproject.curator.leader.LeadershipStatus.LatchNotStarted
-
Creates an instance of a
LatchNotStartedrecord class. - latchState() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.LatchNotStarted
-
Returns the value of the
latchStaterecord component. - 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
- LeadershipStatus - Interface in org.kiwiproject.curator.leader
-
Defines a type that can be returned when checking if a
LeaderLatchhas leadership, taking into account the various issues that can cause problems. - LeadershipStatus.CuratorNotStarted - Record Class in org.kiwiproject.curator.leader
-
Represents an invalid latch state; Curator is not in the
STARTEDstate. - LeadershipStatus.ErrorLeadershipStatus - Interface in org.kiwiproject.curator.leader
-
Defines an invalid leadership status caused by an error or erroneous state.
- LeadershipStatus.IsLeader - Record Class in org.kiwiproject.curator.leader
-
Represents a valid latch state, where the participant is the current leader.
- LeadershipStatus.LatchNotStarted - Record Class in org.kiwiproject.curator.leader
-
Represents an invalid latch state; the LeaderLatch is not in the
STARTEDstate. - LeadershipStatus.NoLatchParticipants - Record Class in org.kiwiproject.curator.leader
-
Represents an invalid latch state; the
LeaderLatchhas no participants. - LeadershipStatus.NotLeader - Record Class in org.kiwiproject.curator.leader
-
Represents a valid latch state, where the participant is not the leader.
- LeadershipStatus.OtherError - Record Class in org.kiwiproject.curator.leader
-
Represents an invalid latch state; an unexpected Exception was thrown.
- LeadershipStatus.ValidLeadershipStatus - Interface in org.kiwiproject.curator.leader
-
Defines a valid leadership status.
M
- ManagedLeaderLatch - Class in org.kiwiproject.curator.leader
-
Wrapper around Curator's
LeaderLatchwhich 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 CuratorLeaderLatchand 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
- NoLatchParticipants() - Constructor for record class org.kiwiproject.curator.leader.LeadershipStatus.NoLatchParticipants
-
Creates an instance of a
NoLatchParticipantsrecord class. - NotLeader() - Constructor for record class org.kiwiproject.curator.leader.LeadershipStatus.NotLeader
-
Creates an instance of a
NotLeaderrecord class.
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
- OtherError(Exception) - Constructor for record class org.kiwiproject.curator.leader.LeadershipStatus.OtherError
-
Creates an instance of a
OtherErrorrecord class.
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 aManagedLeaderLatchHealthCheckunless 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
ManagedLeaderLatchand 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
ManagedLeaderLatchand 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 record class org.kiwiproject.curator.leader.LeadershipStatus.CuratorNotStarted
-
Returns a string representation of this record class.
- toString() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.IsLeader
-
Returns a string representation of this record class.
- toString() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.LatchNotStarted
-
Returns a string representation of this record class.
- toString() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.NoLatchParticipants
-
Returns a string representation of this record class.
- toString() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.NotLeader
-
Returns a string representation of this record class.
- toString() - Method in record class org.kiwiproject.curator.leader.LeadershipStatus.OtherError
-
Returns a string representation of this record class.
- 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
actionsynchronously 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
resultSuppliersynchronously 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
actionasynchronously 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
resultSupplierasynchronously only if this latch is currently the leader, returning aCompletableFuturewhose 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 suppliedexecutorinstead 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