aboutsummaryrefslogtreecommitdiff
path: root/juick-xmpp/src/main/java/com/juick/components/s2s
diff options
context:
space:
mode:
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++;
}