diff --git a/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/MemberV3ApiServiceImplV3_0.java b/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/MemberV3ApiServiceImplV3_0.java index 5f87a3cabb1..7f0058de4e7 100644 --- a/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/MemberV3ApiServiceImplV3_0.java +++ b/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/MemberV3ApiServiceImplV3_0.java @@ -163,10 +163,12 @@ public Response viewSwaggerO2c() { * @return Plain text message indicating health of service */ @GET - @Produces(value = { MediaType.TEXT_PLAIN }) + @Produces(value = { MediaType.APPLICATION_JSON }) @Path(STATUS_PATH) - public Response viewStatusText() { - return serviceDelegator.viewStatusText(); + public Response viewStatusSimple() { + httpRequest.setAttribute("skipAccessLog", true); + httpRequest.setAttribute("isMonitoring", true); + return serviceDelegator.viewStatusSimple(); } @GET diff --git a/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator.java b/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator.java index 6eb75b2fa2f..a737daddc44 100644 --- a/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator.java +++ b/orcid-api-web/src/main/java/org/orcid/api/memberV3/server/delegator/MemberV3ApiServiceDelegator.java @@ -9,7 +9,7 @@ public interface MemberV3ApiServiceDelegator statusMap = statusManager.createStatusMapSimple(); + return Response.ok(statusMap).build(); } @Override diff --git a/orcid-api-web/src/main/resources/orcid-api-security-context.xml b/orcid-api-web/src/main/resources/orcid-api-security-context.xml index f591c40d24d..f9a141aeec8 100644 --- a/orcid-api-web/src/main/resources/orcid-api-security-context.xml +++ b/orcid-api-web/src/main/resources/orcid-api-security-context.xml @@ -22,6 +22,7 @@ + diff --git a/orcid-core/src/main/java/org/orcid/core/manager/StatusManager.java b/orcid-core/src/main/java/org/orcid/core/manager/StatusManager.java index c6963b464e2..c5a4f1fef90 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/StatusManager.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/StatusManager.java @@ -15,5 +15,7 @@ public interface StatusManager { String TOMCAT_UP = "tomcatUp"; Map createStatusMap(); + + Map createStatusMapSimple(); } diff --git a/orcid-core/src/main/java/org/orcid/core/manager/impl/StatusManagerImpl.java b/orcid-core/src/main/java/org/orcid/core/manager/impl/StatusManagerImpl.java index 94b84be767e..f7898b9c925 100644 --- a/orcid-core/src/main/java/org/orcid/core/manager/impl/StatusManagerImpl.java +++ b/orcid-core/src/main/java/org/orcid/core/manager/impl/StatusManagerImpl.java @@ -41,6 +41,13 @@ public Map createStatusMap() { return result; } + @Override + public Map createStatusMapSimple() { + Map result = new LinkedHashMap<>(); + result.put(TOMCAT_UP, true); + return result; + } + private boolean isConnectionOk(MiscDao miscDao) { try { Date dbDate = miscDao.retrieveDatabaseDatetime(); diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java index 090606de574..1507919ad57 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/PublicV3ApiServiceImplV3_0.java @@ -128,10 +128,12 @@ public Response viewSwagger() { @GET - @Produces(value = { MediaType.TEXT_PLAIN }) + @Produces(value = { MediaType.APPLICATION_JSON }) @Path(STATUS_PATH) - public Response viewStatusText() { - return serviceDelegator.viewStatusText(); + public Response viewStatusSimple() { + httpRequest.setAttribute("skipAccessLog", true); + httpRequest.setAttribute("isMonitoring", true); + return serviceDelegator.viewStatusSimple(); } @GET diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java index 1cb65965e31..368107244b6 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/PublicV3ApiServiceDelegator.java @@ -14,7 +14,7 @@ public interface PublicV3ApiServiceDelegator statusMap = statusManager.createStatusMapSimple(); + return Response.ok(statusMap).build(); } @Override diff --git a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java index 8ab83369285..96d5062bc89 100644 --- a/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java +++ b/orcid-pub-web/src/main/java/org/orcid/api/publicV3/server/delegator/impl/PublicV3ApiServiceVersionedDelegatorImpl.java @@ -38,8 +38,8 @@ public void setPublicV3ApiServiceDelegator( } @Override - public Response viewStatusText() { - return publicV3ApiServiceDelegator.viewStatusText(); + public Response viewStatusSimple() { + return publicV3ApiServiceDelegator.viewStatusSimple(); } @Override