org.gudy.azureus2.ui.webplugin
Class WebPlugin

java.lang.Object
  extended by org.gudy.azureus2.ui.webplugin.WebPlugin
All Implemented Interfaces:
Plugin, TrackerWebPageGenerator
Direct Known Subclasses:
RSSGeneratorPlugin

public class WebPlugin
extends Object
implements Plugin, TrackerWebPageGenerator


Field Summary
static String CONFIG_ACCESS
           
 String CONFIG_ACCESS_DEFAULT
           
static String CONFIG_BIND_IP
           
 String CONFIG_BIND_IP_DEFAULT
           
static String CONFIG_ENABLE
           
 boolean CONFIG_ENABLE_DEFAULT
           
static String CONFIG_HOME_PAGE
           
 String CONFIG_HOME_PAGE_DEFAULT
           
static String CONFIG_MIGRATED
           
static String CONFIG_MODE
           
static String CONFIG_MODE_DEFAULT
           
static String CONFIG_MODE_FULL
           
static String CONFIG_PAIRING_AUTO_AUTH
           
static boolean CONFIG_PAIRING_AUTO_AUTH_DEFAULT
           
static String CONFIG_PAIRING_ENABLE
           
static boolean CONFIG_PAIRING_ENABLE_DEFAULT
           
static String CONFIG_PASSWORD
           
static byte[] CONFIG_PASSWORD_DEFAULT
           
static String CONFIG_PASSWORD_ENABLE
           
static boolean CONFIG_PASSWORD_ENABLE_DEFAULT
           
static String CONFIG_PORT
           
 int CONFIG_PORT_DEFAULT
           
static String CONFIG_PORT_OVERRIDE
           
static String CONFIG_PROTOCOL
           
static String CONFIG_PROTOCOL_DEFAULT
           
static String CONFIG_ROOT_DIR
           
 String CONFIG_ROOT_DIR_DEFAULT
           
static String CONFIG_ROOT_RESOURCE
           
 String CONFIG_ROOT_RESOURCE_DEFAULT
           
static String CONFIG_UPNP_ENABLE
           
 boolean CONFIG_UPNP_ENABLE_DEFAULT
           
static String CONFIG_USER
           
static String CONFIG_USER_DEFAULT
           
protected static String NL
           
static String PAIRING_MIGRATED
           
static String PAIRING_SESSION_KEY
           
protected  PluginInterface plugin_interface
           
static String PR_ACCESS
           
static String PR_BIND_IP
           
static String PR_CONFIG_MODEL
           
static String PR_CONFIG_MODEL_PARAMS
           
static String PR_DISABLABLE
           
static String PR_ENABLE
           
static String PR_ENABLE_I2P
           
static String PR_ENABLE_KEEP_ALIVE
           
static String PR_ENABLE_PAIRING
           
static String PR_ENABLE_TOR
           
static String PR_ENABLE_UPNP
           
static String PR_HIDE_RESOURCE_CONFIG
           
static String PR_HOME_PAGE
           
static String PR_LOG
           
static String PR_NON_BLOCKING
           
static String PR_PAIRING_SID
           
static String PR_PORT
           
static String PR_ROOT_DIR
           
static String PR_ROOT_RESOURCE
           
static String PR_VIEW_MODEL
           
static String PROPERTIES_MIGRATED
           
protected static File[] welcome_files
           
protected static String[] welcome_pages
           
 
Constructor Summary
WebPlugin()
           
WebPlugin(Properties defaults)
           
 
Method Summary
 boolean generate(TrackerWebPageRequest request, TrackerWebPageResponse response)
           
 boolean generateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response)
           
protected  BasicPluginConfigModel getConfigModel()
           
 int getPort()
           
 String getProtocol()
           
 InetAddress getServerBindIP()
           
 int getServerPort()
           
protected  BasicPluginViewModel getViewModel()
           
 void initialize(PluginInterface _plugin_interface)
          This method is called when the Plugin is loaded by Azureus
protected  void initStage(int num)
           
protected  boolean isPluginEnabled()
           
protected  void log(String str)
           
protected  void log(String str, Throwable e)
           
protected  void setupAutoAuth()
           
protected  void setupPairing(String sid, boolean pairing_enabled)
           
protected  void setupServer()
           
protected  void setupUPnP()
           
 void setUserAndPassword(String user, String password)
           
protected  void unloadPlugin()
           
 void unsetUserAndPassword()
           
protected  void updatePairing(PairingConnectionData cd)
           
protected  void updatePairing(String sid)
           
