2.17.2: 2011-06-17

net.sf.basedb.core.data
Class PluginDefinitionData

java.lang.Object
  extended by net.sf.basedb.core.data.BasicData
      extended by net.sf.basedb.core.data.OwnedData
          extended by net.sf.basedb.core.data.SharedData
              extended by net.sf.basedb.core.data.PluginDefinitionData
All Implemented Interfaces:
AnnotatableData, IdentifiableData, OwnableData, RegisteredData, RemovableData, ShareableData

public class PluginDefinitionData
extends SharedData
implements RemovableData, AnnotatableData, RegisteredData

This class represent an installed plugin.

Version:
2.0
Author:
Nicklas, Samuel
See Also:
PluginDefinition, Plugins
Hibernate: class
table="`PluginDefinitions`" lazy="false"

Field Summary
private  boolean allowImmediateExecution
           
private  AnnotationSetData annotationSet
           
private  String className
           
private  Set<PluginConfigurationData> configurations
           
private  String contact
           
private  String copyright
           
private  String description
           
private  String email
           
private  Date entryDate
           
private  Set<GuiContextData> guiContexts
           
private  boolean interactive
           
private  String jarPath
           
private  Set<JobAgentSettingsData> jobAgentSettings
           
private  int mainType
           
static int MAX_CLASSNAME_LENGTH
          The maximum length of the class name that can be stored in the database.
static int MAX_CONTACT_LENGTH
          The maximum length of the contact information that can be stored in the database.
static int MAX_COPYRIGHT_LENGTH
          The maximum length of the copyright notice that can be stored in the database.
static int MAX_DESCRIPTION_LENGTH
          The maximum length of the url that can be stored in the database.
static int MAX_EMAIL_LENGTH
          The maximum length of the email address that can be stored in the database.
static int MAX_JARPATH_LENGTH
           
static int MAX_NAME_LENGTH
          The maximum length of the name that can be stored in the database.
static int MAX_URL_LENGTH
          The maximum length of the url that can be stored in the database.
static int MAX_VERSION_LENGTH
          The maximum length of the version that can be stored in the database.
private  Long maxMemory
           
private  String name
           
private  Map<RoleKeyData,PluginPermission> permissions
           
private  Set<PluginTypeData> pluginTypes
           
private  boolean removed
           
private  boolean requiresConfiguration
           
private  boolean supportsConfigurations
           
private  boolean trusted
           
private  String url
           
private  boolean useInternalJobQueue
           
private  boolean usePermissions
           
private  String version
           
 
Constructor Summary
PluginDefinitionData()
           
 
Method Summary
 boolean getAllowImmediateExecution()
          If the plugin is allowed to be immediately executed or if it must be added to the job queue.
 AnnotationSetData getAnnotationSet()
          Get the annotation set that holds the annotations for an item.
 String getClassName()
          Get the class name of the Java class that implements this plugin.
(package private)  Set<PluginConfigurationData> getConfigurations()
          This is the inverse end.
 String getContact()
          Get contact information for the plugin.
 String getCopyright()
          Get a copyright notice for the plugin.
 String getDescription()
          Get a description of the plugin.
 String getEmail()
          Get an email address that can be used to get more information about the plugin.
 Date getEntryDate()
          Get the date this item was added to the database.
 Set<GuiContextData> getGuiContexts()
          The item code for all items where it makes sense to use the plugin in a client application.
 String getJarPath()
          Get the path to the JAR file where the plugin class is located.
