X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fdata%2FSoneImpl.java;h=725f32ac92f64bcd00dcab9e176c7f3b6a8f85e6;hp=86c593577a5f56911202490846bbedd0feb58b1f;hb=354008ba4035d245b39a13281d4b69b738fee8a1;hpb=239f08e37721401290f43596e8a7e9aa83aae980 diff --git a/src/main/java/net/pterodactylus/sone/data/SoneImpl.java b/src/main/java/net/pterodactylus/sone/data/SoneImpl.java index 86c5935..725f32a 100644 --- a/src/main/java/net/pterodactylus/sone/data/SoneImpl.java +++ b/src/main/java/net/pterodactylus/sone/data/SoneImpl.java @@ -19,6 +19,7 @@ package net.pterodactylus.sone.data; import static com.google.common.base.Preconditions.checkNotNull; import static java.lang.String.format; +import static java.util.logging.Logger.getLogger; import java.net.MalformedURLException; import java.util.ArrayList; @@ -33,7 +34,6 @@ import java.util.logging.Logger; import net.pterodactylus.sone.data.SoneOptions.DefaultSoneOptions; import net.pterodactylus.sone.freenet.wot.Identity; import net.pterodactylus.sone.freenet.wot.OwnIdentity; -import net.pterodactylus.util.logging.Logging; import freenet.keys.FreenetURI; @@ -50,7 +50,7 @@ import com.google.common.hash.Hashing; public class SoneImpl implements Sone { /** The logger. */ - private static final Logger logger = Logging.getLogger(SoneImpl.class); + private static final Logger logger = getLogger("Sone.Data"); /** The ID of this Sone. */ private final String id; @@ -61,13 +61,6 @@ public class SoneImpl implements Sone { /** The identity of this Sone. */ private final Identity identity; - /** The URI under which the Sone is stored in Freenet. */ - private volatile FreenetURI requestUri; - - /** The URI used to insert a new version of this Sone. */ - /* This will be null for remote Sones! */ - private volatile FreenetURI insertUri; - /** The latest edition of the Sone. */ private volatile long latestEdition; @@ -190,7 +183,10 @@ public class SoneImpl implements Sone { return null; } try { - return new FreenetURI(((OwnIdentity) getIdentity()).getInsertUri()).setDocName("Sone").setMetaString(new String[0]); + return new FreenetURI(((OwnIdentity) getIdentity()).getInsertUri()) + .setDocName("Sone") + .setMetaString(new String[0]) + .setSuggestedEdition(latestEdition); } catch (MalformedURLException e) { throw new IllegalStateException(format("Own identity %s's insert URI is incorrect.", getIdentity()), e); } @@ -707,7 +703,7 @@ public class SoneImpl implements Sone { /** {@inheritDoc} */ @Override public String toString() { - return getClass().getName() + "[identity=" + identity + ",requestUri=" + requestUri + ",insertUri(" + String.valueOf(insertUri).length() + "),friends(" + friendSones.size() + "),posts(" + posts.size() + "),replies(" + replies.size() + "),albums(" + getRootAlbum().getAlbums().size() + ")]"; + return getClass().getName() + "[identity=" + identity + ",friends(" + friendSones.size() + "),posts(" + posts.size() + "),replies(" + replies.size() + "),albums(" + getRootAlbum().getAlbums().size() + ")]"; } }