@Path("dubbo") @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML}) @Produces({MediaType.APPLICATION_JSON + "; " + "charset=UTF-8", MediaType.TEXT_XML + "; " + "charset=UTF-8"}) public interface DubboSwaggerService { @GET @Path("swagger") public Response getListingJson(@Context Application app, @Context ServletConfig sc, @Context HttpHeaders headers, @Context UriInfo uriInfo) throws JsonProcessingException; }
@DELETE @Path("{taskId}") @Produces(MediaType.APPLICATION_JSON) public synchronized TaskInfo deleteTask( @PathParam("taskId") TaskId taskId, @QueryParam("abort") @DefaultValue("true") boolean abort, @Context UriInfo uriInfo) { lastActivityNanos.set(System.nanoTime()); taskState = abort ? TaskState.ABORTED : TaskState.CANCELED; return buildTaskInfo(); }
@GET @Path("/echo_token") public String echoToken(@HeaderParam(TRACETOKEN_HEADER) String token) { return token; } }
@GET public static String hello() { return "hello"; } }
@Path("accounts/{accountId}/") public Item getItem(@PathParam("accountId") String accountId) { // An unauthorized user tries to enter throw new NotAuthorizedException("You Don't Have Permission"); }
@Path("dubbo") @Consumes({MediaType.APPLICATION_JSON, MediaType.TEXT_XML}) @Produces({MediaType.APPLICATION_JSON + "; " + "charset=UTF-8", MediaType.TEXT_XML + "; " + "charset=UTF-8"}) public interface DubboSwaggerService { @GET @Path("swagger") public Response getListingJson(@Context Application app, @Context ServletConfig sc, @Context HttpHeaders headers, @Context UriInfo uriInfo) throws JsonProcessingException; }