|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.PluginInfo
public class PluginInfo
A PluginInfo
object is used to keep information about
external plugin located in a jar file.
Field Summary | |
---|---|
private About |
about
The about information from the plugin |
private String |
className
The classname of the plugin |
private List<PluginConfigInfo> |
configs
The list with belonging configurations |
private static String |
configurationImportFile
The path in a jar-file to the file that holds configurations to import |
private boolean |
denied
|
private boolean |
inSameJarFile
|
private boolean |
isInstalled
|
private String |
jarInDatabase
|
private String |
jarPath
The path to the jarfile the plugin is located in. |
private String |
minBaseVersion
The BASE version that the plugin at least requires |
private String |
pluginVersion
The version of this plug-in |
private String |
versionInDatabase
|
private static String |
xmlFile
The name of a XML-file that holds information about each plugin class in the jar file. |
Constructor Summary | |
---|---|
PluginInfo(String jarPath,
String className,
String minBaseVersion,
About about,
List<PluginConfigInfo> configs)
Creates a new PluginInfo object. |
Method Summary | |
---|---|
void |
checkInstallation(DbControl dc)
Checks the database if this plug-in is installed or not. |
About |
getAbout()
Gets the about information that is set for this plugin |
String |
getClassName()
Gets the class name for the plugin |
List<PluginConfigInfo> |
getConfigurations()
Gets information about the configurations that come together with the plugin in the jar. |
String |
getConfigurationsPath()
The path inside a jar to the xml-file that holds the pluginconfigurations that can be imported. |
String |
getJarPath()
Gets the name of the jar file holding this plugin |
String |
getJarPathInDatabase()
Gets the jar path of the already installed plugin. |
String |
getMinBaseVersion()
Gets the lowest version of BASE that the plugin is compatible with |
String |
getVersionInDatabase()
Get which version of this plugin that is installed in BASE. |
boolean |
hasConfigurations()
|
boolean |
hasDifferentVersion()
Has the plug-in a version number that differ from what is stored in the database. |
boolean |
inSameJarFile()
If the plug-in is already installed in the same or a different JAR file. |
boolean |
isDenied()
If the currently logged in user has write permission to the (installed) plug-in or not. |
boolean |
isInstalled()
If the plug-in is already installed in BASE. |
static List<PluginInfo> |
loadFromJar(File jarFile)
Gets a list with PluginInfo objects, one for every plugin listed
in the base-plugins.xml file, which is located in the jar-file's META-INF
directory. |
private static boolean |
versionCompatible(String version)
Gets if a version is compatible with current major.minor-version of BASE |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String jarPath
private String className
private String minBaseVersion
private About about
private String pluginVersion
private List<PluginConfigInfo> configs
private static final String xmlFile
private static final String configurationImportFile
private boolean denied
private boolean isInstalled
private boolean inSameJarFile
private String versionInDatabase
private String jarInDatabase
Constructor Detail |
---|
public PluginInfo(String jarPath, String className, String minBaseVersion, About about, List<PluginConfigInfo> configs)
PluginInfo
object.
jarPath
- The path to the jar file in which the class is located.className
- The plugin's class nameminBaseVersion
- BASE version that the plugin at least requiresabout
- Information about the plugin.configs
- A list with configurations for this plugin.Method Detail |
---|
public static List<PluginInfo> loadFromJar(File jarFile) throws JDOMException
PluginInfo
objects, one for every plugin listed
in the base-plugins.xml file, which is located in the jar-file's META-INF
directory. Plugins which class file couldn't be found or the class doesn't implement
Plugin
will not be included in the list but already
installed plugins will.
jarFile
- The jar file to load the plugin info from.
JDOMException
- If any error loading the XML-documentpublic String getClassName()
public String getJarPath()
public String getMinBaseVersion()
public About getAbout()
public List<PluginConfigInfo> getConfigurations()
public boolean hasConfigurations()
public String getConfigurationsPath()
public void checkInstallation(DbControl dc)
isDenied()
, isInstalled()
or
inSameJarFile()
is called.
dc
- An open DbControlpublic boolean isDenied()
checkInstallation(DbControl)
must be called.
public boolean isInstalled()
checkInstallation(DbControl)
must be called.
public boolean inSameJarFile()
checkInstallation(DbControl)
must be called.
public boolean hasDifferentVersion()
public String getVersionInDatabase()
public String getJarPathInDatabase()
private static boolean versionCompatible(String version)
version
- The version to test
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |