org.gudy.azureus2.plugins
Interface PluginInterface


public interface PluginInterface

Defines the communication interface between Azureus and Plugins

Author:
Olivier

Method Summary
 void addColumnToMyTorrentsTable(java.lang.String columnName, PluginMyTorrentsItemFactory factory)
          Deprecated. use TableManager
 void addColumnToPeersTable(java.lang.String columnName, PluginPeerItemFactory factory)
          Deprecated. use TableManager
 void addConfigSection(ConfigSection section)
          Deprecated. Use UIManager.createBasicPluginConfigModel(String) instead.
 void addConfigUIParameters(Parameter[] parameters, java.lang.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 addView(PluginView view)
          Deprecated. use UISWTInstance.addView(java.lang.String, java.lang.String, org.gudy.azureus2.ui.swt.plugins.UISWTViewEventListener)
 void firePluginEvent(PluginEvent event)
          Fire a plugin-specific event.
 java.lang.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.
 java.lang.String getAzureusName()
          Retrieve the name of the application.
 java.lang.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(java.lang.Class plugin, java.lang.String id)
          Returns an initialised plugin instance with its own scope (e.g. for config params).
 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.
 PeerProtocolManager getPeerProtocolManager()
          Gives access to the peer protocol manager
 PlatformManager getPlatformManager()
          Gets the platform manager that gives access to native functionality
 Plugin getPlugin()
          Gives access to the plugin itself
 java.lang.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.
 java.lang.String getPluginDirectoryName()
          gives access to the plugin installation path
 java.lang.String getPluginID()
          Returns an identifier used to identify this particular plugin
 PluginManager getPluginManager()
          gives access to the plugin manager
 java.lang.String getPluginName()
          Returns the value of "plugin.name" if it exists in the properties file, otherwise the directory name is returned.
 java.util.Properties getPluginProperties()
          gives access to the plugin properties
 java.lang.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
 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. required for non-Azureus SF hosted plugins (SF ones are managed automatically)
 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()
           
 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()
          If a plugin fails to load properly (i.e. the construction of the plugin object fails) it is marked as non-operational (rather than not being present at all)
 boolean isShared()
           
 boolean isUnloadable()
           
 void openTorrentFile(java.lang.String fileName)
          Deprecated. Use DownloadManager.addDownload(java.io.File)
 void openTorrentURL(java.lang.String url)
          Deprecated. Use DownloadManager.addDownload(java.io.File)
 void reload()
           
 void removeConfigSection(ConfigSection section)
           
 void removeEventListener(PluginEventListener l)
           
 void removeListener(PluginListener l)
           
 void setDisabled(boolean disabled)
           
 void uninstall()
          Uninstall this plugin if it has been loaded from a plugin directory.
 void unload()
           
 

Method Detail

getAzureusName

java.lang.String getAzureusName()
Retrieve the name of the application.

Returns:
the Application's name
Since:
2.1.0.0

getApplicationName

java.lang.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

java.lang.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

addView

void addView(PluginView view)
Deprecated. use UISWTInstance.addView(java.lang.String, java.lang.String, org.gudy.azureus2.ui.swt.plugins.UISWTViewEventListener)

A Plugin might call this method to add a View to Azureus's views The View will be accessible from View > Plugins > View name

Parameters:
view - The PluginView to be added
Since:
2.0.4.0

addConfigUIParameters

void addConfigUIParameters(Parameter[] parameters,
                           java.lang.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

addColumnToPeersTable

void addColumnToPeersTable(java.lang.String columnName,
                           PluginPeerItemFactory factory)
Deprecated. use TableManager

(DEPRECATED) Adds a column to the peers table.

Parameters:
columnName - the key name of the column
factory - the factory responsible of creating items. Azureus will look-up for PeersView.columnName into the lang files in order to find the localized displayName. (see i18n)
Since:
2.0.6.0

addColumnToMyTorrentsTable

void addColumnToMyTorrentsTable(java.lang.String columnName,
                                PluginMyTorrentsItemFactory factory)
Deprecated. use TableManager

(DEPRECATED) Adds a column to the My Torrents table.

Parameters:
columnName - the key name of the column
factory - the factory responsible of creating items. Azureus will look-up for MyTorrentsView.columnName into the lang files in order to find the localized displayName. (see i18n)
Since:
2.0.8.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

getPeerProtocolManager

PeerProtocolManager getPeerProtocolManager()
Gives access to the peer protocol manager

Returns:
An object that allows management of Peer Protocols
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(java.lang.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(java.lang.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

java.util.Properties getPluginProperties()
gives access to the plugin properties

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

getPluginDirectoryName

java.lang.String getPluginDirectoryName()
gives access to the plugin installation path

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

getPluginName

java.lang.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

java.lang.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

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

Returns:
Since:
2.1.0.0

isMandatory

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


isBuiltIn

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

Returns:

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 acess to the plugin Config UI Factory

Returns:
the PluginConfigUIFactory associated with this plugin

getPluginClassLoader

java.lang.ClassLoader getPluginClassLoader()
gives access to the ClassLoader used to load the plugin

Returns:
Since:
2.0.8.0

getLocalPluginInterface

PluginInterface getLocalPluginInterface(java.lang.Class plugin,
                                        java.lang.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()
If a plugin fails to load properly (i.e. the construction of the plugin object fails) it is marked as non-operational (rather than not being present at all)

Returns:
whether or not the plugin is operational or not
Since:
2.1.0.0

isUnloadable

boolean isUnloadable()
Since:
2.1.0.0

setDisabled

void setDisabled(boolean disabled)
Parameters:
disabled -
Since:
2.3.0.1

isDisabled

boolean isDisabled()

isShared

boolean isShared()
Returns:
Since:
2503/3005

unload

void unload()
            throws PluginException
Throws:
PluginException
Since:
2.1.0.0

reload

void reload()
            throws PluginException
Throws:
PluginException
Since:
2.1.0.0

uninstall

void uninstall()
               throws PluginException
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