Create trust updater and store it in the core.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 5 Sep 2012 09:58:35 +0000 (11:58 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 5 Sep 2012 09:58:35 +0000 (11:58 +0200)
src/main/java/net/pterodactylus/sone/core/Core.java
src/main/java/net/pterodactylus/sone/main/SonePlugin.java

index 4001f46..4b79c3f 100644 (file)
@@ -112,6 +112,9 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
        /** The update checker. */
        private final UpdateChecker updateChecker;
 
+       /** The trust updater. */
+       private final TrustUpdater trustUpdater;
+
        /** The FCP interface. */
        private volatile FcpInterface fcpInterface;
 
@@ -185,7 +188,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
         * @param identityManager
         *            The identity manager
         */
-       public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager) {
+       public Core(Configuration configuration, FreenetInterface freenetInterface, IdentityManager identityManager, TrustUpdater trustUpdater) {
                super("Sone Core");
                this.configuration = configuration;
                this.freenetInterface = freenetInterface;
@@ -193,6 +196,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                this.soneDownloader = new SoneDownloader(this, freenetInterface);
                this.imageInserter = new ImageInserter(this, freenetInterface);
                this.updateChecker = new UpdateChecker(freenetInterface);
+               this.trustUpdater = trustUpdater;
        }
 
        //
@@ -1967,6 +1971,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                loadConfiguration();
                updateChecker.addUpdateListener(this);
                updateChecker.start();
+               trustUpdater.start();
        }
 
        /**
@@ -1999,6 +2004,7 @@ public class Core extends AbstractService implements IdentityListener, UpdateLis
                                soneInserter.stop();
                        }
                }
+               trustUpdater.stop();
                updateChecker.stop();
                updateChecker.removeUpdateListener(this);
                soneDownloader.stop();
index cca2c7b..a02165e 100644 (file)
@@ -24,6 +24,7 @@ import java.util.logging.Logger;
 
 import net.pterodactylus.sone.core.Core;
 import net.pterodactylus.sone.core.FreenetInterface;
+import net.pterodactylus.sone.core.TrustUpdater;
 import net.pterodactylus.sone.fcp.FcpInterface;
 import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend;
 import net.pterodactylus.sone.freenet.plugin.PluginConnector;
@@ -188,8 +189,12 @@ public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, Fr
                        identityManager = new IdentityManager(webOfTrustConnector);
                        identityManager.setContext("Sone");
 
+                       /* create trust updater. */
+                       TrustUpdater trustUpdater = new TrustUpdater(webOfTrustConnector);
+                       trustUpdater.init();
+
                        /* create core. */
-                       core = new Core(oldConfiguration, freenetInterface, identityManager);
+                       core = new Core(oldConfiguration, freenetInterface, identityManager, trustUpdater);
 
                        /* create the web interface. */
                        webInterface = new WebInterface(this);