From 45758dd574219c139923b1a9c50d174129a0b740 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 29 Oct 2010 21:50:57 +0200 Subject: [PATCH] Store Web of Trust connector in Core. --- .../java/net/pterodactylus/sone/core/Core.java | 25 ++++++++++++++++++++++ .../net/pterodactylus/sone/main/SonePlugin.java | 7 ++++++ 2 files changed, 32 insertions(+) diff --git a/src/main/java/net/pterodactylus/sone/core/Core.java b/src/main/java/net/pterodactylus/sone/core/Core.java index 173f1d4..6ceede0 100644 --- a/src/main/java/net/pterodactylus/sone/core/Core.java +++ b/src/main/java/net/pterodactylus/sone/core/Core.java @@ -40,6 +40,7 @@ import net.pterodactylus.sone.data.Post; import net.pterodactylus.sone.data.Profile; import net.pterodactylus.sone.data.Reply; import net.pterodactylus.sone.data.Sone; +import net.pterodactylus.sone.freenet.wot.WebOfTrustConnector; import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; import net.pterodactylus.util.filter.Filter; @@ -98,6 +99,9 @@ public class Core extends AbstractService { /** Interface to freenet. */ private FreenetInterface freenetInterface; + /** The WoT connector. */ + private WebOfTrustConnector webOfTrustConnector; + /** The Sone downloader. */ private SoneDownloader soneDownloader; @@ -171,6 +175,27 @@ public class Core extends AbstractService { } /** + * Returns the Web of Trust connector. + * + * @return The Web of Trust connector + */ + public WebOfTrustConnector getWebOfTrustConnector() { + return webOfTrustConnector; + } + + /** + * Sets the Web of Trust connector. + * + * @param webOfTrustConnector + * The Web of Trust connector + * @return This core (for method chaining) + */ + public Core setWebOfTrustConnector(WebOfTrustConnector webOfTrustConnector) { + this.webOfTrustConnector = webOfTrustConnector; + return this; + } + + /** * Returns the local Sones. * * @return The local Sones diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 531bc90..e156967 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -26,6 +26,8 @@ import java.util.logging.Logger; import net.pterodactylus.sone.core.Core; import net.pterodactylus.sone.core.FreenetInterface; import net.pterodactylus.sone.freenet.PluginStoreConfigurationBackend; +import net.pterodactylus.sone.freenet.wot.PluginConnector; +import net.pterodactylus.sone.freenet.wot.WebOfTrustConnector; import net.pterodactylus.sone.web.WebInterface; import net.pterodactylus.util.config.Configuration; import net.pterodactylus.util.config.ConfigurationException; @@ -158,6 +160,10 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 /* create freenet interface. */ FreenetInterface freenetInterface = new FreenetInterface(pluginRespirator.getNode(), pluginRespirator.getHLSimpleClient()); + /* create web of trust connector. */ + PluginConnector pluginConnector = new PluginConnector(pluginRespirator); + WebOfTrustConnector webOfTrustConnector = new WebOfTrustConnector(pluginConnector); + /* create the web interface. */ webInterface = new WebInterface(this); @@ -165,6 +171,7 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 core = new Core(); core.configuration(configuration); core.freenetInterface(freenetInterface); + core.setWebOfTrustConnector(webOfTrustConnector); /* start core! */ boolean startupFailed = true; -- 2.7.4