Class LeaderResource
- java.lang.Object
-
- org.kiwiproject.curator.leader.resource.LeaderResource
-
@Path("/kiwi/leader-latch") @Produces("application/json") public class LeaderResource extends ObjectJAX-RS resource providing endpoints for checking leadership and participant information.
-
-
Constructor Summary
Constructors Constructor Description LeaderResource(ManagedLeaderLatch leaderLatch)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.ws.rs.core.ResponsegetLatchState()Get information about the leader latch that this service participates in.javax.ws.rs.core.ResponsehasLeadership()Checks whether this service is the latch leader.
-
-
-
Constructor Detail
-
LeaderResource
public LeaderResource(ManagedLeaderLatch leaderLatch)
-
-
Method Detail
-
hasLeadership
@GET @Path("/leader") public javax.ws.rs.core.Response hasLeadership()Checks whether this service is the latch leader.- Returns:
- the JSON
Response
-
getLatchState
@GET @Path("/latch") public javax.ws.rs.core.Response getLatchState()Get information about the leader latch that this service participates in.- Returns:
- the JSON
Response
-
-