Skip to content

Commit

Permalink
Merge branch 'main' into 8984-fix-the-outstanding-issues-that-we-have…
Browse files Browse the repository at this point in the history
…-with-a-small-number-of-work-identifiers
  • Loading branch information
leomendoza123 authored Jan 3, 2024
2 parents 494d3bf + 6ef4fd8 commit 2caccd3
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## v2.47.11 - 2024-01-03

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.47.10...v2.47.11)

- [#6962](https://github.com/ORCID/ORCID-Source/pull/6962): Repurposed plain text status checks for the APIs into simple json check.

## v2.47.10 - 2024-01-02

[Full Changelog](https://github.com/ORCID/ORCID-Source/compare/v2.47.9...v2.47.10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface MemberV3ApiServiceDelegator<DISTINCTION, EDUCATION, EMPLOYMENT,

static final String LATEST_V3_VERSION = "3.0";

Response viewStatusText();
Response viewStatusSimple();

Response viewStatus();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,8 +278,9 @@ public void setFilterVersionOfIdentifiers(Boolean filterVersionOfIdentifiers) {
}

@Override
public Response viewStatusText() {
return Response.ok(STATUS_OK_MESSAGE).build();
public Response viewStatusSimple() {
Map<String, Boolean> statusMap = statusManager.createStatusMapSimple();
return Response.ok(statusMap).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<sec:http pattern="/v3**/o2c.html" security="none"/>

<!-- Status check -->
<sec:http pattern="/v*/status" security="none"/>
<sec:http pattern="/v*/apiStatus" security="none"/>

<!-- Authenticate the client before reaching the token endpoint -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,7 @@ public interface StatusManager {
String TOMCAT_UP = "tomcatUp";

Map<String, Boolean> createStatusMap();

Map<String, Boolean> createStatusMapSimple();

}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,13 @@ public Map<String, Boolean> createStatusMap() {
return result;
}

@Override
public Map<String, Boolean> createStatusMapSimple() {
Map<String, Boolean> result = new LinkedHashMap<>();
result.put(TOMCAT_UP, true);
return result;
}

private boolean isConnectionOk(MiscDao miscDao) {
try {
Date dbDate = miscDao.retrieveDatabaseDatetime();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public interface PublicV3ApiServiceDelegator<DISTINCTION, EDUCATION, EMPLOYMENT,

static final String LATEST_V3_VERSION = "3.0";

Response viewStatusText();
Response viewStatusSimple();

Response viewStatus();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,9 @@ public void setFilterVersionOfIdentifiers(Boolean filterVersionOfIdentifiers) {
}

@Override
public Response viewStatusText() {
return Response.ok(STATUS_OK_MESSAGE).build();
public Response viewStatusSimple() {
Map<String, Boolean> statusMap = statusManager.createStatusMapSimple();
return Response.ok(statusMap).build();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ public void setPublicV3ApiServiceDelegator(
}

@Override
public Response viewStatusText() {
return publicV3ApiServiceDelegator.viewStatusText();
public Response viewStatusSimple() {
return publicV3ApiServiceDelegator.viewStatusSimple();
}

@Override
Expand Down

0 comments on commit 2caccd3

Please sign in to comment.