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 java.lang.Object
implements Plugin, TrackerWebPageGenerator


Field Summary
static java.lang.String CONFIG_ACCESS
           
 java.lang.String CONFIG_ACCESS_DEFAULT
           
static java.lang.String CONFIG_BIND_IP
           
 java.lang.String CONFIG_BIND_IP_DEFAULT
           
static java.lang.String CONFIG_ENABLE
           
 boolean CONFIG_ENABLE_DEFAULT
           
static java.lang.String CONFIG_HOME_PAGE
           
 java.lang.String CONFIG_HOME_PAGE_DEFAULT
           
static java.lang.String CONFIG_MIGRATED
           
static java.lang.String CONFIG_MODE
           
static java.lang.String CONFIG_MODE_DEFAULT
           
static java.lang.String CONFIG_MODE_FULL
           
static java.lang.String CONFIG_PAIRING_AUTO_AUTH
           
static boolean CONFIG_PAIRING_AUTO_AUTH_DEFAULT
           
static java.lang.String CONFIG_PAIRING_ENABLE
           
static boolean CONFIG_PAIRING_ENABLE_DEFAULT
           
static java.lang.String CONFIG_PASSWORD
           
static byte[] CONFIG_PASSWORD_DEFAULT
           
static java.lang.String CONFIG_PASSWORD_ENABLE
           
static boolean CONFIG_PASSWORD_ENABLE_DEFAULT
           
static java.lang.String CONFIG_PORT
           
 int CONFIG_PORT_DEFAULT
           
static java.lang.String CONFIG_PORT_OVERRIDE
           
static java.lang.String CONFIG_PROTOCOL
           
static java.lang.String CONFIG_PROTOCOL_DEFAULT
           
static java.lang.String CONFIG_ROOT_DIR
           
 java.lang.String CONFIG_ROOT_DIR_DEFAULT
           
static java.lang.String CONFIG_ROOT_RESOURCE
           
 java.lang.String CONFIG_ROOT_RESOURCE_DEFAULT
           
static java.lang.String CONFIG_UPNP_ENABLE
           
 boolean CONFIG_UPNP_ENABLE_DEFAULT
           
static java.lang.String CONFIG_USER
           
static java.lang.String CONFIG_USER_DEFAULT
           
protected static java.lang.String NL
           
static java.lang.String PAIRING_MIGRATED
           
static java.lang.String PAIRING_SESSION_KEY
           
protected  PluginInterface plugin_interface
           
static java.lang.String PR_ACCESS
           
static java.lang.String PR_BIND_IP
           
static java.lang.String PR_CONFIG_MODEL
           
static java.lang.String PR_CONFIG_MODEL_PARAMS
           
static java.lang.String PR_DISABLABLE
           
static java.lang.String PR_ENABLE
           
static java.lang.String PR_ENABLE_I2P
           
static java.lang.String PR_ENABLE_KEEP_ALIVE
           
static java.lang.String PR_ENABLE_PAIRING
           
static java.lang.String PR_ENABLE_TOR
           
static java.lang.String PR_ENABLE_UPNP
           
static java.lang.String PR_HIDE_RESOURCE_CONFIG
           
static java.lang.String PR_HOME_PAGE
           
static java.lang.String PR_LOG
           
static java.lang.String PR_NON_BLOCKING
           
static java.lang.String PR_PAIRING_SID
           
static java.lang.String PR_PORT
           
static java.lang.String PR_ROOT_DIR
           
static java.lang.String PR_ROOT_RESOURCE
           
static java.lang.String PR_VIEW_MODEL
           
static java.lang.String PROPERTIES_MIGRATED
           
protected static java.io.File[] welcome_files
           
protected static java.lang.String[] welcome_pages
           
 
Constructor Summary
WebPlugin()
           
WebPlugin(java.util.Properties defaults)
           
 
Method Summary
 boolean generate(TrackerWebPageRequest request, TrackerWebPageResponse response)
           
 boolean generateSupport(TrackerWebPageRequest request, TrackerWebPageResponse response)
           
