Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Last issues with Jena 2 in Store Update
Browse files Browse the repository at this point in the history
  • Loading branch information
berezovskyi committed Nov 27, 2017
1 parent 057e730 commit 510f53c
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/store-update/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<dependency>
<groupId>org.eclipse.lyo.store</groupId>
<artifactId>store-core</artifactId>
<version>2.2.0</version>
<version>${oslc4j-core.version}</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import java.lang.reflect.InvocationTargetException;
import java.net.URI;
import java.net.URISyntaxException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Collection;
import java.util.List;
import java.util.TimeZone;

import javax.xml.datatype.DatatypeConfigurationException;

Expand All @@ -24,7 +27,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.hp.hpl.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Model;

public class TrsMqttChangeLogHandler<T> extends TrsChangelogHandler<T> {
private final Logger log = LoggerFactory.getLogger(TrsMqttChangeLogHandler.class);
Expand Down Expand Up @@ -73,7 +76,11 @@ private AbstractResource trsChangeResourceFrom(HistoryData historyData) {
URI uri = historyData.getUri();
URI changedUri;
try {
changedUri = new URI("urn:x-trs:" + historyData.getTimestamp() + ":this.order");
TimeZone tz = TimeZone.getTimeZone("UTC");
DateFormat df = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm'Z'"); // Quoted "Z" to indicate UTC, no timezone offset
df.setTimeZone(tz);
String nowAsISO = df.format(historyData.getTimestamp());
changedUri = new URI("urn:x-trs:" + nowAsISO + ":" + this.order);
ChangeEvent ce;
if (histDataType == HistoryData.CREATED) {
ce = new Creation(changedUri, uri, this.order);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.eclipse.lyo.store.update;

import com.hp.hpl.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Model;
import java.net.URI;
import java.time.Instant;
import java.util.Collections;
Expand Down

0 comments on commit 510f53c

Please sign in to comment.