abstract class PluginRequest<P extends Plugin>
extends java.lang.Object
PluginConfiguration.configure()
Job.configure(GuiContext)
Job.execute(ProgressReporter, String)
PluginConfigurationRequest
,
PluginExecutionRequest
Modifier and Type | Class and Description |
---|---|
(package private) class |
PluginRequest.RequestImpl
An implementation of the
Request interface
that is passed to the plugin. |
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
command |
private ParameterValuesImpl |
configurationParameters |
private Job |
job |
private ParameterValuesImpl |
jobParameters |
private java.util.Map<java.lang.String,PluginParameter<?>> |
parameterInfo |
private P |
plugin |
private PluginConfiguration |
pluginConfiguration |
private PluginDefinition |
pluginDefinition |
private java.util.Map<java.lang.String,java.util.List<?>> |
requestParameters |
private SessionControl |
sc |
Constructor and Description |
---|
PluginRequest(PluginRequest<? extends P> copyFrom,
java.lang.String command) |
PluginRequest(SessionControl sc,
P plugin,
java.lang.String command,
PluginConfiguration pluginConfiguration,
ParameterValuesImpl configurationParameters,
Job job,
ParameterValuesImpl jobParameters,
PluginDefinition pluginDefinition) |
Modifier and Type | Method and Description |
---|---|
void |
done()
Aborts the execution of the plugin.
|
java.lang.String |
getCommand()
Get the command this request will issue to the plugin when
invoke() is called. |
java.util.List<?> |
getCurrentConfigurationParameterValues(java.lang.String name)
Get the values that are currently stored in the plugin configuration
related to this request.
|
java.util.List<?> |
getCurrentJobParameterValues(java.lang.String name)
Get the values that are currently stored in the job related to this
request.
|
java.lang.Object |
getCurrentParameterValue(java.lang.String name) |
java.util.List<?> |
getCurrentParameterValues(java.lang.String name)
Get the values that are currently stored in the job or plugin configuration
related to this request.
|
(package private) Job |
getJob()
Get the job for the request or null if we are not configuring/executing a job.
|
P |
getPlugin()
Get the plugin object.
|
SessionControl |
getSessionControl() |
abstract PluginResponse |
invoke()
Invoke the plugin and let it do it's work.
|
(package private) void |
registerParameters(java.util.List<PluginParameter<?>> parameters)
Keep track of all parameters so that we can save label and
description in the
ParameterValuesImpl.saveParameters(Job, Map)
method. |
(package private) void |
saveParameters(DbControl dc,
GuiContext context)
Save all parameters that have got values in this request/response session.
|
(package private) void |
setNextCommand(java.lang.String command)
Sets the next command in a configuration sequence.
|
void |
setParameterValue(java.lang.String name,
java.lang.Object value)
Set the value of a request parameter to a single value.
|
void |
setParameterValues(java.lang.String name,
java.util.List<?> values)
Set the value of a request parameter to a list of values.
|
private final SessionControl sc
private java.lang.String command
private final java.util.Map<java.lang.String,java.util.List<?>> requestParameters
private final ParameterValuesImpl configurationParameters
private final PluginConfiguration pluginConfiguration
private final PluginDefinition pluginDefinition
private final ParameterValuesImpl jobParameters
private final java.util.Map<java.lang.String,PluginParameter<?>> parameterInfo
private final Job job
PluginRequest(SessionControl sc, P plugin, java.lang.String command, PluginConfiguration pluginConfiguration, ParameterValuesImpl configurationParameters, Job job, ParameterValuesImpl jobParameters, PluginDefinition pluginDefinition)
PluginRequest(PluginRequest<? extends P> copyFrom, java.lang.String command)
public SessionControl getSessionControl()
public java.lang.String getCommand()
invoke()
is called.public void setParameterValue(java.lang.String name, java.lang.Object value)
RequestInformation
object.name
- The name of the parametervalue
- The value of the parameterPluginConfigurationRequest.getRequestInformation()
public void setParameterValues(java.lang.String name, java.util.List<?> values)
RequestInformation
object.name
- The name of the parametervalues
- The values of the parameterPluginConfigurationRequest.getRequestInformation()
public java.lang.Object getCurrentParameterValue(java.lang.String name)
public java.util.List<?> getCurrentParameterValues(java.lang.String name)
name
- The name of the parameterpublic java.util.List<?> getCurrentConfigurationParameterValues(java.lang.String name)
name
- The name of the parameterpublic java.util.List<?> getCurrentJobParameterValues(java.lang.String name)
name
- The name of the parameterpublic abstract PluginResponse invoke()
Response.Status.ERROR
and
the error messages will be available in the
PluginResponse.getMessage()
and
PluginResponse.getErrorList()
methods.PluginResponse
objectpublic void done()
void registerParameters(java.util.List<PluginParameter<?>> parameters)
ParameterValuesImpl.saveParameters(Job, Map)
method.parameters
- void saveParameters(DbControl dc, GuiContext context)
void setNextCommand(java.lang.String command)
public P getPlugin()
Job getJob()