(package private)  Set<JobAgentSettingsData> getJobAgentSettings()
          This is the inverse end.
 int getMainType()
          Get the main type of plugin.
 Long getMaxMemory()
          The max amount of memory the plugin can use.
 String getName()
          Get the name of the plugin.
 Map<RoleKeyData,PluginPermission> getPermissions()
          Get a map containing the rolekey and the permissions for this plugin.
 Set<PluginTypeData> getPluginTypes()
          The plugin types of this plugin, ie. all interfaces that it implements.
 boolean getRequiresConfiguration()
          If the plugin requires a configurations or not.
 boolean getSupportsConfigurations()
          If the plugin supports configurations or not.
 String getUrl()
          Get a URL with more information about the plugin.
 boolean getUseInternalJobQueue()
          If the plug-in can be executed with the internal job queue or not.
 boolean getUsePermissions()
          If the permissions for this plugin should be used or not.
 String getVersionString()
          Get the version of the plugin.
 boolean isInteractive()
          If the plugin is interactive or not.
 boolean isRemoved()
          Check if the removed flag is set for this item.
 boolean isTrusted()
          If the plugin should be trusted or not.
 void setAllowImmediateExecution(boolean allowImmediateExecution)
           
 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)
           
 void setEmail(String email)
           
 void setEntryDate(Date entryDate)
           
(package private)  void setGuiContexts(Set<GuiContextData> guiContexts)
           
 void setInteractive(boolean interactive)
           
 void setJarPath(String jarPath)
           
(package private)  void setJobAgentSettings(Set<JobAgentSettingsData> jobAgentSettings)
           
 void setMainType(int mainType)
           
 void setMaxMemory(Long maxMemory)
           
 void setName(String name)
           
(package private)  void setPermissions(Map<RoleKeyData,PluginPermission> permissions)
           
(package private)  void setPluginTypes(Set<PluginTypeData> pluginTypes)
           
 void setRemoved(boolean removed)
          Set the removed flag for this item.
 void setRequiresConfiguration(boolean requiresConfiguration)
           
 void setSupportsConfigurations(boolean supportsConfigurations)
           
 void setTrusted(boolean trusted)
           
 void setUrl(String url)
           
 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.OwnedData
getOwner, setOwner
 
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 Detail

removed

private boolean removed

annotationSet

private AnnotationSetData annotationSet

entryDate

private Date entryDate

MAX_CLASSNAME_LENGTH

public static final int MAX_CLASSNAME_LENGTH
The maximum length of the class name that can be stored in the database.

See Also:
Constant Field Values

className

private String className

MAX_JARPATH_LENGTH

public static final int MAX_JARPATH_LENGTH
See Also:
Constant Field Values

jarPath

private String jarPath

MAX_NAME_LENGTH

public static final int MAX_NAME_LENGTH
The maximum length of the name that can be stored in the database.

See Also:
Constant Field Values

name

private String name

MAX_DESCRIPTION_LENGTH

public static final int MAX_DESCRIPTION_LENGTH
The maximum length of the url that can be stored in the database.

See Also:
Constant Field Values

description

private String description

MAX_VERSION_LENGTH

public static final int MAX_VERSION_LENGTH
The maximum length of the version that can be stored in the database.

See Also:
Constant Field Values

version

private String version

MAX_COPYRIGHT_LENGTH

public static final int MAX_COPYRIGHT_LENGTH
The maximum length of the copyright notice that can be stored in the database.

See Also:
Constant Field Values

copyright

private String copyright

MAX_CONTACT_LENGTH

public static final int MAX_CONTACT_LENGTH
The maximum length of the contact information that can be stored in the database.

See Also:
Constant Field Values

contact

private String contact

MAX_EMAIL_LENGTH

public static final int MAX_EMAIL_LENGTH
The maximum length of the email address that can be stored in the database.

See Also:
Constant Field Values

email

private String email

MAX_URL_LENGTH

public static final int MAX_URL_LENGTH
The maximum length of the url that can be stored in the database.

See Also:
Constant Field Values

url

private String url

mainType

private int mainType

interactive

private boolean interactive

supportsConfigurations

private boolean supportsConfigurations

requiresConfiguration

private boolean requiresConfiguration

usePermissions

private boolean usePermissions

guiContexts

private Set<GuiContextData> guiContexts

pluginTypes

private Set<PluginTypeData> pluginTypes

permissions

