X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ffreenet%2Fwot%2FDefaultIdentity.java;h=dcafb188becf9a5083d3fafc45c63c74e712e2d5;hb=0bfd860518040f5d55d06f740f20e5d2ba44439a;hp=d262d57eaae048d549bcf34fa4eac448ebda7b43;hpb=a211a3bd360593efc9e7fba33d607a3b14d0a965;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultIdentity.java b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultIdentity.java index d262d57..dcafb18 100644 --- a/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultIdentity.java +++ b/src/main/java/net/pterodactylus/sone/freenet/wot/DefaultIdentity.java @@ -24,12 +24,12 @@ import java.util.Map; import java.util.Set; import net.pterodactylus.sone.freenet.plugin.PluginException; -import net.pterodactylus.util.cache.Cache; import net.pterodactylus.util.cache.CacheException; import net.pterodactylus.util.cache.CacheItem; import net.pterodactylus.util.cache.DefaultCacheItem; import net.pterodactylus.util.cache.MemoryCache; import net.pterodactylus.util.cache.ValueRetriever; +import net.pterodactylus.util.cache.WritableCache; /** * A Web of Trust identity. @@ -57,7 +57,7 @@ public class DefaultIdentity implements Identity { private final Map properties = Collections.synchronizedMap(new HashMap()); /** Cached trust. */ - private final Cache trustCache = new MemoryCache(new ValueRetriever() { + private final WritableCache trustCache = new MemoryCache(new ValueRetriever() { @Override @SuppressWarnings("synthetic-access") @@ -248,6 +248,18 @@ public class DefaultIdentity implements Identity { } } + /** + * Sets the trust received for this identity by the given own identity. + * + * @param ownIdentity + * The own identity that gives the trust + * @param trust + * The trust received for this identity + */ + void setTrustPrivate(OwnIdentity ownIdentity, Trust trust) { + trustCache.put(ownIdentity, trust); + } + // // OBJECT METHODS //