Store insert fingerprint in “Sone inserted” event.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Nov 2014 18:39:16 +0000 (19:39 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 26 Nov 2014 18:39:16 +0000 (19:39 +0100)
src/main/java/net/pterodactylus/sone/core/SoneInserter.java
src/main/java/net/pterodactylus/sone/core/event/SoneInsertedEvent.java

index c38e495..33bc240 100644 (file)
@@ -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. */
index a3d9329..936a134 100644 (file)
@@ -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;
+       }
+
 }