private Map<RoleKeyData,PluginPermission> permissions

trusted

private boolean trusted

maxMemory

private Long maxMemory

jobAgentSettings

private Set<JobAgentSettingsData> jobAgentSettings

configurations

private Set<PluginConfigurationData> configurations

allowImmediateExecution

private boolean allowImmediateExecution

useInternalJobQueue

private boolean useInternalJobQueue
Constructor Detail

PluginDefinitionData

public PluginDefinitionData()
Method Detail

isRemoved

public boolean isRemoved()
Description copied from interface: RemovableData
Check if the removed flag is set for this item.

Specified by:
isRemoved in interface RemovableData
Returns:
TRUE if the item is flagged as removed, FALSE otherwise

setRemoved

public void setRemoved(boolean removed)
Description copied from interface: RemovableData
Set the removed flag for this item.

Specified by:
setRemoved in interface RemovableData
Parameters:
removed - TRUE if the item should be flagged as removed, FALSE otherwise

getAnnotationSet

public AnnotationSetData getAnnotationSet()
Description copied from interface: AnnotatableData
Get the annotation set that holds the annotations for an item.

Specified by:
getAnnotationSet in interface AnnotatableData
Returns:
An AnnotationSetData item or null if no annotations exist

setAnnotationSet

public void setAnnotationSet(AnnotationSetData annotationSet)
Description copied from interface: AnnotatableData
Change the annotation set. Use null to remove the annotations.

Specified by:
setAnnotationSet in interface AnnotatableData
Parameters:
annotationSet - Annotation set to change to.

getEntryDate

public Date 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 interface RegisteredData

setEntryDate

public void setEntryDate(Date entryDate)

getClassName

public String getClassName()
Get the class name of the Java class that implements this plugin. The specified class must implement the Plugin interface.

Returns:
The class name for this plugin
Hibernate: property
column="`class_name`" type="string" length="255" not-null="true" unique="true"

setClassName

public void setClassName(String className)

getJarPath

public String getJarPath()
Get the path to the JAR file where the plugin class is located. If the value is null the plugin must be in the classpath.

Returns:
The class name for this plugin
Hibernate: property
column="`jar_path`" type="text" not-null="false"

setJarPath

public void setJarPath(String jarPath)

getName

public String getName()
Get the name of the plugin.

Returns:
A string with the name of the plugin
Hibernate: property
column="`name`" type="string" length="255" not-null="true"

setName

public void setName(String name)

getDescription

public String getDescription()
Get a description of the plugin.

Returns:
A string with a description, or null if not known
Hibernate: property
column="`description`" type="text" not-null="false"

setDescription

public void setDescription(String description)

getVersionString

public String 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

public void setVersionString(String version)

getCopyright

public String 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

public void setCopyright(String copyright)

getContact

public String 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

public void setContact(String contact)

getEmail

public String 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

public void setEmail(String email)

getUrl

public String 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

public void setUrl(String url)

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)

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

public Set<GuiContextData> 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

void setGuiContexts(Set<GuiContextData> guiContexts)

getPluginTypes

public Set<PluginTypeData> 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

void setPluginTypes(Set<PluginTypeData> pluginTypes)

getPermissions

public Map<RoleKeyData,PluginPermission> 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

void setPermissions(Map<RoleKeyData,PluginPermission> permissions)

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

public Long 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

public void setMaxMemory(Long maxMemory)

getJobAgentSettings

Set<JobAgentSettingsData> getJobAgentSettings()
This is the inverse end.

See Also:
JobAgentSettingsData.getPluginDefinition()
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

void setJobAgentSettings(Set<JobAgentSettingsData> jobAgentSettings)

getConfigurations

Set<PluginConfigurationData> getConfigurations()
This is the inverse end.

See Also:
PluginConfigurationData.getPluginDefinition()
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

void setConfigurations(Set<PluginConfigurationData> configurations)

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)

2.17.2: 2011-06-17