projects
/
Sone.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Record and expose the last time all identities were loaded.
[Sone.git]
/
src
/
main
/
java
/
net
/
pterodactylus
/
sone
/
freenet
/
wot
/
IdentityManager.java
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
(file)
--- 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<String, OwnIdentity> currentOwnIdentities = new HashMap<String, OwnIdentity>();
/* synchronize access on syncObject. */
private final Map<String, OwnIdentity> currentOwnIdentities = new HashMap<String, OwnIdentity>();
+ /** The last time all identities were loaded. */
+ private volatile long identitiesLastLoaded;
+
/**
* Creates a new identity manager.
*
/**
* 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.
*
* 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;
}
}
identitiesLoaded = true;
+ identitiesLastLoaded = System.currentTimeMillis();
} catch (WebOfTrustException wote1) {
logger.log(Level.WARNING, "WoT has disappeared!", wote1);
}
} catch (WebOfTrustException wote1) {
logger.log(Level.WARNING, "WoT has disappeared!", wote1);
}