aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp/src/main/java/com/juick/components/s2s
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-10-09 14:46:43 +0300
committerGravatar Vitaly Takmazov2017-10-09 14:46:43 +0300
commit0c68eb43910b49669ace45de51aa2a4ea3d6f6f0 (patch)
tree2b90d9e76a13006f9a5875709db70c9778b4bae5 /juick-xmpp/src/main/java/com/juick/components/s2s
parent51bfc341be1975b7a11e0b3a59cfbb4710e78446 (diff)
xmpp: Java 8 Time API
Diffstat (limited to 'juick-xmpp/src/main/java/com/juick/components/s2s')
-rw-r--r--juick-xmpp/src/main/java/com/juick/components/s2s/Connection.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/juick-xmpp/src/main/java/com/juick/components/s2s/Connection.java b/juick-xmpp/src/main/java/com/juick/components/s2s/Connection.java
index 7fd036eb..86f276b4 100644
--- a/juick-xmpp/src/main/java/com/juick/components/s2s/Connection.java
+++ b/juick-xmpp/src/main/java/com/juick/components/s2s/Connection.java
@@ -33,6 +33,7 @@ import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.security.*;
import java.security.cert.CertificateException;
+import java.time.Instant;
import java.util.UUID;
/**
@@ -44,8 +45,8 @@ public class Connection {
protected static final Logger logger = LoggerFactory.getLogger(Connection.class);
public String streamID;
- public long tsCreated = 0;
- public long tsLocalData = 0;
+ public Instant created;
+ public Instant updated;
public long bytesLocal = 0;
public long packetsLocal = 0;
XMPPServer xmpp;
@@ -74,7 +75,7 @@ public class Connection {
public Connection(XMPPServer xmpp) throws XmlPullParserException, KeyStoreException, CertificateException, NoSuchAlgorithmException, IOException, UnrecoverableKeyException, KeyManagementException {
this.xmpp = xmpp;
- tsCreated = System.currentTimeMillis();
+ created = Instant.now();
KeyStore ks = KeyStore.getInstance("JKS");
try (InputStream ksIs = new FileInputStream(xmpp.keystore)) {
ks.load(ksIs, xmpp.keystorePassword.toCharArray());
@@ -111,7 +112,7 @@ public class Connection {
logger.error("send stanza failed", e);
}
- tsLocalData = System.currentTimeMillis();
+ updated = Instant.now();
bytesLocal += xml.length();
packetsLocal++;
}