updated healthcheck
This commit is contained in:
parent
8d46d0610b
commit
be9b396967
|
@ -218,7 +218,7 @@ public class GeoportalExporter {
|
||||||
*/
|
*/
|
||||||
@GET
|
@GET
|
||||||
@Path("/export/{type}/healthcheck")
|
@Path("/export/{type}/healthcheck")
|
||||||
@Produces({ MediaType.TEXT_HTML, MediaType.TEXT_PLAIN, MediaType.APPLICATION_JSON })
|
@Produces({ MediaType.APPLICATION_JSON, MediaType.TEXT_PLAIN, MediaType.TEXT_HTML })
|
||||||
public Response healthcheck(@Context HttpServletRequest req, @PathParam(EXPORT_TYPE) String export_type)
|
public Response healthcheck(@Context HttpServletRequest req, @PathParam(EXPORT_TYPE) String export_type)
|
||||||
throws WebApplicationException {
|
throws WebApplicationException {
|
||||||
|
|
||||||
|
@ -247,13 +247,13 @@ public class GeoportalExporter {
|
||||||
theJson.setState("OK");
|
theJson.setState("OK");
|
||||||
theJson.setMessage(GeoportalExporter.class.getSimpleName() + " Config OK in the context: " + context);
|
theJson.setMessage(GeoportalExporter.class.getSimpleName() + " Config OK in the context: " + context);
|
||||||
String jsonResponse = responseToString(theJson);
|
String jsonResponse = responseToString(theJson);
|
||||||
return Response.ok(jsonResponse).type(MediaType.APPLICATION_JSON).build();
|
return Response.ok(jsonResponse).build();
|
||||||
} else {
|
} else {
|
||||||
theJson.setState("KO");
|
theJson.setState("KO");
|
||||||
theJson.setMessage(GeoportalExporter.class.getSimpleName() + " Config "
|
theJson.setMessage(GeoportalExporter.class.getSimpleName() + " Config "
|
||||||
+ Status.NOT_FOUND.getReasonPhrase() + " in the context: " + context);
|
+ Status.NOT_FOUND.getReasonPhrase() + " in the context: " + context);
|
||||||
String jsonResponse = responseToString(theJson);
|
String jsonResponse = responseToString(theJson);
|
||||||
return Response.status(Status.NOT_FOUND).entity(jsonResponse).type(MediaType.APPLICATION_JSON).build();
|
return Response.status(Status.NOT_FOUND).entity(jsonResponse).build();
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
Loading…
Reference in New Issue