Interface Plugin

All Known Subinterfaces:
AnalysisFilterPlugin, AnnotationSetterPlugin, AutoDetectingImporter, ConfigureByExample, FileUnpacker, ImmediateDownloadExporter, InteractivePlugin, IOSupport, WrappedConfigureByExample
All Known Implementing Classes:
AbstractAnalysisPlugin, AbstractExporterPlugin, AbstractFileUnpacker, AbstractFlatFileImporter, AbstractIOSupport, AbstractItemImporter, AbstractPlugin, AnnotationFlatFileImporter, AnnotationTypeImporter, AnyToAnyImporter, ArrayBatchImporter, ArrayDesignImporter, ArraySlideImporter, Base1PluginExecuter, BaseFileExporterPlugin, BaseFileExporterSupport, BaseFileImporterSupport, BfsExporterPlugin, BfsExporterSupport, BfsImporterSupport, BioPlateImporter, BioSourceImporter, Bzip2FileUnpacker, CdfFileReporterImporter, CloneReportersPlugin, DerivedBioAssayImporter, ExternalProgramExecutor, ExtractImporter, FileImporter, FileOnlyImporterSupport, FormulaFilter, GalExporter, GtfReporterImporter, GtfReporterMapImporter, GzipFileUnpacker, HelpExporter, HelpImporter, IlluminaRawDataImporter, IntensityCalculatorPlugin, JepExtraValueCalculator, JepIntensityTransformer, KitImporter, LowessNormalization, ManualDerivedBioAssayCreator, ManualTransformCreator, MedianRatioNormalization, PackedFileExporter, PhysicalBioAssayImporter, PlateFlatFileImporter, PlateMappingExporter, PlateMappingImporter, PluginConfigurationExporter, PluginConfigurationImporter, PrintMapFlatFileImporter, RawBioAssayImporter, RawDataFlatFileImporter, ReporterFlatFileImporter, ReporterMapFlatFileImporter, SampleImporter, SimpleExport, TagImporter, TarFileUnpacker, ZipFileUnpacker

public interface Plugin
This interface must be implemented by all plugins to BASE. A plugin must also define a default public no-argument constructor.

When a plugin is installed into BASE the core will use the following sequence to store all meta-information about the plugin in the database:

  1. Create a plugin object, using the default constructor
  2. Call the getMainType() method
  3. Check if the plugin inmplements the InteractivePlugin and if it does, call the InteractivePlugin.getGuiContexts() method.
  4. Check which other interfaces the plugin implements, and link to PluginType as appropriate

When a plugin is executed using a the request/response scheme the core will use the following sequence:

  1. Create a plugin object, using the default constructor
  2. Call the init(SessionControl, ParameterValues, ParameterValues) method which gives the plugin access to it's configuration and job-specific parameters
  3. Call the run(Request, Response, ProgressReporter) method to let the plugin do it's work
  4. Call done() to let the plugin clean up after itself
  5. After done has been called, the plugin instance is not reused again
Version:
2.0
Author:
Nicklas, Enell
Last modified
$Date$
  • Method Details

    • getMainType

      Plugin.MainType getMainType()
      Get the type of the plugin. This method must always return the same value.
      Returns:
      One of the defined types
    • supportsConfigurations

      boolean supportsConfigurations()
      Return TRUE if the plugin supports different configurations when executing a job.
      Returns:
      TRUE or FALSE
    • requiresConfiguration

      boolean requiresConfiguration()
      Return TRUE if the plugin requires a configuration when executing a job. The core will not start a job without a configuration if this method returns TRUE. Note! If the supportsConfigurations() method returns FALSE, the return value of this method is expected to also be FALSE.
      Returns:
      TRUE or FALSE
    • getPermissions

      Collection<Permissions> getPermissions()
      Get the permissions this plugin requires to function as expected. The plugin may specify permissions that is always granted to the plugin even if the logged in user doesn't have that permission and permissions that are only granted if the logged in user has the required permission. Permissions that are not specified are always denied. If null or an empty collection is returned, the permissions are not used and the plugin will always get the same permissions as the logged in user.
      Returns:
      A collection of permissions or null to not use permissions
    • init

      void init(SessionControl sc, ParameterValues configuration, ParameterValues job) throws BaseException
      This method is called right after the plugin object has been constructed to pass the configuration and job parameters to the plugin. The ParameterValues parameters can be null if no parameters exists.
      Parameters:
      sc - A SessionControl object that the plugin can use to communicate with the core.
      configuration - The configuration parameters for the plugin
      job - The job parameters for the plugin
      Throws:
      BaseException - if there is an error.
    • run

      void run(Request request, Response response, ProgressReporter progress)
      Run the plugin. If a progress reporter object is passed it is recommended that the plugin makes use of it.
      Parameters:
      request - Request object with the command and parameters
      response - Response object in for the plugin to response through
      progress - A ProgressReporter where the plugin can report its progess, can be null
    • done

      void done()
      This method is called when the core is finished with the plugin object. The plugin should clean up and close any resources it has aquired.