org.gudy.azureus2.plugins
Interface PluginInterface

All Known Implementing Classes:
PluginInterfaceImpl, RPPluginInterface

public interface PluginInterface

Defines the communication interface between Azureus and Plugins

Author:
Olivier

Method Summary
 void addConfigSection(ConfigSection section)
          Deprecated. Use UIManager.createBasicPluginConfigModel(String) instead.
 void addConfigUIParameters(Parameter[] parameters, String displayName)
          Deprecated. Use of this is discouraged - use UIManager#getBasicPluginViewModel(String) to get a BasicPluginViewModel instance, and then use the methods on that to add parameters.
 void addEventListener(PluginEventListener l)
           
 void addListener(PluginListener l)
           
 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()
          Deprecated. Use of this is discouraged - use UIManager#getBasicPluginViewModel(String) to get a BasicPluginViewModel instance, and then use the methods on that to add parameters.
 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()
          Deprecated. Use PluginState.isBuiltIn().
 boolean isDisabled()
          Deprecated. Use PluginState.isDisabled().
 boolean isInitialisationThread()
          Indicates whether or not the current thread is the one responsible for running plugin initialisation
 boolean isMandatory()
          Deprecated. Use PluginState.isMandatory().
 boolean isOperational()
          Deprecated. Use PluginState.isOperational().
 boolean isShared()
          Deprecated. Use PluginState.isShared().
 boolean isUnloadable()
          Deprecated. Use PluginState.isUnloadable().
 void openTorrentFile(String fileName)
          Deprecated. Use DownloadManager.addDownload(java.io.File)
 void openTorrentURL(String url)
          Deprecated. Use DownloadManager.addDownload(java.io.File)
 void reload()
          Deprecated. Use PluginState.reload().
 void removeConfigSection(ConfigSection section)
           
 void removeEventListener(PluginEventListener l)
           
 void removeListener(PluginListener l)
           
 void setDisabled(boolean disabled)
          Deprecated. Use PluginState.setDisabled(boolean).
 void uninstall()
          Deprecated. Use PluginState.uninstall().
 void unload()
          Deprecated. Use PluginState.unload().
 

Method Detail

getAzureusName

String getAzureusName()
Retrieve the name of the application.

Returns:
the Application's name
Since:
2.1.0.0

getApplicationName

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.

Returns:
3.0.5.3

getAzureusVersion

String getAzureusVersion()
Retrieve the Application's version as a string.

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]+
Since:
2.1.0.0

addConfigUIParameters

void addConfigUIParameters(Parameter[] parameters,
                           String displayName)
Deprecated. Use of this is discouraged - use UIManager#getBasicPluginViewModel(String) to get a BasicPluginViewModel instance, and then use the methods on that to add parameters.

adds a tab under the 'plugins' tab in the config view.
Use getPluginConfigUIFactory() to get the PluginConfigUIFactory class, from which you can create different types of parameters.

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)
Since:
2.0.6.0

addConfigSection

void addConfigSection(ConfigSection section)
Deprecated. Use UIManager.createBasicPluginConfigModel(String) instead.

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.

Parameters:
section - ConfigSection to be added to the Config view
Since:
2.0.8.0

removeConfigSection

void removeConfigSection(ConfigSection section)
Parameters:
section -
Since:
2.3.0.5

getConfigSections

ConfigSection[] getConfigSections()
Returns:
List of ConfigSections for this plugin
Since:
2.5.0.1

getTracker

Tracker getTracker()
Gives access to the tracker functionality

Returns:
The tracker
Since:
2.0.6.0

getLogger

Logger getLogger()
Gives access to the logger

Returns:
The logger
Since:
2.0.7.0

getIPFilter

IPFilter getIPFilter()
Gives access to the IP filter

Returns:
An object that allows access to IP Filtering
Since:
2.0.8.0

getDownloadManager

DownloadManager getDownloadManager()
Gives access to the download manager

Returns:
An object that allows management of downloads
Since:
2.0.7.0

getShareManager

ShareManager getShareManager()
                             throws ShareException
Gives access to the sharing functionality

Returns:
Throws:
ShareException
Since:
2.0.7.0

getTorrentManager

TorrentManager getTorrentManager()
Gives access to the torrent manager

Returns:
An object to manage torrents
Since:
2.0.8.0

getUtilities

Utilities getUtilities()
access to various utility functions

Returns:
Since:
2.1.0.0

getShortCuts

ShortCuts getShortCuts()
access to a set of convenience routines for doing things in a quicker, although less structured, fashion

Returns:
Since:
2.1.0.0

getUIManager

UIManager getUIManager()
access to UI extension features

Returns:
Since:
2.1.0.0

getUpdateManager

UpdateManager getUpdateManager()
access to the update manager used to update plugins. required for non-Azureus SF hosted plugins (SF ones are managed automatically)

Returns:
Since:
2.1.0.0

openTorrentFile

void openTorrentFile(String fileName)
Deprecated. Use DownloadManager.addDownload(java.io.File)

opens a torrent file given its name

Parameters:
fileName - The Name of the file that azureus must open
Since:
2.0.4.0

openTorrentURL

void openTorrentURL(String url)
Deprecated. Use DownloadManager.addDownload(java.io.File)

