|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.core.PluginRequest<P>
abstract class PluginRequest<P extends Plugin>
Configures or executes a plugin. You will get an instance of a subclass to this class when:
PluginConfiguration.configure()
Job.configure(GuiContext)
Job.execute(ProgressReporter, String)
PluginConfigurationRequest
,
PluginExecutionRequest
Nested Class Summary | |
---|---|
(package private) class |
PluginRequest.RequestImpl
An implementation of the Request interface
that is passed to the plugin. |
Field Summary | |
---|---|
private String |
command
|
private ParameterValuesImpl |
configurationParameters
|
private Job |
job
|
private ParameterValuesImpl |
jobParameters
|
private Map<String,PluginParameter<?>> |
parameterInfo
|
private P |
plugin
|
private PluginConfiguration |
pluginConfiguration
|
private PluginDefinition |
pluginDefinition
|
private Map<String,List<?>> |
requestParameters
|
private SessionControl |
sc
|
Constructor Summary | |
---|---|
PluginRequest(PluginRequest<? extends P> copyFrom,
String command)
|
|
PluginRequest(SessionControl sc,
P plugin,
String command,
PluginConfiguration pluginConfiguration,
ParameterValuesImpl configurationParameters,
Job job,
ParameterValuesImpl jobParameters,
PluginDefinition pluginDefinition)
|
Method Summary | |
---|---|
void |
done()
Aborts the execution of the plugin. |
String |
getCommand()
Get the command this request will issue to the plugin when invoke() is called. |
List<?> |
getCurrentConfigurationParameterValues(String name)
Get the values that are currently stored in the plugin configuration related to this request. |
List<?> |
getCurrentJobParameterValues(String name)
Get the values that are currently stored in the job related to this request. |
Object |
getCurrentParameterValue(String name)
|
List<?> |
getCurrentParameterValues(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(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(String command)
Sets the next command in a configuration sequence. |
void |
setParameterValue(String name,
Object value)
Set the value of a request parameter to a single value. |
void |
setParameterValues(String name,
List<?> values)
Set the value of a request parameter to a list of values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final SessionControl sc
private String command
private final Map<String,List<?>> requestParameters
private final P extends Plugin plugin
private final ParameterValuesImpl configurationParameters
private final PluginConfiguration pluginConfiguration
private final PluginDefinition pluginDefinition
private final ParameterValuesImpl jobParameters
private final Map<String,PluginParameter<?>> parameterInfo
private final Job job
Constructor Detail |
---|
PluginRequest(SessionControl sc, P plugin, String command, PluginConfiguration pluginConfiguration, ParameterValuesImpl configurationParameters, Job job, ParameterValuesImpl jobParameters, PluginDefinition pluginDefinition)
PluginRequest(PluginRequest<? extends P> copyFrom, String command)
Method Detail |
---|
public SessionControl getSessionControl()
public String getCommand()
invoke()
is called.
public void setParameterValue(String name, Object value)
RequestInformation
object.
name
- The name of the parametervalue
- The value of the parameterPluginConfigurationRequest.getRequestInformation()
public void setParameterValues(String name, List<?> values)
RequestInformation
object.
name
- The name of the parametervalues
- The values of the parameterPluginConfigurationRequest.getRequestInformation()
public Object getCurrentParameterValue(String name)
public List<?> getCurrentParameterValues(String name)
name
- The name of the parameter
public List<?> getCurrentConfigurationParameterValues(String name)
name
- The name of the parameter
public List<?> getCurrentJobParameterValues(String name)
name
- The name of the parameter
public 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(List<PluginParameter<?>> parameters)
ParameterValuesImpl.saveParameters(Job, Map)
method.
parameters
- void saveParameters(DbControl dc, GuiContext context)
void setNextCommand(String command)
public P getPlugin()
Job getJob()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |