FreenetWiki : FreenetPluginInterface

HomePage :: Categories :: PageIndex :: RecentChanges :: RecentlyCommented :: Login/Register
Most recent edit on 2007-03-06 17:39:56 by EthicalAnarhist [see also]

Additions:
(coming soon)

See also

* HelloWorldPlugin


Deletions:
How the fuck do you do this?????



Edited on 2007-03-02 19:16:19 by EthicalAnarhist [some more imports]

Additions:
import freenet.client.FetchException;
import freenet.client.FetchResult;
import freenet.client.HighLevelSimpleClient;




Edited on 2007-03-02 10:48:50 by EthicalAnarhist [some edits]

Additions:
List of good imports:
import freenet.pluginmanager.FredPlugin;
import freenet.pluginmanager.FredPluginHTTP;
import freenet.pluginmanager.FredPluginThreadless;

Your class must implement the following:
public class MyPlugin implements FredPlugin, FredPluginHTTP, FredPluginThreadless

public void runPlugin(PluginRespirator pr) // Make sure to save that pr somewhere, it will be the starting point in interfacing with the node
public void terminate()
public String handleHTTPGet(HTTPRequest request) throws PluginHTTPException // It is ok to return null
public String handleHTTPPost(HTTPRequest request) throws PluginHTTPException // It is ok to return null
public String handleHTTPPut(HTTPRequest request) throws PluginHTTPException // It is ok to return null

# Create an instance of HighLevelSimpleClient from PluginRespirator
HighLevelSimpleClient hlsc = pr.getHLSimpleClient();

Watch for the FetchException from that function, it can mean that the redirect was encountered, simple test
if(e.newURI != null)
will tell you if the Exception is an actual error


Deletions:
Your class must extend the following:
* FredPlugin
* FredPluginHTTP
* FredPluginThreadless (i don't know what it is, but i'm using it and it works)
* public void runPlugin(PluginRespirator pr) Make sure to save that pr somewhere, it will be the starting point in interfacing with the node
* public void terminate()
* public String handleHTTPGet(HTTPRequest request) throws PluginHTTPException
It is ok to return null
* public String handleHTTPPost(HTTPRequest request) throws PluginHTTPException It is ok to return null
* public String handleHTTPPut(HTTPRequest request) throws PluginHTTPException
It is ok to return null
# Create an instance of HighLevelSimpleClient from PluginRespirator <code>HighLevelSimpleClient hlsc = pr.getHLSimpleClient();</code>
Watch for the FetchException from that function, it can mean that the redirect was encountered, simple test <code>if(e.newURI != null)</code> will tell you if the Exception is an actual error




Oldest known version of this page was edited on 2007-03-01 22:43:21 by EthicalAnarhist [Work in progress, i think it will be useful to others]
Page view:
Work in progress please help to update

Starting

Your class must extend the following:
* FredPlugin
* FredPluginHTTP
* FredPluginThreadless (i don't know what it is, but i'm using it and it works)

You will have to have the folliwing functions:
* public void runPlugin(PluginRespirator pr) Make sure to save that pr somewhere, it will be the starting point in interfacing with the node
* public void terminate()
* public String handleHTTPGet(HTTPRequest request) throws PluginHTTPException
It is ok to return null
* public String handleHTTPPost(HTTPRequest request) throws PluginHTTPException It is ok to return null
* public String handleHTTPPut(HTTPRequest request) throws PluginHTTPException
It is ok to return null

Fetcing

You must
# Create an instance of HighLevelSimpleClient from PluginRespirator <code>HighLevelSimpleClient hlsc = pr.getHLSimpleClient();</code>
# Create an instance of FetchResult
# use hlsc.fetch(new FreenetURI("CHK@...")) to return you your FetchResult
Watch for the FetchException from that function, it can mean that the redirect was encountered, simple test <code>if(e.newURI != null)</code> will tell you if the Exception is an actual error
: See also: freenet.pluginmanager.TestPlugin

Inserting

How the fuck do you do this?????
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by Wikka Wakka Wiki 1.1.6.2
Page was generated in 0.0619 seconds