Skip to content

Commit

Permalink
upgrade to jackson 2.8.0 and use DateTime for zendesk start times
Browse files Browse the repository at this point in the history
There was a BUG in jackson FasterXML/jackson-databind#1124 fixed in 2.7.2.
In addition spring 4.3.0 officially claims compatibility with jackson 2.8.0
  • Loading branch information
jimirocks committed Jul 14, 2016
1 parent e69f120 commit a8edb0e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ The *GoodData Java SDK* uses:
* the [GoodData HTTP client](https://github.com/gooddata/gooddata-http-client) version 0.9.3 or later
* the *Apache HTTP Client* version 4.3 or later (for white-labeled domains at least version 4.3.2 is required)
* the *Spring Framework* version 4.3.*
* the *Jackson JSON Processor* version 2.7.0 (*GoodData Java SDK* version 0.x requires version 1.9)
* the *Jackson JSON Processor* version 2.8.*
* the *Java Development Kit (JDK)* version 7 or later

## License
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<httpclient.version>4.3.3</httpclient.version>
<jackson.version>2.7.0</jackson.version>
<jackson.version>2.8.0</jackson.version>
<spring.version>4.3.1.RELEASE</spring.version>
<jadler.version>1.1.1</jadler.version>
<json-unit.version>1.5.3</json-unit.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
import static com.gooddata.util.Validate.notNull;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.gooddata.util.ISODateTimeSerializer;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;

import java.util.Map;
import java.util.TreeMap;
Expand All @@ -21,11 +20,9 @@
*/
public class Zendesk4ProcessExecution implements ProcessExecution {

private static final DateTimeFormatter FORMATTER = ISODateTimeFormat.dateTime().withZone(DateTimeZone.UTC);

private Boolean incremental;

private Map<String, String> startTimes;
private Map<String, DateTime> startTimes;

@Override
public ConnectorType getConnectorType() {
Expand All @@ -41,7 +38,8 @@ public void setIncremental(final Boolean incremental) {
}

@JsonAnyGetter
public Map<String, String> getStartTimes() {
@JsonSerialize(contentUsing = ISODateTimeSerializer.class)
public Map<String, DateTime> getStartTimes() {
return startTimes;
}

Expand All @@ -50,8 +48,8 @@ public void setStartTime(final String resource, final DateTime startTime) {
notEmpty(resource, "resource can't be empty");
notNull(startTime, "startTime can't be null");

startTimes = startTimes == null ? new TreeMap<String, String>() : startTimes;
startTimes = startTimes == null ? new TreeMap<String, DateTime>() : startTimes;

startTimes.put(resource + "StartDate", FORMATTER.print(startTime));
startTimes.put(resource + "StartDate", startTime);
}
}

0 comments on commit a8edb0e

Please sign in to comment.