Skip to content

Commit

Permalink
added zulu
Browse files Browse the repository at this point in the history
  • Loading branch information
cameroncaci committed Dec 9, 2023
1 parent 187f75e commit 7503bb0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 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.7</version>
<version>1.0.0.8</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 @@ -67,7 +67,8 @@ public TransportationAccountingCodesHandler(

// This cron job will handle the entirety of ensuring the RDS db
// is up to date with proper TGET data.
public void tacCron() throws SQLException, DatatypeConfigurationException, TableRequestException, IOException, ParseException {
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");
Expand Down Expand Up @@ -104,9 +105,10 @@ private XMLGregorianCalendar getOurLastTGETUpdate(String tableName)
if (rs.next()) {
Timestamp lastUpdatedTimestamp = rs.getTimestamp("rds_last_updated");

// Convert our last update pulled from the db into XML Gregorian Calendar friendly format
// Convert our last update pulled from the db into XML Gregorian Calendar
// friendly format
SimpleDateFormat xmlUnfriendlyLastUpdateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSSSS");
SimpleDateFormat xmlFriendlyLastUpdateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");
SimpleDateFormat xmlFriendlyLastUpdateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");

Date date = xmlUnfriendlyLastUpdateFormat.parse(lastUpdatedTimestamp.toString());
String xmlGregorianCalendarString = xmlFriendlyLastUpdateFormat.format(date);
Expand All @@ -126,7 +128,7 @@ private boolean isTGETDataOutOfDate(XMLGregorianCalendar ourLastUpdate, XMLGrego

private void updateTGETData(XMLGregorianCalendar ourLastUpdate, String trdmTable, String rdsTable)
throws TableRequestException, DatatypeConfigurationException, IOException, SQLException {
logger.info("checking if trdm table name provided is allowed..");
logger.info("checking if trdm table name provided is allowed..");
if (!allowedTrdmTableNames.contains(trdmTable)) {
throw new IllegalArgumentException("Invalid table name");
}
Expand Down

0 comments on commit 7503bb0

Please sign in to comment.