Package net.sf.basedb.core
Class PluginConfigurationRequest
Configures a plugin or job. You will get an instance of
this class when:
- You want to configure a plugin:
PluginConfiguration.configure()
- You want to configure a job:
Job.configure(GuiContext)
- Call the
getRequestInformation()
method to find out which parameters the plugin or job wants. - Display a user interface for entering the parameter values or get the parameters from somewhere else.
- Set the parameter values with the
PluginRequest.setParameterValue(String, Object)
orPluginRequest.setParameterValues(String, List)
methods. - Call
invoke()
to let the plugin check the parameters and store them in the database. - Check the
PluginResponse.getStatus()
method and repeat the steps if needed, or display an error message. In case of an error in the parameters, ask for new parameters and retry. - Commit the changes using
DbControl.commit()
.
DbControl.disconnect()
and DbControl.reconnect()
to conserve database resources. You must not close or commit the DbControl
until the configuration is completed.
Note 2! If the returned status of a plugin is Response.Status.DONE
after
an invokation, the Plugin.done()
method is called to let the plugin
clean up resources. If a client application wants to abort earlier it should
use the PluginRequest.done()
method in this class.
- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2015-04-21 09:59:42 +0200 (ti, 21 apr 2015) $
-
Nested Class Summary
Nested classes/interfaces inherited from class net.sf.basedb.core.PluginRequest
PluginRequest.RequestImpl
-
Field Summary
Modifier and TypeFieldDescriptionprivate boolean
private GuiContext
private boolean
private Job.ProgressReporterImpl
-
Constructor Summary
ConstructorDescriptionPluginConfigurationRequest
(SessionControl sc, InteractivePlugin plugin, String command, PluginConfiguration pluginConfiguration, ParameterValuesImpl configurationParameters, Job job, ParameterValuesImpl jobParameters, GuiContext context, PluginDefinition pluginDefinition, boolean allowImmediateExecution) -
Method Summary
Modifier and TypeMethodDescriptionGet the context of the client application when this configuration request was created.Get the request information object containing information about the parameters needed for the plugin.invoke()
Invoke the plugin and let it do it's work.(package private) void
setProgressReporter
(Job.ProgressReporterImpl progress) Methods inherited from class net.sf.basedb.core.PluginRequest
done, getCommand, getCurrentConfigurationParameterValues, getCurrentJobParameterValues, getCurrentParameterValue, getCurrentParameterValues, getJob, getPlugin, getSessionControl, registerParameters, saveParameters, setNextCommand, setParameterValue, setParameterValues
-
Field Details
-
context
-
progress
-
allowImmediateExecution
private boolean allowImmediateExecution -
dryRun
private boolean dryRun
-
-
Constructor Details
-
PluginConfigurationRequest
PluginConfigurationRequest(SessionControl sc, InteractivePlugin plugin, String command, PluginConfiguration pluginConfiguration, ParameterValuesImpl configurationParameters, Job job, ParameterValuesImpl jobParameters, GuiContext context, PluginDefinition pluginDefinition, boolean allowImmediateExecution)
-
-
Method Details
-
invoke
Description copied from class:PluginRequest
Invoke the plugin and let it do it's work. Note that this method doesn't throw any exceptions. If an exception occurs during the execution of a plugin, the response status will be set toResponse.Status.ERROR
and the error messages will be available in thePluginResponse.getMessage()
andPluginResponse.getErrorList()
methods.- Specified by:
invoke
in classPluginRequest<InteractivePlugin>
- Returns:
- A
PluginResponse
object
-
getRequestInformation
Get the request information object containing information about the parameters needed for the plugin.- Returns:
- A
RequestInformation
object - Throws:
BaseException
- If there is an error
-
getGuiContext
Get the context of the client application when this configuration request was created. -
setProgressReporter
-