public class PluginInfo extends Object implements Plugin, Comparable<PluginInfo>
Plugin
attributes which is often used instead of real
plugins to avoid unnecessary plugin instantiation. It also defines a few
extra methods which deliver some functionality of the plugin framework.T-Plan Robot Enterprise, (C) 2009-2022 T-Plan Limited. All rights reserved.
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_EXTERNAL
External plugin type.
|
static int |
TYPE_INTERNAL
Internal plugin type.
|
Modifier and Type | Method and Description |
---|---|
void |
checkDependencies(PluginManager manager)
Check whether the current product installation contains all dependencies
(other plugins) required to install this plugin.
|
int |
compareTo(PluginInfo o)
Returns 1 if version of this plugin is higher, -1 if lower and 0 if the
versions are equal.
|
boolean |
equals(Object o) |
static PluginInfo |
fromDescriptor(PluginDescriptor desc) |
String |
getCode()
Get plugin code.
|
Date |
getDate()
Get plugin release date.
|
String |
getDescription()
Get plugin description to be displayed in the GUI.
|
PluginDescriptor |
getDescriptor() |
String |
getDisplayName()
Get short plugin name to be displayed in the GUI.
|
String |
getGroupName() |
Class |
getImplementedInterface()
Get Class of the exposed functional interface that this plugin implements.
|
String |
getLibraryUrl() |
int[] |
getLowestSupportedVersion()
Get the lowest required version of T-Plan Robot Enterprise.
|
String |
getMessageAfterInstall()
Get text of a message to be displayed after installation of this plugin.
|
String |
getMessageBeforeInstall()
Get text of a message to be displayed before installation of this plugin.
|
Class |
getPluginClass() |
Plugin |
getPluginInstance() |
String |
getSupportContact()
Get support contact.
|
int |
getType()
Get the plugin type, either
TYPE_INTERNAL or
TYPE_EXTERNAL . |
String |
getUniqueId()
Get unique ID associated with the plugin.
|
String |
getVendorHomePage()
Get the vendor home page.
|
String |
getVendorName()
Get vendor (provider) name to be displayed in the GUI.
|
int[] |
getVersion()
Get plugin version in form of an integer array.
|
String |
getVersionString() |
static String |
getVersionString(int[] version) |
boolean |
isBuiltIn() |
boolean |
isConfigurable() |
boolean |
isEnabled() |
boolean |
isRestartRequired() |
boolean |
isSupported() |
boolean |
requiresRestart()
Indicate whether installation of this plugin requires application restart.
|
void |
setDescriptor(PluginDescriptor descriptor) |
void |
setType(int type)
Set the plugin type, either
TYPE_INTERNAL or
TYPE_EXTERNAL . |
public static final int TYPE_INTERNAL
public static final int TYPE_EXTERNAL
public static PluginInfo fromDescriptor(PluginDescriptor desc)
public Class getPluginClass()
public boolean isEnabled()
public String getGroupName()
public boolean isBuiltIn()
public int compareTo(PluginInfo o)
compareTo
in interface Comparable<PluginInfo>
o
- another plugin info instance to compare topublic boolean isSupported()
public String getLibraryUrl()
public Plugin getPluginInstance() throws ClassNotFoundException, InstantiationException, IllegalAccessException, NoSuchMethodException, IllegalArgumentException, InvocationTargetException
public Class getImplementedInterface()
Plugin
com.tplan.robot.remoteclient.RemoteDesktopClient.class
.getImplementedInterface
in interface Plugin
public String getCode()
Plugin
Get plugin code. This string serves as an identifier of the functionality delivered by the plugin. For example, desktop client plugins return protocol name like "RFB" or "RDP" as their code.
Plugin code is used by pluggable instance factories to identify
a particular plugin. It may be used to replace internal plugins with
third party code. For
example if you develop a class which implements this and the
com.tplan.robot.remoteclient.RemoteDesktop
interfaces and the
getCode()
method returns "RFB", it will replace the internal
implementation of the RFB (VNC) client.
public String getDisplayName()
Plugin
getDisplayName
in interface Plugin
public String getVendorName()
Plugin
getVendorName
in interface Plugin
public String getVendorHomePage()
Plugin
getVendorHomePage
in interface Plugin
public int[] getVersion()
Plugin
new int[] { 1, 2, 3 }
.getVersion
in interface Plugin
public String getSupportContact()
Plugin
getSupportContact
in interface Plugin
public boolean isRestartRequired()
public String getDescription()
Plugin
getDescription
in interface Plugin
public boolean requiresRestart()
Plugin
requiresRestart
in interface Plugin
public String getUniqueId()
Plugin
Get unique ID associated with the plugin. The plugin manager uses the ID together with the version string to identify whether a plugin is already installed and whether a newer version of the same plugin is available.
The unique ID in fact identifies a particular plugin delivered by a particular vendor. Plugin developers are recommended to choose an ID and keep it constant for all versions of one particular plugin. The ID is never displayed in the GUI so it doesn't have to be a readable text. To avoid conflicts with other vendors it is recommended to elaborate vendor or author name and feature description into the ID, for example "custom RFB client implemented by John Doe".
getUniqueId
in interface Plugin
public int[] getLowestSupportedVersion()
Plugin
getLowestSupportedVersion
in interface Plugin
public String getMessageBeforeInstall()
Plugin
getMessageBeforeInstall
in interface Plugin
public String getMessageAfterInstall()
Plugin
getMessageAfterInstall
in interface Plugin
public String getVersionString()
public static String getVersionString(int[] version)
public boolean isConfigurable()
public void checkDependencies(PluginManager manager) throws DependencyMissingException
Plugin
DependencyMissingException
if one or more dependencies are missing.checkDependencies
in interface Plugin
manager
- shared instance of the plugin manager.DependencyMissingException
- when one or more dependencies requested by this plugin is missing.public int getType()
TYPE_INTERNAL
or
TYPE_EXTERNAL
.public void setType(int type)
TYPE_INTERNAL
or
TYPE_EXTERNAL
.type
- the plugin type constant.public PluginDescriptor getDescriptor()
public void setDescriptor(PluginDescriptor descriptor)
descriptor
- the descriptor to set