org.gudy.azureus2.pluginsimpl.remote
Class RPPluginInterface

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.remote.RPObject
      extended by org.gudy.azureus2.pluginsimpl.remote.RPPluginInterface
All Implemented Interfaces:
Serializable, PluginInterface

public class RPPluginInterface
extends RPObject
implements PluginInterface

See Also:
Serialized Form

Field Summary
 long _connection_id
           
 String azureus_name
           
 String azureus_version
           
protected static long connection_id_next
           
protected  PluginInterface delegate
           
protected  long request_id_next
           
 
Fields inherited from class org.gudy.azureus2.pluginsimpl.remote.RPObject
__delegate, _dispatcher, _object_id, next_key, object_registry, object_registry_reverse
 
Constructor Summary
protected RPPluginInterface(PluginInterface _delegate)
           
 
Method Summary
protected  long _getConectionId()
           
protected  long _getNextRequestId()
           
 RPReply _process(RPRequest request)
           
protected  void _setDelegate(Object _delegate)
           
 Object _setLocal()
           
 void addConfigSection(ConfigSection tab)
          adds a ConfigSection to the config view.
 void addConfigUIParameters(Parameter[] parameters, String displayName)
          adds a tab under the 'plugins' tab in the config view.
Use PluginInterface.getPluginConfigUIFactory() to get the PluginConfigUIFactory class, from which you can create different types of parameters.
 void addEventListener(PluginEventListener l)
           
 void addListener(PluginListener l)
           
