Class 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:
PluginDefinition, Developer documentation: Plug-ins, jobs and job agents
Hibernate: class
table="`PluginDefinitions`" lazy="false"
  • Field Details

    • removedBy

      private Integer removedBy
    • 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_JARFILE_LENGTH

      public static final int MAX_JARFILE_LENGTH
      See Also:
      Constant Field Values
    • jarFile

      private String jarFile
    • 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_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
    • disabled

      private boolean disabled
    • 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 Details

    • PluginDefinitionData

      public PluginDefinitionData()
  • Method Details

    • getRemovedBy

      public Integer getRemovedBy()
      Description copied from interface: RemovableData
      Get the ID of the user that removed this item.
      Specified by:
      getRemovedBy in interface RemovableData
      Overrides:
      getRemovedBy in class CommonData
      Returns:
      The ID of a user or null if the item is not removed
    • setRemovedBy

      public void setRemovedBy​(Integer removedBy)
      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 interface RemovableData
      Overrides:
      setRemovedBy in class CommonData
    • 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.
    • getAnnotations

      public Set<AnnotationLink> 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 interface AnnotatableData
    • setAnnotations

      void setAnnotations​(Set<AnnotationLink> links)
    • 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)
    • getJarFile

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

      public void setJarFile​(String jarFile)
    • getName

      public String getName()
      Get the name of the plugin.
      Specified by:
      getName in interface NameableData
      Overrides:
      getName in class CommonData
      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)
      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 the MAX_NAME_LENGTH constant.
      Specified by:
      setName in interface NameableData
      Overrides:
      setName in class CommonData
      Parameters:
      name - The new name for the item
    • getDescription

      public String getDescription()
      Get a description of the plugin.
      Specified by:
      getDescription in interface NameableData
      Overrides:
      getDescription in class CommonData
      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)
      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 the MAX_DESCRIPTION_LENGTH constant.
      Specified by:
      setDescription in interface NameableData
      Overrides:
      setDescription in class CommonData
      Parameters:
      description - The new description for the item
    • 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)
    • 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

      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)