protected  BasicPluginConfigModel getConfigModel()
           
 int getPort()
           
 java.lang.String getProtocol()
           
 java.net.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(java.lang.String str)
           
protected  void log(java.lang.String str, java.lang.Throwable e)
           
protected  void setupAutoAuth()
           
protected  void setupPairing(java.lang.String sid, boolean pairing_enabled)
           
protected  void setupServer()
           
protected  void setupUPnP()
           
 void setUserAndPassword(java.lang.String user, java.lang.String password)
           
protected  void unloadPlugin()
           
 void unsetUserAndPassword()
           
protected  void updatePairing(PairingConnectionData cd)
           
protected  void updatePairing(java.lang.String sid)
           
protected  boolean useFile(TrackerWebPageRequest request, TrackerWebPageResponse response, java.lang.String root, java.lang.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 java.lang.String PR_ENABLE
See Also:
Constant Field Values

PR_DISABLABLE

public static final java.lang.String PR_DISABLABLE
See Also:
Constant Field Values

PR_PORT

public static final java.lang.String PR_PORT
See Also:
Constant Field Values

PR_BIND_IP

public static final java.lang.String PR_BIND_IP
See Also:
Constant Field Values

PR_ROOT_RESOURCE

public static final java.lang.String PR_ROOT_RESOURCE
See Also:
Constant Field Values

PR_HOME_PAGE

public static final java.lang.String PR_HOME_PAGE
See Also:
Constant Field Values

PR_ROOT_DIR

public static final java.lang.String PR_ROOT_DIR
See Also:
Constant Field Values

PR_ACCESS

public static final java.lang.String PR_ACCESS
See Also:
Constant Field Values

PR_LOG

public static final java.lang.String PR_LOG
See Also:
Constant Field Values

PR_CONFIG_MODEL_PARAMS

public static final java.lang.String PR_CONFIG_MODEL_PARAMS
See Also:
Constant Field Values

PR_CONFIG_MODEL

public static final java.lang.String PR_CONFIG_MODEL
See Also:
Constant Field Values

PR_VIEW_MODEL

public static final java.lang.String PR_VIEW_MODEL
See Also:
Constant Field Values

PR_HIDE_RESOURCE_CONFIG

public static final java.lang.String PR_HIDE_RESOURCE_CONFIG
See Also:
Constant Field Values

PR_ENABLE_KEEP_ALIVE

public static final java.lang.String PR_ENABLE_KEEP_ALIVE
See Also:
Constant Field Values

PR_PAIRING_SID

public static final java.lang.String PR_PAIRING_SID
See Also:
Constant Field Values

PR_NON_BLOCKING

public static final java.lang.String PR_NON_BLOCKING
See Also:
Constant Field Values

PR_ENABLE_PAIRING

public static final java.lang.String PR_ENABLE_PAIRING
See Also:
Constant Field Values

PR_ENABLE_I2P

public static final java.lang.String PR_ENABLE_I2P
See Also:
Constant Field Values

PR_ENABLE_TOR

public static final java.lang.String PR_ENABLE_TOR
See Also:
Constant Field Values

PR_ENABLE_UPNP

public static final java.lang.String PR_ENABLE_UPNP
See Also:
Constant Field Values

PROPERTIES_MIGRATED

public static final java.lang.String PROPERTIES_MIGRATED
See Also:
Constant Field Values

CONFIG_MIGRATED

public static final java.lang.String CONFIG_MIGRATED
See Also:
Constant Field Values

PAIRING_MIGRATED

public static final java.lang.String PAIRING_MIGRATED
See Also:
Constant Field Values

PAIRING_SESSION_KEY

public static final java.lang.String PAIRING_SESSION_KEY
See Also:
Constant Field Values

CONFIG_PASSWORD_ENABLE

public static final java.lang.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 java.lang.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 java.lang.String CONFIG_PORT_OVERRIDE
See Also:
Constant Field Values

CONFIG_PAIRING_AUTO_AUTH

public static final java.lang.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 java.lang.String CONFIG_ENABLE
See Also:
Constant Field Values

CONFIG_ENABLE_DEFAULT

public boolean CONFIG_ENABLE_DEFAULT

CONFIG_USER

public static final java.lang.String CONFIG_USER
See Also:
Constant Field Values

CONFIG_USER_DEFAULT

public static final java.lang.String CONFIG_USER_DEFAULT
See Also:
Constant Field Values

CONFIG_PASSWORD

public static final java.lang.String CONFIG_PASSWORD
See Also:
Constant Field Values

CONFIG_PASSWORD_DEFAULT

public static final byte[] CONFIG_PASSWORD_DEFAULT

CONFIG_PORT

public static final java.lang.String CONFIG_PORT
See Also:
Constant Field Values

CONFIG_PORT_DEFAULT

public int CONFIG_PORT_DEFAULT

CONFIG_BIND_IP

public static final java.lang.String CONFIG_BIND_IP
See Also:
Constant Field Values

CONFIG_BIND_IP_DEFAULT

public java.lang.String CONFIG_BIND_IP_DEFAULT

CONFIG_PROTOCOL

public static final java.lang.String CONFIG_PROTOCOL
See Also:
Constant Field Values

CONFIG_PROTOCOL_DEFAULT

public static final java.lang.String CONFIG_PROTOCOL_DEFAULT
See Also:
Constant Field Values

CONFIG_UPNP_ENABLE

public static final java.lang.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 java.lang.String CONFIG_HOME_PAGE
See Also:
Constant Field Values

CONFIG_HOME_PAGE_DEFAULT

public java.lang.String CONFIG_HOME_PAGE_DEFAULT

CONFIG_ROOT_DIR

public static final java.lang.String CONFIG_ROOT_DIR
See Also:
Constant Field Values

CONFIG_ROOT_DIR_DEFAULT

public java.lang.String CONFIG_ROOT_DIR_DEFAULT

CONFIG_ROOT_RESOURCE

public static final java.lang.String CONFIG_ROOT_RESOURCE
See Also:
Constant Field Values

CONFIG_ROOT_RESOURCE_DEFAULT

public java.lang.String CONFIG_ROOT_RESOURCE_DEFAULT

CONFIG_MODE

public static final java.lang.String CONFIG_MODE
See Also:
Constant Field Values

CONFIG_MODE_FULL

public static final java.lang.String CONFIG_MODE_FULL
See Also:
Constant Field Values

CONFIG_MODE_DEFAULT

public static final java.lang.String CONFIG_MODE_DEFAULT
See Also:
Constant Field Values

CONFIG_ACCESS

public static final java.lang.String CONFIG_ACCESS
See Also:
Constant Field Values

CONFIG_ACCESS_DEFAULT

public java.lang.String CONFIG_ACCESS_DEFAULT

NL

protected static final java.lang.String NL
See Also:
Constant Field Values

welcome_pages

protected static final java.lang.String[] welcome_pages

welcome_files

protected static java.io.File[] welcome_files

plugin_interface

protected PluginInterface plugin_interface
Constructor Detail

WebPlugin

public WebPlugin()

WebPlugin

public WebPlugin(java.util.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(java.lang.String sid,
                            boolean pairing_enabled)

setupAutoAuth

protected void setupAutoAuth()

updatePairing

protected void updatePairing(java.lang.String sid)

updatePairing

protected void updatePairing(PairingConnectionData cd)

getServerBindIP

public java.net.InetAddress getServerBindIP()

getServerPort

public int getServerPort()

getPort

public int getPort()

getProtocol

public java.lang.String getProtocol()

setUserAndPassword

public void setUserAndPassword(java.lang.String user,
                               java.lang.String password)

unsetUserAndPassword

public void unsetUserAndPassword()

generateSupport

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

generate

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

useFile

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

Parameters:
request -
response -
root -
relative_url -
Returns:
Throws:
java.io.IOException

getConfigModel

protected BasicPluginConfigModel getConfigModel()

getViewModel

protected BasicPluginViewModel getViewModel()

log

protected void log(java.lang.String str)

log

protected void log(java.lang.String str,
                   java.lang.Throwable e)