opens a torrent file given the url it's at

Parameters:
url - The String representation of the url pointing to a torrent file
Since:
2.0.4.0

getPluginProperties

Properties getPluginProperties()
gives access to the plugin properties

Returns:
the properties from the file plugin.properties
Since:
2.0.4.0

getPluginDirectoryName

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.

Returns:
the full path the plugin is installed in
Since:
2.0.4.0

getPerUserPluginDirectoryName

String getPerUserPluginDirectoryName()
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

Returns:

getPluginName

String getPluginName()
Returns the value of "plugin.name" if it exists in the properties file, otherwise the directory name is returned.

Since:
2.1.0.0

getPluginVersion

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. null otherwise

Returns:
Version number as a string, or null
Since:
2.1.0.0

getPluginID

String getPluginID()
Returns an identifier used to identify this particular plugin

Returns:
Since:
2.1.0.0

isMandatory

boolean isMandatory()
Deprecated. Use PluginState.isMandatory().

Whether or not this is a mandatory plugin. Mandatory plugins take priority over update checks, for example, over optional ones.


isBuiltIn

boolean isBuiltIn()
Deprecated. Use PluginState.isBuiltIn().

Built-in plugins are those used internally by Azureus, for example the UPnP plugin


getPluginconfig

PluginConfig getPluginconfig()
gives access to the plugin config interface

Returns:
the PluginConfig object associated with this plugin

getPluginConfigUIFactory

PluginConfigUIFactory getPluginConfigUIFactory()
Deprecated. Use of this is discouraged - use UIManager#getBasicPluginViewModel(String) to get a BasicPluginViewModel instance, and then use the methods on that to add parameters.

gives access to the plugin Config UI Factory

Returns:
the PluginConfigUIFactory associated with this plugin

getPluginClassLoader

ClassLoader getPluginClassLoader()
gives access to the ClassLoader used to load the plugin

Returns:
Since:
2.0.8.0

getLocalPluginInterface

PluginInterface getLocalPluginInterface(Class plugin,
                                        String id)
                                        throws PluginException
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.

Parameters:
plugin - must implement Plugin
id - the unique id of this plugin (used to scope config params etc)
Returns:
Throws:
PluginException

getIPC

IPCInterface getIPC()
get the inter-plugin-communcations interface for this plugin

Returns:

getPlugin

Plugin getPlugin()
Gives access to the plugin itself

Returns:
Since:
2.1.0.0

isOperational

boolean isOperational()
Deprecated. Use PluginState.isOperational().

Returns true if the plugin is running, returns false if the plugin isn't running for some reason.

Since:
2.1.0.0

isDisabled

boolean isDisabled()
Deprecated. Use PluginState.isDisabled().

Returns true if the plugin has been marked as disabled, and prevented from initialising.


setDisabled

void setDisabled(boolean disabled)
Deprecated. Use PluginState.setDisabled(boolean).

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.

Parameters:
disabled -
Since:
2.3.0.1

isUnloadable

boolean isUnloadable()
Deprecated. Use PluginState.isUnloadable().

Since:
2.1.0.0

isShared

boolean isShared()
Deprecated. Use PluginState.isShared().

Since:
2503/3005

unload

void unload()
            throws PluginException
Deprecated. Use PluginState.unload().

Throws:
PluginException
Since:
2.1.0.0

reload

void reload()
            throws PluginException
Deprecated. Use PluginState.reload().

Throws:
PluginException
Since:
2.1.0.0

uninstall

void uninstall()
               throws PluginException
Deprecated. Use PluginState.uninstall().

Uninstall this plugin if it has been loaded from a plugin directory. Deletes the plugin directory

Throws:
PluginException

isInitialisationThread

boolean isInitialisationThread()
Indicates whether or not the current thread is the one responsible for running plugin initialisation

Returns:

getPluginManager

PluginManager getPluginManager()
gives access to the plugin manager

Returns:
Since:
2.1.0.0

getClientIDManager

ClientIDManager getClientIDManager()
Returns:
Since:
2.2.0.3

getConnectionManager

ConnectionManager getConnectionManager()
Get the connection manager.

Returns:
manager
Since:
2.2.0.3

getMessageManager

MessageManager getMessageManager()
Get the peer messaging manager.

Returns:
manager
Since:
2.2.0.3

getDistributedDatabase

DistributedDatabase getDistributedDatabase()
Get the distributed database

Returns:
Since:
2.2.0.3

getPlatformManager

PlatformManager getPlatformManager()
Gets the platform manager that gives access to native functionality

Returns:

addListener

void addListener(PluginListener l)
Since:
2.0.7.0

removeListener

void removeListener(PluginListener l)
Since:
2.0.7.0

firePluginEvent

void firePluginEvent(PluginEvent event)
Fire a plugin-specific event. See PluginEvent for details of type values to use

Parameters:
event -
Since:
2403

addEventListener

void addEventListener(PluginEventListener l)
Since:
2.0.8.0

removeEventListener

void removeEventListener(PluginEventListener l)
Since:
2.0.8.0

getMainlineDHTManager

MainlineDHTManager getMainlineDHTManager()
Returns the manager object for registering plugins that connect to the Mainline DHT.

Since:
3.0.4.3

getPluginState

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.

Since:
3.1.1.1