From 99b7aae44bab4c7cdb8f1ff58b56b5b25ae239b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Wed, 26 Nov 2014 19:39:16 +0100 Subject: [PATCH] =?utf8?q?Store=20insert=20fingerprint=20in=20=E2=80=9CSon?= =?utf8?q?e=20inserted=E2=80=9D=20event.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/java/net/pterodactylus/sone/core/SoneInserter.java | 2 +- .../java/net/pterodactylus/sone/core/event/SoneInsertedEvent.java | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) 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; + } + } -- 2.7.4