Skip to content
This repository has been archived by the owner on May 21, 2019. It is now read-only.

Commit

Permalink
Various updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jplock committed Dec 2, 2017
1 parent 325f48f commit c99759d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 16 deletions.
6 changes: 1 addition & 5 deletions pipeline-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,12 @@
<artifactId>pipeline-application</artifactId>
<name>Pipeline Application</name>

<properties>
<package.name>pipeline</package.name>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-bom</artifactId>
<version>1.11.232</version>
<version>1.11.241</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@
*/
package com.smoketurner.pipeline.application.aws;

import java.time.Clock;
import java.time.Duration;
import java.time.ZonedDateTime;
import java.util.Objects;
import javax.annotation.concurrent.Immutable;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.Duration;
import org.joda.time.Interval;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
Expand All @@ -34,7 +33,7 @@
public final class AmazonSNSNotification {

private final String message;
private final DateTime timestamp;
private final ZonedDateTime timestamp;

/**
* Constructor
Expand All @@ -44,7 +43,7 @@ public final class AmazonSNSNotification {
*/
@JsonCreator
public AmazonSNSNotification(@JsonProperty("Message") final String message,
@JsonProperty("Timestamp") final DateTime timestamp) {
@JsonProperty("Timestamp") final ZonedDateTime timestamp) {
this.message = message;
this.timestamp = timestamp;
}
Expand All @@ -55,15 +54,17 @@ public String getMessage() {
}

@JsonProperty("Timestamp")
public DateTime getTimestamp() {
public ZonedDateTime getTimestamp() {
return timestamp;
}

@JsonIgnore
public Duration getDelayDuration() {
final Interval interval = new Interval(timestamp,
DateTime.now(DateTimeZone.UTC));
return interval.toDuration();
if (timestamp == null) {
return null;
}
return Duration.between(timestamp,
ZonedDateTime.now(Clock.systemUTC()));
}

@JsonIgnore
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
<dependency>
<groupId>com.google.errorprone</groupId>
<artifactId>error_prone_core</artifactId>
<version>2.1.2</version>
<version>2.1.3</version>
</dependency>
</dependencies>
</plugin>
Expand Down

0 comments on commit c99759d

Please sign in to comment.