static RPPluginInterface create(PluginInterface _delegate)
           
 void firePluginEvent(PluginEvent event)
          Fire a plugin-specific event.
 String getApplicationName()
          Returns the name of the application that the user sees - if you need to display the name of the program, you should use this method.
 String getAzureusName()
          Retrieve the name of the application.
 String getAzureusVersion()
          Retrieve the Application's version as a string.
 ClientIDManager getClientIDManager()
           
 ConfigSection[] getConfigSections()
           
 ConnectionManager getConnectionManager()
          Get the connection manager.
 DistributedDatabase getDistributedDatabase()
          Get the distributed database
 DownloadManager getDownloadManager()
          Gives access to the download manager
 IPCInterface getIPC()
          get the inter-plugin-communcations interface for this plugin
 IPFilter getIPFilter()
          Gives access to the IP filter
 PluginInterface getLocalPluginInterface(Class plugin, String id)
          Returns an initialised plugin instance with its own scope (e.g.
 Logger getLogger()
          Gives access to the logger
 MainlineDHTManager getMainlineDHTManager()
          Returns the manager object for registering plugins that connect to the Mainline DHT.
 MessageManager getMessageManager()
          Get the peer messaging manager.
 String getPerUserPluginDirectoryName()
          gives access to the per-user plugin directory.
 PlatformManager getPlatformManager()
          Gets the platform manager that gives access to native functionality
 Plugin getPlugin()
          Gives access to the plugin itself
 ClassLoader getPluginClassLoader()
          gives access to the ClassLoader used to load the plugin
 PluginConfig getPluginconfig()
          gives access to the plugin config interface
 PluginConfigUIFactory getPluginConfigUIFactory()
          gives access to the plugin Config UI Factory
 String getPluginDirectoryName()
          Gives access to the plugin installation path - note, if you want to use this path to store data files in, it would be better for you to use PluginConfig.getPluginUserFile(String) instead.
 String getPluginID()
          Returns an identifier used to identify this particular plugin
 PluginManager getPluginManager()
          gives access to the plugin manager
 String getPluginName()
          Returns the value of "plugin.name" if it exists in the properties file, otherwise the directory name is returned.
 Properties getPluginProperties()
          gives access to the plugin properties
 PluginState getPluginState()
          Returns an object that provides information the current state of the plugin, and provides various mechanisms to query and control plugins and their integration with Azureus at a low-level.
 String getPluginVersion()
          Returns the version number of the plugin it if can be deduced from either the name of the jar file it is loaded from or the properties file.
 ShareManager getShareManager()
          Gives access to the sharing functionality
 ShortCuts getShortCuts()
          access to a set of convenience routines for doing things in a quicker, although less structured, fashion
 TorrentManager getTorrentManager()
          Gives access to the torrent manager
 Tracker getTracker()
          Gives access to the tracker functionality
 UIManager getUIManager()
          access to UI extension features
 UpdateManager getUpdateManager()
          access to the update manager used to update plugins.
 Utilities getUtilities()
          access to various utility functions
 boolean isBuiltIn()
          Built-in plugins are those used internally by Azureus, for example the UPnP plugin
 boolean isDisabled()
          Returns true if the plugin has been marked as disabled, and prevented from initialising.
 boolean isInitialisationThread()
          Indicates whether or not the current thread is the one responsible for running plugin initialisation
 boolean isMandatory()
          Whether or not this is a mandatory plugin.
 boolean isOperational()
          Returns true if the plugin is running, returns false if the plugin isn't running for some reason.
 boolean isShared()
           
 boolean isSigned()
           
 boolean isUnloadable()
           
 void openTorrentFile(String fileName)
          Deprecated.  
 void openTorrentURL(String url)
          Deprecated.  
 void reload()
           
 void removeConfigSection(ConfigSection tab)
           
 void removeEventListener(PluginEventListener l)
           
 void removeListener(PluginListener l)
           
 void setDisabled(boolean disabled)
          Sets whether the plugin can be loaded or not.
 void uninstall()
          Uninstall this plugin if it has been loaded from a plugin directory.
 void unload()
           
 
Methods inherited from class org.gudy.azureus2.pluginsimpl.remote.RPObject
_fixupLocal, _getDelegate, _getName, _getOID, _lookupLocal, _lookupLocal, _refresh, _setRemote, getDispatcher, notSupported, notSupported
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connection_id_next

protected static transient long connection_id_next

delegate

protected transient PluginInterface delegate

request_id_next

protected transient long request_id_next

azureus_name

public String azureus_name

azureus_version

public String azureus_version

_connection_id

public long _connection_id
Constructor Detail

RPPluginInterface

protected RPPluginInterface(PluginInterface _delegate)
Method Detail

create

public static RPPluginInterface create(PluginInterface _delegate)

_getConectionId

protected long _getConectionId()

_getNextRequestId

protected long _getNextRequestId()

_setDelegate

protected void _setDelegate(Object _delegate)
Overrides:
_setDelegate in class RPObject

_setLocal

public Object _setLocal()
                 throws RPException
Overrides:
_setLocal in class RPObject
Throws:
RPException

_process

public RPReply _process(RPRequest request)
Overrides:
_process in class RPObject

getPluginManager

public PluginManager getPluginManager()
Description copied from interface: PluginInterface
gives access to the plugin manager

Specified by:
getPluginManager in interface PluginInterface
Returns:

getPlugin

public Plugin getPlugin()
Description copied from interface: PluginInterface
Gives access to the plugin itself

Specified by:
getPlugin in interface PluginInterface
Returns:

getAzureusName

public String getAzureusName()
Description copied from interface: PluginInterface
Retrieve the name of the application.

Specified by:
getAzureusName in interface PluginInterface
Returns:
the Application's name

getAzureusVersion

public String getAzureusVersion()
Description copied from interface: PluginInterface
Retrieve the Application's version as a string.

Specified by:
getAzureusVersion in interface PluginInterface
Returns:
Application's version. Typically in the following formats (regexp):
[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+
[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+_CVS
[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+_B[0-9]+

getApplicationName

public String getApplicationName()
Description copied from interface: PluginInterface
Returns the name of the application that the user sees - if you need to display the name of the program, you should use this method.

Specified by:
getApplicationName in interface PluginInterface
Returns:
3.0.5.3

addConfigUIParameters

public void addConfigUIParameters(Parameter[] parameters,
                                  String displayName)
Description copied from interface: PluginInterface
adds a tab under the 'plugins' tab in the config view.
Use PluginInterface.getPluginConfigUIFactory() to get the PluginConfigUIFactory class, from which you can create different types of parameters.

Specified by:
addConfigUIParameters in interface PluginInterface
Parameters:
parameters - the Parameter(s) to be edited
displayName - the under which it should display.
Azureus will look-up for ConfigView.section.plugins.displayName; into the lang files in order to find the localized displayName. (see i18n)

addConfigSection

public void addConfigSection(ConfigSection tab)
Description copied from interface: PluginInterface
adds a ConfigSection to the config view.

In contrast to addConfigUIParameters, this gives you total control over a tab. Please be kind and use localizable text.

Specified by:
addConfigSection in interface PluginInterface
Parameters:
tab - ConfigSection to be added to the Config view

removeConfigSection

public void removeConfigSection(ConfigSection tab)
Specified by:
removeConfigSection in interface PluginInterface

getTracker

public Tracker getTracker()
Description copied from interface: PluginInterface
Gives access to the tracker functionality

Specified by:
getTracker in interface PluginInterface
Returns:
The tracker

getLogger

public Logger getLogger()
Description copied from interface: PluginInterface
Gives access to the logger

Specified by:
getLogger in interface PluginInterface
Returns:
The logger

getIPFilter

public IPFilter getIPFilter()
Description copied from interface: PluginInterface
Gives access to the IP filter

Specified by:
getIPFilter in interface PluginInterface
Returns:
An object that allows access to IP Filtering

getDownloadManager

public DownloadManager getDownloadManager()
Description copied from interface: PluginInterface
Gives access to the download manager

Specified by:
getDownloadManager in interface PluginInterface
Returns:
An object that allows management of downloads

getShareManager

public ShareManager getShareManager()
                             throws ShareException
Description copied from interface: PluginInterface
Gives access to the sharing functionality

Specified by:
getShareManager in interface PluginInterface
Returns:
Throws:
ShareException

getUtilities

public Utilities getUtilities()
Description copied from interface: PluginInterface
access to various utility functions

Specified by:
getUtilities in interface PluginInterface
Returns:

getShortCuts

public ShortCuts getShortCuts()
Description copied from interface: PluginInterface
access to a set of convenience routines for doing things in a quicker, although less structured, fashion

Specified by:
getShortCuts in interface PluginInterface
Returns:

getUIManager

public UIManager getUIManager()
Description copied from interface: PluginInterface
access to UI extension features

Specified by:
getUIManager in interface PluginInterface
Returns:

getTorrentManager

public TorrentManager getTorrentManager()
Description copied from interface: PluginInterface
Gives access to the torrent manager

Specified by:
getTorrentManager in interface PluginInterface
Returns:
An object to manage torrents

openTorrentFile

public void openTorrentFile(String fileName)
Deprecated. 

Description copied from interface: PluginInterface
opens a torrent file given its name

Specified by:
openTorrentFile in interface PluginInterface
Parameters:
fileName - The Name of the file that azureus must open

openTorrentURL

public void openTorrentURL(String url)
Deprecated. 

Description copied from interface: PluginInterface
opens a torrent file given the url it's at

Specified by:
openTorrentURL in interface PluginInterface
Parameters:
url - The String representation of the url pointing to a torrent file

getPluginProperties

public Properties getPluginProperties()
Description copied from interface: PluginInterface
gives access to the plugin properties

Specified by:
getPluginProperties in interface PluginInterface
Returns:
the properties from the file plugin.properties

getPluginDirectoryName

public String getPluginDirectoryName()
Description copied from interface: PluginInterface
Gives access to the plugin installation path - note, if you want to use this path to store data files in, it would be better for you to use PluginConfig.getPluginUserFile(String) instead.

Specified by:
getPluginDirectoryName in interface PluginInterface
Returns:
the full path the plugin is installed in

getPerUserPluginDirectoryName

public String getPerUserPluginDirectoryName()
Description copied from interface: PluginInterface
gives access to the per-user plugin directory. Useful for shared plugins that need to store per-user state. Will be same as getPluginDirectoryName for per-user installed plugins directory may not yet exist

Specified by:
getPerUserPluginDirectoryName in interface PluginInterface
Returns:

isShared

public boolean isShared()
Specified by:
isShared in interface PluginInterface

getPluginName

public String getPluginName()
Description copied from interface: PluginInterface
Returns the value of "plugin.name" if it exists in the properties file, otherwise the directory name is returned.

Specified by:
getPluginName in interface PluginInterface

getPluginID

public String getPluginID()
Description copied from interface: PluginInterface
Returns an identifier used to identify this particular plugin

Specified by:
getPluginID in interface PluginInterface
Returns:

isMandatory

public boolean isMandatory()
Description copied from interface: PluginInterface
Whether or not this is a mandatory plugin. Mandatory plugins take priority over update checks, for example, over optional ones.

Specified by:
isMandatory in interface PluginInterface

isBuiltIn

public boolean isBuiltIn()
Description copied from interface: PluginInterface
Built-in plugins are those used internally by Azureus, for example the UPnP plugin

Specified by:
isBuiltIn in interface PluginInterface

isSigned

public boolean isSigned()

isOperational

public boolean isOperational()
Description copied from interface: PluginInterface
Returns true if the plugin is running, returns false if the plugin isn't running for some reason.

Specified by:
isOperational in interface PluginInterface

setDisabled

public void setDisabled(boolean disabled)
Description copied from interface: PluginInterface
Sets whether the plugin can be loaded or not. If you are trying to affect if the plugin can be loaded at startup - use #setLoadedAtStartup(boolean) instead. This needs to be called prior to a plugin's initialisation to take effect.

Specified by:
setDisabled in interface PluginInterface

isDisabled

public boolean isDisabled()
Description copied from interface: PluginInterface
Returns true if the plugin has been marked as disabled, and prevented from initialising.

Specified by:
isDisabled in interface PluginInterface

getPluginVersion

public String getPluginVersion()
Description copied from interface: PluginInterface
Returns the version number of the plugin it if can be deduced from either the name of the jar file it is loaded from or the properties file. null otherwise

Specified by:
getPluginVersion in interface PluginInterface
Returns:
Version number as a string, or null

getPluginconfig

public PluginConfig getPluginconfig()
Description copied from interface: PluginInterface
gives access to the plugin config interface

Specified by:
getPluginconfig in interface PluginInterface
Returns:
the PluginConfig object associated with this plugin

getPluginConfigUIFactory

public PluginConfigUIFactory getPluginConfigUIFactory()
Description copied from interface: PluginInterface
gives access to the plugin Config UI Factory

Specified by:
getPluginConfigUIFactory in interface PluginInterface
Returns:
the PluginConfigUIFactory associated with this plugin

getPluginClassLoader

public ClassLoader getPluginClassLoader()
Description copied from interface: PluginInterface
gives access to the ClassLoader used to load the plugin

Specified by:
getPluginClassLoader in interface PluginInterface
Returns:

getLocalPluginInterface

public PluginInterface getLocalPluginInterface(Class plugin,
                                               String id)
Description copied from interface: PluginInterface
Returns an initialised plugin instance with its own scope (e.g. for config params). Designed for loading secondary plugins directly from a primary one. Note - ensure that the bundled secondary plugins do *not* contain a plugin.properties as this will cause no end of problems.

Specified by:
getLocalPluginInterface in interface PluginInterface
Parameters:
plugin - must implement Plugin
id - the unique id of this plugin (used to scope config params etc)
Returns:

getIPC

public IPCInterface getIPC()
Description copied from interface: PluginInterface
get the inter-plugin-communcations interface for this plugin

Specified by:
getIPC in interface PluginInterface
Returns:

getUpdateManager

public UpdateManager getUpdateManager()
Description copied from interface: PluginInterface
access to the update manager used to update plugins. required for non-Azureus SF hosted plugins (SF ones are managed automatically)

Specified by:
getUpdateManager in interface PluginInterface
Returns:

isUnloadable

public boolean isUnloadable()
Specified by:
isUnloadable in interface PluginInterface

unload

public void unload()
            throws PluginException
Specified by:
unload in interface PluginInterface
Throws:
PluginException

reload

public void reload()
            throws PluginException
Specified by:
reload in interface PluginInterface
Throws:
PluginException

uninstall

public void uninstall()
               throws PluginException
Description copied from interface: PluginInterface
Uninstall this plugin if it has been loaded from a plugin directory. Deletes the plugin directory

Specified by:
uninstall in interface PluginInterface
Throws:
PluginException

isInitialisationThread

public boolean isInitialisationThread()
Description copied from interface: PluginInterface
Indicates whether or not the current thread is the one responsible for running plugin initialisation

Specified by:
isInitialisationThread in interface PluginInterface
Returns:

getClientIDManager

public ClientIDManager getClientIDManager()
Specified by:
getClientIDManager in interface PluginInterface
Returns:

getConnectionManager

public ConnectionManager getConnectionManager()
Description copied from interface: PluginInterface
Get the connection manager.

Specified by:
getConnectionManager in interface PluginInterface
Returns:
manager

getMessageManager

public MessageManager getMessageManager()
Description copied from interface: PluginInterface
Get the peer messaging manager.

Specified by:
getMessageManager in interface PluginInterface
Returns:
manager

getDistributedDatabase

public DistributedDatabase getDistributedDatabase()
Description copied from interface: PluginInterface
Get the distributed database

Specified by:
getDistributedDatabase in interface PluginInterface
Returns:

getPlatformManager

public PlatformManager getPlatformManager()
Description copied from interface: PluginInterface
Gets the platform manager that gives access to native functionality

Specified by:
getPlatformManager in interface PluginInterface
Returns:

addListener

public void addListener(PluginListener l)
Specified by:
addListener in interface PluginInterface

removeListener

public void removeListener(PluginListener l)
Specified by:
removeListener in interface PluginInterface

firePluginEvent

public void firePluginEvent(PluginEvent event)
Description copied from interface: PluginInterface
Fire a plugin-specific event. See PluginEvent for details of type values to use

Specified by:
firePluginEvent in interface PluginInterface

addEventListener

public void addEventListener(PluginEventListener l)
Specified by:
addEventListener in interface PluginInterface

removeEventListener

public void removeEventListener(PluginEventListener l)
Specified by:
removeEventListener in interface PluginInterface

getConfigSections

public ConfigSection[] getConfigSections()
Specified by:
getConfigSections in interface PluginInterface
Returns:
List of ConfigSections for this plugin

getMainlineDHTManager

public MainlineDHTManager getMainlineDHTManager()
Description copied from interface: PluginInterface
Returns the manager object for registering plugins that connect to the Mainline DHT.

Specified by:
getMainlineDHTManager in interface PluginInterface

getPluginState

public PluginState getPluginState()
Description copied from interface: PluginInterface
Returns an object that provides information the current state of the plugin, and provides various mechanisms to query and control plugins and their integration with Azureus at a low-level.

Specified by:
getPluginState in interface PluginInterface