protected  boolean useFile(TrackerWebPageRequest request, TrackerWebPageResponse response, String root, String relative_url)
          this method can be over-ridden to handle custom file delivery
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PR_ENABLE

public static final String PR_ENABLE
See Also:
Constant Field Values

PR_DISABLABLE

public static final String PR_DISABLABLE
See Also:
Constant Field Values

PR_PORT

public static final String PR_PORT
See Also:
Constant Field Values

PR_BIND_IP

public static final String PR_BIND_IP
See Also:
Constant Field Values

PR_ROOT_RESOURCE

public static final String PR_ROOT_RESOURCE
See Also:
Constant Field Values

PR_HOME_PAGE

public static final String PR_HOME_PAGE
See Also:
Constant Field Values

PR_ROOT_DIR

public static final String PR_ROOT_DIR
See Also:
Constant Field Values

PR_ACCESS

public static final String PR_ACCESS
See Also:
Constant Field Values

PR_LOG

public static final String PR_LOG
See Also:
Constant Field Values

PR_CONFIG_MODEL_PARAMS

public static final String PR_CONFIG_MODEL_PARAMS
See Also:
Constant Field Values

PR_CONFIG_MODEL

public static final String PR_CONFIG_MODEL
See Also:
Constant Field Values

PR_VIEW_MODEL

public static final String PR_VIEW_MODEL
See Also:
Constant Field Values

PR_HIDE_RESOURCE_CONFIG

public static final String PR_HIDE_RESOURCE_CONFIG
See Also:
Constant Field Values

PR_ENABLE_KEEP_ALIVE

public static final String PR_ENABLE_KEEP_ALIVE
See Also:
Constant Field Values

PR_PAIRING_SID

public static final String PR_PAIRING_SID
See Also:
Constant Field Values

PR_NON_BLOCKING

public static final String PR_NON_BLOCKING
See Also:
Constant Field Values

PR_ENABLE_PAIRING

public static final String PR_ENABLE_PAIRING
See Also:
Constant Field Values

PR_ENABLE_I2P

public static final String PR_ENABLE_I2P
See Also:
Constant Field Values

PR_ENABLE_TOR

public static final String PR_ENABLE_TOR
See Also:
Constant Field Values

PR_ENABLE_UPNP

public static final String PR_ENABLE_UPNP
See Also:
Constant Field Values

PROPERTIES_MIGRATED

public static final String PROPERTIES_MIGRATED
See Also:
Constant Field Values

CONFIG_MIGRATED

public static final String CONFIG_MIGRATED
See Also:
Constant Field Values

PAIRING_MIGRATED

public static final String PAIRING_MIGRATED
See Also:
Constant Field Values

PAIRING_SESSION_KEY

public static final String PAIRING_SESSION_KEY
See Also:
Constant Field Values

CONFIG_PASSWORD_ENABLE

public static final String CONFIG_PASSWORD_ENABLE
See Also:
Constant Field Values

CONFIG_PASSWORD_ENABLE_DEFAULT

public static final boolean CONFIG_PASSWORD_ENABLE_DEFAULT
See Also:
Constant Field Values

CONFIG_PAIRING_ENABLE

public static final String CONFIG_PAIRING_ENABLE
See Also:
Constant Field Values

CONFIG_PAIRING_ENABLE_DEFAULT

public static final boolean CONFIG_PAIRING_ENABLE_DEFAULT
See Also:
Constant Field Values

CONFIG_PORT_OVERRIDE

public static final String CONFIG_PORT_OVERRIDE
See Also:
Constant Field Values

CONFIG_PAIRING_AUTO_AUTH

public static final String CONFIG_PAIRING_AUTO_AUTH
See Also:
Constant Field Values

CONFIG_PAIRING_AUTO_AUTH_DEFAULT

public static final boolean CONFIG_PAIRING_AUTO_AUTH_DEFAULT
See Also:
Constant Field Values

CONFIG_ENABLE

public static final String CONFIG_ENABLE
See Also:
Constant Field Values

CONFIG_ENABLE_DEFAULT

public boolean CONFIG_ENABLE_DEFAULT

CONFIG_USER

public static final String CONFIG_USER
See Also:
Constant Field Values

CONFIG_USER_DEFAULT

public static final String CONFIG_USER_DEFAULT
See Also:
Constant Field Values

CONFIG_PASSWORD

public static final String CONFIG_PASSWORD
See Also:
Constant Field Values

CONFIG_PASSWORD_DEFAULT

public static final byte[] CONFIG_PASSWORD_DEFAULT

CONFIG_PORT

