Package net.sf.basedb.core.plugin
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:
- Create a plugin object, using the default constructor
- Call the
getMainType()
method - Check if the plugin inmplements the
InteractivePlugin
and if it does, call theInteractivePlugin.getGuiContexts()
method. - 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:
- Create a plugin object, using the default constructor
- Call the
init(SessionControl, ParameterValues, ParameterValues)
method which gives the plugin access to it's configuration and job-specific parameters - Call the
run(Request, Response, ProgressReporter)
method to let the plugin do it's work - Call
done()
to let the plugin clean up after itself - After
done
has been called, the plugin instance is not reused again
- Version:
- 2.0
- Author:
- Nicklas, Enell
- Last modified
- $Date$
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
done()
This method is called when the core is finished with the plugin object.Get the type of the plugin.Get the permissions this plugin requires to function as expected.void
init
(SessionControl sc, ParameterValues configuration, ParameterValues job) This method is called right after the plugin object has been constructed to pass the configuration and job parameters to the plugin.boolean
Return TRUE if the plugin requires a configuration when executing a job.void
run
(Request request, Response response, ProgressReporter progress) Run the plugin.boolean
Return TRUE if the plugin supports different configurations when executing a job.
-
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 thesupportsConfigurations()
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. TheParameterValues
parameters can be null if no parameters exists.- Parameters:
sc
- ASessionControl
object that the plugin can use to communicate with the core.configuration
- The configuration parameters for the pluginjob
- The job parameters for the plugin- Throws:
BaseException
- if there is an error.
-
run
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 parametersresponse
- Response object in for the plugin to response throughprogress
- AProgressReporter
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.
-