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

com.bazaarvoice.ostrich.examples.dictionary.service.ToggleHealthResource Maven / Gradle / Ivy

The newest version!
package com.bazaarvoice.ostrich.examples.dictionary.service;

import com.codahale.metrics.annotation.Timed;

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

@Path("/health")
@Produces(MediaType.APPLICATION_JSON)
public class ToggleHealthResource {
    @GET
    @Timed
    @Path("/{status}")
    public int toggle(@PathParam("status") int status) {
        DictionaryService.STATUS_OVERRIDE = Response.Status.fromStatusCode(status);
        return DictionaryService.STATUS_OVERRIDE.getStatusCode();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy