From: David ‘Bombe’ Roden Date: Tue, 18 Sep 2012 06:07:07 +0000 (+0200) Subject: Record and expose the last time all identities were loaded. X-Git-Tag: 0.8.3^2~8 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=36a908ed376d95bbddc6473769edfb7b7e0fe446;p=Sone.git Record and expose the last time all identities were loaded. --- 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); }