Skip to content

Commit

Permalink
better logging and value returns
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncaci committed Dec 9, 2023
1 parent b695319 commit 187f75e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</parent>
<groupId>com.milmove.trdmlambda</groupId>
<artifactId>trdm-lambda</artifactId>
<version>1.0.0.6</version>
<version>1.0.0.7</version>
<name>trdm java spring interface</name>
<description>Project for deploying a Java TRDM interfacer for TGET data.</description>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,11 @@ public TransportationAccountingCodesHandler(
// is up to date with proper TGET data.
public void tacCron() throws SQLException, DatatypeConfigurationException, TableRequestException, IOException, ParseException {
// Gather the last update from TRDM
logger.info("getting lastTableUpdate response with physical name TRNSPRTN_ACNT");
LastTableUpdateResponse response = lastTableUpdate("TRNSPRTN_ACNT");
logger.info("received LastTableUpdateResponse, getting our latest TGET update now");
XMLGregorianCalendar ourLastUpdate = getOurLastTGETUpdate("transportation_accounting_codes");
logger.info("received out latest TGET update. Comparing the 2 values to see if our TGET data is out of date");
boolean tgetOutOfDate = isTGETDataOutOfDate(ourLastUpdate, response.getLastUpdate());
if (tgetOutOfDate) {
logger.info("TAC TGET data is out of date. Starting updateTGETData flow");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public LastTableUpdateResponse lastTableUpdateRequest(LastTableUpdateRequest req
* @throws TableRequestException
*/
private LastTableUpdateResponse createSoapRequest(LastTableUpdateRequest request) throws TableRequestException {
logger.info("LastTableUpdateService received create soap request with body {}", request);
ReturnTableLastUpdateRequest requestElement = new ReturnTableLastUpdateRequest();
requestElement.setPhysicalName(request.getPhysicalName());
return makeRequest(requestElement);
Expand All @@ -93,11 +94,11 @@ private LastTableUpdateResponse makeRequest(ReturnTableLastUpdateRequest request

switch (statusCode) {
case SUCCESS:
logger.info("Request for last table update succeeded");
logger.info("Request for last table update succeeded, setting values and returning now");
lastTableUpdateResponse.setDateTime(responseElement.getStatus().getDateTime());
lastTableUpdateResponse.setLastUpdate(responseElement.getLastUpdate());
lastTableUpdateResponse.setStatusCode(statusCode);
break;
return lastTableUpdateResponse;
case FAILURE:
logger.error("Request for last table update failed: {}",
responseElement.getStatus().getMessage());
Expand All @@ -107,6 +108,5 @@ private LastTableUpdateResponse makeRequest(ReturnTableLastUpdateRequest request
responseElement.getStatus().getMessage());
throw new TableRequestException(responseElement.getStatus().getMessage());
}
return lastTableUpdateResponse;
}
}

0 comments on commit 187f75e

Please sign in to comment.