public static final String CONFIG_PORT
See Also:
Constant Field Values

CONFIG_PORT_DEFAULT

public int CONFIG_PORT_DEFAULT

CONFIG_BIND_IP

public static final String CONFIG_BIND_IP
See Also:
Constant Field Values

CONFIG_BIND_IP_DEFAULT

public String CONFIG_BIND_IP_DEFAULT

CONFIG_PROTOCOL

public static final String CONFIG_PROTOCOL
See Also:
Constant Field Values

CONFIG_PROTOCOL_DEFAULT

public static final String CONFIG_PROTOCOL_DEFAULT
See Also:
Constant Field Values

CONFIG_UPNP_ENABLE

public static final String CONFIG_UPNP_ENABLE
See Also:
Constant Field Values

CONFIG_UPNP_ENABLE_DEFAULT

public boolean CONFIG_UPNP_ENABLE_DEFAULT

CONFIG_HOME_PAGE

public static final String CONFIG_HOME_PAGE
See Also:
Constant Field Values

CONFIG_HOME_PAGE_DEFAULT

public String CONFIG_HOME_PAGE_DEFAULT

CONFIG_ROOT_DIR

public static final String CONFIG_ROOT_DIR
See Also:
Constant Field Values

CONFIG_ROOT_DIR_DEFAULT

public String CONFIG_ROOT_DIR_DEFAULT

CONFIG_ROOT_RESOURCE

public static final String CONFIG_ROOT_RESOURCE
See Also:
Constant Field Values

CONFIG_ROOT_RESOURCE_DEFAULT

public String CONFIG_ROOT_RESOURCE_DEFAULT

CONFIG_MODE

public static final String CONFIG_MODE
See Also:
Constant Field Values

CONFIG_MODE_FULL

public static final String CONFIG_MODE_FULL
See Also:
Constant Field Values

CONFIG_MODE_DEFAULT

public static final String CONFIG_MODE_DEFAULT
See Also:
Constant Field Values

CONFIG_ACCESS

public static final String CONFIG_ACCESS
See Also:
Constant Field Values

CONFIG_ACCESS_DEFAULT

public String CONFIG_ACCESS_DEFAULT

NL

protected static final String NL
See Also:
Constant Field Values

welcome_pages

protected static final String[] welcome_pages

welcome_files

protected static File[] welcome_files

plugin_interface

protected PluginInterface plugin_interface
Constructor Detail

WebPlugin

public WebPlugin()

WebPlugin

public WebPlugin(Properties defaults)
Method Detail

initialize

public void initialize(PluginInterface _plugin_interface)
                throws PluginException
Description copied from interface: Plugin
This method is called when the Plugin is loaded by Azureus

Specified by:
initialize in interface Plugin
Parameters:
_plugin_interface - the interface that the plugin must use to communicate with Azureus
Throws:
PluginException

initStage

protected void initStage(int num)

isPluginEnabled

protected boolean isPluginEnabled()

unloadPlugin

protected void unloadPlugin()

setupServer

protected void setupServer()

setupUPnP

protected void setupUPnP()

setupPairing

protected void setupPairing(String sid,
                            boolean pairing_enabled)

setupAutoAuth

protected void setupAutoAuth()

updatePairing

protected void updatePairing(String sid)

updatePairing

protected void updatePairing(PairingConnectionData cd)

getServerBindIP

public InetAddress getServerBindIP()

getServerPort

public int getServerPort()

getPort

public int getPort()

getProtocol

public String getProtocol()

setUserAndPassword

public void setUserAndPassword(String user,
                               String password)

unsetUserAndPassword

public void unsetUserAndPassword()

generateSupport

public boolean generateSupport(TrackerWebPageRequest request,
                               TrackerWebPageResponse response)
                        throws IOException
Throws:
IOException

generate

public boolean generate(TrackerWebPageRequest request,
                        TrackerWebPageResponse response)
                 throws IOException
Specified by:
generate in interface TrackerWebPageGenerator
Returns:
true if the request was handled
Throws:
IOException

useFile

protected boolean useFile(TrackerWebPageRequest request,
                          TrackerWebPageResponse response,
                          String root,
                          String relative_url)
                   throws IOException
this method can be over-ridden to handle custom file delivery

Parameters:
request -
response -
root -
relative_url -
Returns:
Throws:
IOException

getConfigModel

protected BasicPluginConfigModel getConfigModel()

getViewModel

protected BasicPluginViewModel getViewModel()

log

protected void log(String str)

log

protected void log(String str,
                   Throwable e)