From: David ‘Bombe’ Roden Date: Fri, 8 Apr 2011 12:56:03 +0000 (+0200) Subject: Add FCP interface to plugin, let it handle all FCP requests. X-Git-Tag: 0.6.5^2~39^2~48 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=adc56c274bd0f8a26c64d0a134f48d1dc34fbdae;p=Sone.git Add FCP interface to plugin, let it handle all FCP requests. --- diff --git a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java index 3b6824b..05b8403 100644 --- a/src/main/java/net/pterodactylus/sone/main/SonePlugin.java +++ b/src/main/java/net/pterodactylus/sone/main/SonePlugin.java @@ -25,6 +25,7 @@ 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.fcp.FcpInterface; import net.pterodactylus.sone.freenet.plugin.PluginConnector; import net.pterodactylus.sone.freenet.wot.IdentityManager; import net.pterodactylus.sone.freenet.wot.WebOfTrustConnector; @@ -40,10 +41,14 @@ import freenet.l10n.BaseL10n.LANGUAGE; import freenet.l10n.PluginL10n; import freenet.pluginmanager.FredPlugin; import freenet.pluginmanager.FredPluginBaseL10n; +import freenet.pluginmanager.FredPluginFCP; import freenet.pluginmanager.FredPluginL10n; import freenet.pluginmanager.FredPluginThreadless; import freenet.pluginmanager.FredPluginVersioned; +import freenet.pluginmanager.PluginReplySender; import freenet.pluginmanager.PluginRespirator; +import freenet.support.SimpleFieldSet; +import freenet.support.api.Bucket; /** * This class interfaces with Freenet. It is the class that is loaded by the @@ -51,7 +56,7 @@ import freenet.pluginmanager.PluginRespirator; * * @author David ‘Bombe’ Roden */ -public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10n, FredPluginThreadless, FredPluginVersioned { +public class SonePlugin implements FredPlugin, FredPluginFCP, FredPluginL10n, FredPluginBaseL10n, FredPluginThreadless, FredPluginVersioned { static { /* initialize logging. */ @@ -92,6 +97,9 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 /** The web interface. */ private WebInterface webInterface; + /** The FCP interface. */ + private FcpInterface fcpInterface; + /** The l10n helper. */ private PluginL10n l10n; @@ -184,6 +192,9 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 webInterface = new WebInterface(this); core.addCoreListener(webInterface); + /* create FCP interface. */ + fcpInterface = new FcpInterface(core); + /* create the identity manager. */ identityManager.addIdentityListener(core); @@ -233,6 +244,18 @@ public class SonePlugin implements FredPlugin, FredPluginL10n, FredPluginBaseL10 } // + // INTERFACE FredPluginFCP + // + + /** + * {@inheritDoc} + */ + @Override + public void handle(PluginReplySender pluginReplySender, SimpleFieldSet parameters, Bucket data, int accessType) { + fcpInterface.handle(pluginReplySender, parameters, data, accessType); + } + + // // INTERFACE FredPluginL10n //