public class PluginType extends BasicItem<PluginTypeData> implements Nameable, Removable
Modifier and Type | Field and Description |
---|---|
static int |
MAX_INTERFACENAME_LENGTH
The maximum length of the interface name that can be stored in the
database.
|
static int |
MAX_JARPATH_LENGTH
The maximum length of the jar path name that can be stored in the
database.
|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Modifier and Type | Method and Description |
---|---|
static PluginType |
getById(DbControl dc,
int id)
Get a
PluginType object when you know the ID. |
static PluginType |
getByInterfaceName(DbControl dc,
String interfaceName)
Get a
PluginType object when you know the interface
name it represents. |
String |
getDescription()
Get the description for the item.
|
String |
getInterfaceName()
Get the class name of the Java class that implements this plugin.
|
String |
getJarPath()
Get the path to the JAR file that contains the plugin class file.
|
String |
getName()
Get the name of the item.
|
static PluginType |
getNew(DbControl dc,
String interfaceName,
String jarPath)
Create a new
PluginType item. |
ItemQuery<PluginDefinition> |
getPlugins()
Get a query that returns the plugin definitions which implements
this type.
|
static ItemQuery<PluginType> |
getQuery()
Get a query configured to retrieve plugin types.
|
Item |
getType()
Get the type of item represented by the object.
|
boolean |
isRemoved()
Check if the removed flag is set for this item.
|
boolean |
isUsed()
Always FALSE.
|
void |
loadInterfaceInformation(String jarPath,
String interfaceName) |
void |
setDescription(String description)
Set the description for the item.
|
void |
setName(String name)
Set the name of the item.
|
void |
setRemoved(boolean removed)
Set the removed flag for this item.
|
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, hasPermission
public static final Item TYPE
Item.PLUGINTYPE
,
getType()
public static final int MAX_INTERFACENAME_LENGTH
setInterfaceName(String)
method to avoid exceptions.public static final int MAX_JARPATH_LENGTH
public static PluginType getNew(DbControl dc, String interfaceName, String jarPath) throws BaseException
PluginType
item.dc
- The DbControl
which will be used for
permission checking and database access.interfaceName
- The name of an interface that a plugin
must implement to be of this typejarPath
- Optional path to the jar file which contains the
interface class, if missing the interface must be in the classpathPluginDefinition
itemBaseException
- If there is an errorpublic static PluginType getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
PluginType
object when you know the ID.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to load.PluginType
itemItemNotFoundException
- If an item with the specified
id is not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static PluginType getByInterfaceName(DbControl dc, String interfaceName) throws ItemNotFoundException, PermissionDeniedException, BaseException
PluginType
object when you know the interface
name it represents.dc
- The DbControl
which will be used for
permission checking and database access.interfaceName
- The interface name of the plugin typePluginType
itemItemNotFoundException
- If an item with the specified
interface name is not foundPermissionDeniedException
- If the logged in user doesn't
have read permission to the itemBaseException
- If there is another errorpublic static ItemQuery<PluginType> getQuery()
ItemQuery
objectpublic Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic boolean isUsed() throws BaseException
isUsed
in class BasicItem<PluginTypeData>
BaseException
public boolean isRemoved()
Removable
public void setRemoved(boolean removed) throws PermissionDeniedException
Removable
setRemoved
in interface Removable
removed
- TRUE if the item should be flagged as removed,
FALSE otherwisePermissionDeniedException
- If the logged in user doesn't
have Permission.DELETE
permission for setting the flag
to TRUE or Permission.WRITE
permission for setting the
flag to FALSEpublic String getInterfaceName()
Plugin
interface.public String getJarPath()
public void loadInterfaceInformation(String jarPath, String interfaceName) throws InvalidDataException, BaseException
InvalidDataException
BaseException
public ItemQuery<PluginDefinition> getPlugins()
PluginDefinition.getQuery()