All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kiwiproject.curator.leader.resource.GotLeaderLatchResource Maven / Gradle / Ivy

Go to download

This is a small library that integrates Apache Curator's Leader Latch recipe into a Dropwizard service.

There is a newer version: 2.3.1
Show newest version
package org.kiwiproject.curator.leader.resource;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

/**
 * JAX-RS resource providing a single endpoint that allows clients to determine whether this service
 * participates in a leader latch.
 * 

* Simply make a {@code GET /kiwi/got-leader-latch?} request. The question mark is clearly not required but * is perhaps a little more fun depending on your sense of humor, i.e. if you think programmer humor is funny * or terrible. *

* This resource should, of course, only be registered when the service participates in a leader latch. */ @Path("/kiwi/got-leader-latch") @Produces(MediaType.APPLICATION_JSON) public class GotLeaderLatchResource { /** * Returns a 204 (No Content) response if available. Otherwise, a 404 is returned (though obviously not * by this resource). * * @return the response */ @GET public Response gotLeaderLatch() { return Response.noContent().build(); } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy