Package net.sf.basedb.core.data
Class PluginDefinitionData
java.lang.Object
net.sf.basedb.core.data.BasicData
net.sf.basedb.core.data.OwnedData
net.sf.basedb.core.data.SharedData
net.sf.basedb.core.data.CommonData
net.sf.basedb.core.data.PluginDefinitionData
- All Implemented Interfaces:
AnnotatableData
,IdentifiableData
,NameableData
,OwnableData
,RegisteredData
,RemovableData
,ShareableData
public class PluginDefinitionData
extends CommonData
implements RemovableData, AnnotatableData, RegisteredData
This class represent an installed plugin.
- Version:
- 2.0
- Author:
- Nicklas, Samuel
- See Also:
- Hibernate: class
- table="`PluginDefinitions`" lazy="false"
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private AnnotationSetData
private String
private Set<PluginConfigurationData>
private String
private String
private String
private boolean
private String
private Date
private Set<GuiContextData>
private boolean
private String
private Set<JobAgentSettingsData>
private Set<AnnotationLink>
private int
static final int
The maximum length of the class name that can be stored in the database.static final int
The maximum length of the contact information that can be stored in the database.static final int
The maximum length of the copyright notice that can be stored in the database.static final int
The maximum length of the url that can be stored in the database.static final int
The maximum length of the email address that can be stored in the database.static final int
static final int
The maximum length of the name that can be stored in the database.static final int
The maximum length of the url that can be stored in the database.static final int
The maximum length of the version that can be stored in the database.private Long
private String
private Map<RoleKeyData,
PluginPermission> private Set<PluginTypeData>
private Integer
private boolean
private boolean
private boolean
private String
private boolean
private boolean
private String
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
If the plugin is allowed to be immediately executed or if it must be added to the job queue.Short-cut to all annotations belonging to this item.Get the annotation set that holds the annotations for an item.Get the class name of the Java class that implements this plugin.(package private) Set<PluginConfigurationData>
This is the inverse end.Get contact information for the plugin.Get a copyright notice for the plugin.Get a description of the plugin.getEmail()
Get an email address that can be used to get more information about the plugin.Get the date this item was added to the database.The item code for all items where it makes sense to use the plugin in a client application.Get the file name of the JAR file where the plugin class is located.(package private) Set<JobAgentSettingsData>
This is the inverse end.int
Get the main type of plugin.The max amount of memory the plugin can use.getName()
Get the name of the plugin.Get a map containing the rolekey and the permissions for this plugin.The plugin types of this plugin, ie. all interfaces that it implements.Get the ID of the user that removed this item.boolean
If the plugin requires a configurations or not.boolean
If the plugin supports configurations or not.getUrl()
Get a URL with more information about the plugin.boolean
If the plug-in can be executed with the internal job queue or not.boolean
If the permissions for this plugin should be used or not.Get the version of the plugin.boolean
If the plugin is enabled or disabled. // Mapped in hibernate-properties-PluginDefinitionData.xml since annotation doesn't support a default valueboolean
If the plugin is interactive or not.boolean
If the plugin should be trusted or not.void
setAllowImmediateExecution
(boolean allowImmediateExecution) (package private) void
setAnnotations
(Set<AnnotationLink> links) void
setAnnotationSet
(AnnotationSetData annotationSet) Change the annotation set.void
setClassName
(String className) (package private) void
setConfigurations
(Set<PluginConfigurationData> configurations) void
setContact
(String contact) void
setCopyright
(String copyright) void
setDescription
(String description) Set the description for the item.void
setDisabled
(boolean disabled) void
void
setEntryDate
(Date entryDate) (package private) void
setGuiContexts
(Set<GuiContextData> guiContexts) void
setInteractive
(boolean interactive) void
setJarFile
(String jarFile) (package private) void
setJobAgentSettings
(Set<JobAgentSettingsData> jobAgentSettings) void
setMainType
(int mainType) void
setMaxMemory
(Long maxMemory) void
Set the name of the item.(package private) void
setPermissions
(Map<RoleKeyData, PluginPermission> permissions) (package private) void
setPluginTypes
(Set<PluginTypeData> pluginTypes) void
setRemovedBy
(Integer removedBy) Set the ID of the user that removed this item or null to restore the item.void
setRequiresConfiguration
(boolean requiresConfiguration) void
setSupportsConfigurations
(boolean supportsConfigurations) void
setTrusted
(boolean trusted) void
void
setUseInternalJobQueue
(boolean useInternalJobQueue) void
setUsePermissions
(boolean usePermissions) void
setVersionString
(String version) Methods inherited from class net.sf.basedb.core.data.SharedData
getItemKey, getProjectKey, setItemKey, setProjectKey
Methods inherited from class net.sf.basedb.core.data.BasicData
equals, getId, getVersion, hashCode, setId, setVersion, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.data.IdentifiableData
getId, getVersion
Methods inherited from interface net.sf.basedb.core.data.OwnableData
getOwner, setOwner
-
Field Details
-
removedBy
-
annotationSet
-
links
-
entryDate
-
MAX_CLASSNAME_LENGTH
public static final int MAX_CLASSNAME_LENGTHThe maximum length of the class name that can be stored in the database.- See Also:
-
className
-
MAX_JARFILE_LENGTH
public static final int MAX_JARFILE_LENGTH- See Also:
-
jarFile
-
MAX_NAME_LENGTH
public static final int MAX_NAME_LENGTHThe maximum length of the name that can be stored in the database.- See Also:
-
name
-
MAX_DESCRIPTION_LENGTH
public static final int MAX_DESCRIPTION_LENGTHThe maximum length of the url that can be stored in the database.- See Also:
-
description
-
MAX_VERSION_LENGTH
public static final int MAX_VERSION_LENGTHThe maximum length of the version that can be stored in the database.- See Also:
-
version
-
MAX_COPYRIGHT_LENGTH
public static final int MAX_COPYRIGHT_LENGTHThe maximum length of the copyright notice that can be stored in the database.- See Also:
-
copyright
-
MAX_CONTACT_LENGTH
public static final int MAX_CONTACT_LENGTHThe maximum length of the contact information that can be stored in the database.- See Also:
-
contact
-
MAX_EMAIL_LENGTH
public static final int MAX_EMAIL_LENGTHThe maximum length of the email address that can be stored in the database.- See Also:
-
email
-
MAX_URL_LENGTH
public static final int MAX_URL_LENGTHThe maximum length of the url that can be stored in the database.- See Also:
-
url
-
mainType
private int mainType -
disabled
private boolean disabled -
interactive
private boolean interactive -
supportsConfigurations
private boolean supportsConfigurations -
requiresConfiguration
private boolean requiresConfiguration -
usePermissions
private boolean usePermissions -
guiContexts
-
pluginTypes
-
permissions
-
trusted
private boolean trusted -
maxMemory
-
jobAgentSettings
-
configurations
-
allowImmediateExecution
private boolean allowImmediateExecution -
useInternalJobQueue
private boolean useInternalJobQueue
-
-
Constructor Details
-
PluginDefinitionData
public PluginDefinitionData()
-
-
Method Details
-
getRemovedBy
Description copied from interface:RemovableData
Get the ID of the user that removed this item.- Specified by:
getRemovedBy
in interfaceRemovableData
- Overrides:
getRemovedBy
in classCommonData
- Returns:
- The ID of a user or null if the item is not removed
-
setRemovedBy
Description copied from interface:RemovableData
Set the ID of the user that removed this item or null to restore the item.- Specified by:
setRemovedBy
in interfaceRemovableData
- Overrides:
setRemovedBy
in classCommonData
-
getAnnotationSet
Description copied from interface:AnnotatableData
Get the annotation set that holds the annotations for an item.- Specified by:
getAnnotationSet
in interfaceAnnotatableData
- Returns:
- An
AnnotationSetData
item or null if no annotations exist
-
setAnnotationSet
Description copied from interface:AnnotatableData
Change the annotation set. Use null to remove the annotations.- Specified by:
setAnnotationSet
in interfaceAnnotatableData
- Parameters:
annotationSet
- Annotation set to change to.
-
getAnnotations
Description copied from interface:AnnotatableData
Short-cut to all annotations belonging to this item. Used for HQL queries only. This is the inverse end. NOTE! The property-ref="annotationSet" require that AnnotationSetData implements Serializable- Specified by:
getAnnotations
in interfaceAnnotatableData
-
setAnnotations
-
getEntryDate
Description copied from interface:RegisteredData
Get the date this item was added to the database. The value is generated at creation time and can't be modified later.- Specified by:
getEntryDate
in interfaceRegisteredData
-
setEntryDate
-
getClassName
Get the class name of the Java class that implements this plugin. The specified class must implement thePlugin
interface.- Returns:
- The class name for this plugin
- Hibernate: property
- column="`class_name`" type="string" length="255" not-null="true" unique="true"
-
setClassName
-
getJarFile
Get the file name of the JAR file where the plugin class is located. The JAR file must be located in the 'plugins.dir' folder specified in base.config. If the value is null the plugin must be in the classpath (eg. WEB-INF/lib).- Returns:
- The class name for this plugin
- Since:
- 3.0
- Hibernate: property
- column="`jar_file`" type="string" length="255" not-null="false"
-
setJarFile
-
getName
Get the name of the plugin.- Specified by:
getName
in interfaceNameableData
- Overrides:
getName
in classCommonData
- Returns:
- A string with the name of the plugin
- Hibernate: property
- column="`name`" type="string" length="255" not-null="true"
-
setName
Description copied from interface:NameableData
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by theMAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameableData
- Overrides:
setName
in classCommonData
- Parameters:
name
- The new name for the item
-
getDescription
Get a description of the plugin.- Specified by:
getDescription
in interfaceNameableData
- Overrides:
getDescription
in classCommonData
- Returns:
- A string with a description, or null if not known
- Hibernate: property
- column="`description`" type="text" not-null="false"
-
setDescription
Description copied from interface:NameableData
Set the description for the item. The description can be null but mustn't be longer than the value specified by theMAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameableData
- Overrides:
setDescription
in classCommonData
- Parameters:
description
- The new description for the item
-
getVersionString
Get the version of the plugin.- Returns:
- A string with the version of the plugin, or null if not known
- Hibernate: property
- column="`version_string`" type="string" length="255" not-null="false"
-
setVersionString
-
getCopyright
Get a copyright notice for the plugin.- Returns:
- A string with a copyright notice, or null if not known
- Hibernate: property
- column="`copyright`" type="string" length="255" not-null="false"
-
setCopyright
-
getContact
Get contact information for the plugin.- Returns:
- A string with contact information, or null if not known
- Hibernate: property
- column="`contact`" type="string" length="255" not-null="false"
-
setContact
-
getEmail
Get an email address that can be used to get more information about the plugin.- Returns:
- A string with the email address, or null if not known
- Hibernate: property
- column="`email`" type="string" length="255" not-null="false"
-
setEmail
-
getUrl
Get a URL with more information about the plugin.- Returns:
- A string containing the URL, or null if not known
- Hibernate: property
- column="`url`" type="string" length="255" not-null="false"
-
setUrl
-
getMainType
public int getMainType()Get the main type of plugin.- Returns:
- A type code that is defined in the enum
Plugin.MainType
. - Hibernate: property
- column="`type`" type="int" not-null="true"
-
setMainType
public void setMainType(int mainType) -
isDisabled
public boolean isDisabled()If the plugin is enabled or disabled. // Mapped in hibernate-properties-PluginDefinitionData.xml since annotation doesn't support a default value- Since:
- 3.0
-
setDisabled
public void setDisabled(boolean disabled) -
isInteractive
public boolean isInteractive()If the plugin is interactive or not.- Hibernate: property
- column="`interactive`" type="boolean" not-null="true"
-
setInteractive
public void setInteractive(boolean interactive) -
getSupportsConfigurations
public boolean getSupportsConfigurations()If the plugin supports configurations or not.- Hibernate: property
- column="`supports_config`" type="boolean" not-null="true"
-
setSupportsConfigurations
public void setSupportsConfigurations(boolean supportsConfigurations) -
getRequiresConfiguration
public boolean getRequiresConfiguration()If the plugin requires a configurations or not. Requires that the plugin supports configurations.- Hibernate: property
- column="`requires_config`" type="boolean" not-null="true"
-
setRequiresConfiguration
public void setRequiresConfiguration(boolean requiresConfiguration) -
getUsePermissions
public boolean getUsePermissions()If the permissions for this plugin should be used or not.- Hibernate: property
- column="`use_permissions`" type="boolean" not-null="true"
-
setUsePermissions
public void setUsePermissions(boolean usePermissions) -
getGuiContexts
The item code for all items where it makes sense to use the plugin in a client application. Ie. a plugin that imports reporters should return a set containing the code for Item.REPORTER.- Hibernate: set
- table="`PluginDefinitionGuiContexts`" lazy="true"
- Hibernate: collection-key
- column="`plugindefinition_id`"
- Hibernate: collection-composite-element
- class="net.sf.basedb.core.data.GuiContextData"
-
setGuiContexts
-
getPluginTypes
The plugin types of this plugin, ie. all interfaces that it implements.- Hibernate: set
- table="`PluginDefinitionTypes`" lazy="true"
- Hibernate: collection-key
- column="`plugindefinition_id`"
- Hibernate: collection-many-to-many
- column="`plugintype_id`" class="net.sf.basedb.core.data.PluginTypeData"
-
setPluginTypes
-
getPermissions
Get a map containing the rolekey and the permissions for this plugin.- Hibernate: map
- table="`PluginKeys`" lazy="true" cascade="delete"
- Hibernate: index-many-to-many
- column="`key_id`" class="net.sf.basedb.core.data.RoleKeyData"
- Hibernate: collection-key
- column="`plugindefinition_id`"
- Hibernate: collection-composite-element
- class="net.sf.basedb.core.data.PluginPermission"
-
setPermissions
-
isTrusted
public boolean isTrusted()If the plugin should be trusted or not.- Hibernate: property
- column="`trusted`" type="boolean" not-null="true"
-
setTrusted
public void setTrusted(boolean trusted) -
getMaxMemory
The max amount of memory the plugin can use. If the value is null the job agent is free to choose an appropriate value.- Hibernate: property
- column="`max_memory`" type="long" not-null="false"
-
setMaxMemory
-
getJobAgentSettings
Set<JobAgentSettingsData> getJobAgentSettings()This is the inverse end.- See Also:
- Hibernate: set
- inverse="true" lazy="true" cascade="delete"
- Hibernate: collection-key
- column="`plugindefinition_id`"
- Hibernate: collection-one-to-many
- class="net.sf.basedb.core.data.JobAgentSettingsData"
-
setJobAgentSettings
-
getConfigurations
Set<PluginConfigurationData> getConfigurations()This is the inverse end.- See Also:
- Hibernate: set
- inverse="true" lazy="true"
- Hibernate: collection-key
- column="`plugindefinition_id`"
- Hibernate: collection-one-to-many
- class="net.sf.basedb.core.data.PluginConfigurationData"
-
setConfigurations
-
getAllowImmediateExecution
public boolean getAllowImmediateExecution()If the plugin is allowed to be immediately executed or if it must be added to the job queue.- Since:
- 2.2
- Hibernate: property
- column="`allow_immediate`" type="boolean" not-null="true"
-
setAllowImmediateExecution
public void setAllowImmediateExecution(boolean allowImmediateExecution) -
getUseInternalJobQueue
public boolean getUseInternalJobQueue()If the plug-in can be executed with the internal job queue or not. If FALSE is used, the plug-in can only be executed by a job agent or other external tool.- Since:
- 2.5
- Hibernate: property
- column="`use_internal_queue`" type="boolean" not-null="true"
-
setUseInternalJobQueue
public void setUseInternalJobQueue(boolean useInternalJobQueue)
-