@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; }
@GET @Path("/runningTasks") @Produces(MediaType.APPLICATION_JSON) public Response getRunningTasks( @QueryParam("type") String taskType, @Context final HttpServletRequest req ) { return getTasks("running", null, null, null, taskType, req); }
@DELETE @Path("{taskId}/results/{bufferId}") @Produces(MediaType.APPLICATION_JSON) public void abortResults(@PathParam("taskId") TaskId taskId, @PathParam("bufferId") OutputBufferId bufferId, @Context UriInfo uriInfo) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); taskManager.abortTaskResults(taskId, bufferId); }
@POST @Path("/assignTask") @Consumes({MediaType.APPLICATION_JSON, SmileMediaTypes.APPLICATION_JACKSON_SMILE}) public Response assignTask(Task task) { try { workerTaskMonitor.assignTask(task); return Response.ok().build(); } catch (RuntimeException ex) { return Response.serverError().entity(ex.getMessage()).build(); } }
@GET @Path( PATH_LABELS ) public Response getAllLabels( @QueryParam( "in_use" ) @DefaultValue( "true" ) boolean inUse ) { return output.ok( actions.getAllLabels( inUse ) ); }
@GET @Path("/completeTasks") @Produces(MediaType.APPLICATION_JSON) public Response getCompleteTasks( @QueryParam("n") final Integer maxTaskStatuses, @Context final HttpServletRequest req ) { return getTasks("complete", null, null, maxTaskStatuses, null, req); }
@GET @Path("{taskId}/results/{bufferId}/{token}/acknowledge") public void acknowledgeResults( @PathParam("taskId") TaskId taskId, @PathParam("bufferId") OutputBufferId bufferId, @PathParam("token") final long token) { requireNonNull(taskId, "taskId is null"); requireNonNull(bufferId, "bufferId is null"); taskManager.acknowledgeTaskResults(taskId, bufferId, token); }
@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; }