From 36a908ed376d95bbddc6473769edfb7b7e0fe446 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Tue, 18 Sep 2012 08:07:07 +0200 Subject: [PATCH] Record and expose the last time all identities were loaded. --- .../pterodactylus/sone/freenet/wot/IdentityManager.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java index 6152c4b..bca6ac1 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/IdentityManager.java @@ -65,6 +65,9 @@ public class IdentityManager extends AbstractService { /* synchronize access on syncObject. */ private final Map currentOwnIdentities = new HashMap(); + /** The last time all identities were loaded. */ + private volatile long identitiesLastLoaded; + /** * Creates a new identity manager. * @@ -109,6 +112,16 @@ public class IdentityManager extends AbstractService { // /** + * Returns the last time all identities were loaded. + * + * @return The last time all identities were loaded (in milliseconds since + * Jan 1, 1970 UTC) + */ + public long getIdentitiesLastLoaded() { + return identitiesLastLoaded; + } + + /** * Returns whether the Web of Trust plugin could be reached during the last * try. * @@ -186,6 +199,7 @@ public class IdentityManager extends AbstractService { } } identitiesLoaded = true; + identitiesLastLoaded = System.currentTimeMillis(); } catch (WebOfTrustException wote1) { logger.log(Level.WARNING, "WoT has disappeared!", wote1); } -- 2.7.4