@GET @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) @Path("{id}.{type:xml|json}") @RestQuery(name = "incidentjson", description = "Returns the job incident by it's incident identifier.", returnDescription = "Returns the job incident.", pathParameters = { @RestParameter(name = "id", isRequired = true, description = "The incident identifier.", type = Type.INTEGER), @RestParameter(name = "type", isRequired = true, description = "The media type of the response [xml|json]", defaultValue = "xml", type = Type.STRING)}, reponses = { @RestResponse(responseCode = SC_OK, description = "The job incident."), @RestResponse(responseCode = SC_NOT_FOUND, description = "No job incident with this identifier was found.")}) public Response getIncident(@PathParam("id") final long incidentId, @PathParam("type") final String type) throws NotFoundException { try { Incident incident = svc.getIncident(incidentId); return ok(getResponseType(type), new JaxbIncident(incident)); } catch (IncidentServiceException e) { logger.warn("Unable to get job incident for incident id {}: {}", incidentId, e); throw new WebApplicationException(INTERNAL_SERVER_ERROR); } }