From: David ‘Bombe’ Roden Date: Wed, 26 Nov 2014 18:39:16 +0000 (+0100) Subject: Store insert fingerprint in “Sone inserted” event. X-Git-Tag: 0.9-rc1^2~3^2~6 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=99b7aae44bab4c7cdb8f1ff58b56b5b25ae239b0;p=Sone.git Store insert fingerprint in “Sone inserted” event. --- diff --git a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java index c38e495..33bc240 100644 --- a/src/main/java/net/pterodactylus/sone/core/SoneInserter.java +++ b/src/main/java/net/pterodactylus/sone/core/SoneInserter.java @@ -229,7 +229,7 @@ public class SoneInserter extends AbstractService { long insertTime = currentTimeMillis(); eventBus.post(new SoneInsertingEvent(sone)); FreenetURI finalUri = freenetInterface.insertDirectory(sone.getInsertUri(), insertInformation.generateManifestEntries(), "index.html"); - eventBus.post(new SoneInsertedEvent(sone, currentTimeMillis() - insertTime)); + eventBus.post(new SoneInsertedEvent(sone, currentTimeMillis() - insertTime, insertInformation.getFingerprint())); /* at this point we might already be stopped. */ if (shouldStop()) { /* if so, bail out, don’t change anything. */ diff --git a/src/main/java/net/pterodactylus/sone/core/event/SoneInsertedEvent.java b/src/main/java/net/pterodactylus/sone/core/event/SoneInsertedEvent.java index a3d9329..936a134 100644 --- a/src/main/java/net/pterodactylus/sone/core/event/SoneInsertedEvent.java +++ b/src/main/java/net/pterodactylus/sone/core/event/SoneInsertedEvent.java @@ -27,14 +27,20 @@ import net.pterodactylus.sone.data.Sone; public class SoneInsertedEvent extends SoneEvent { private final long insertDuration; + private final String insertFingerprint; - public SoneInsertedEvent(Sone sone, long insertDuration) { + public SoneInsertedEvent(Sone sone, long insertDuration, String insertFingerprint) { super(sone); this.insertDuration = insertDuration; + this.insertFingerprint = insertFingerprint; } public long insertDuration() { return insertDuration; } + public String insertFingerprint() { + return insertFingerprint; + } + }