Last update: 2011-06-23

org.proteios.core
Class PluginExecutionRequest

java.lang.Object
  extended by org.proteios.core.PluginExecutionRequest

public final class PluginExecutionRequest
extends Object

Executes a job. You will get an instance of this class when:

  1. You want to execute a job: Job.execute(ProgressReporter, String)
You should use the following protocol:
  1. Close your currently opened DbControl if you doesn't need it and you expect that the job takes a long time to execute. The job will open it's own connection(s) to the database.
  2. Call invoke() to start executing of the job.
  3. Check the PluginResponse and display a user-friendly message.
Note! You do not have to call the done() method, it is called automatically by the core once the job has finished executing.

Version:
2.0
Author:
Nicklas
Last modified
$Date: 2009-04-09 08:48:11 +0200 (Thu, 09 Apr 2009) $

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)
           
 List<?> getCurrentJobParameterValues(String name)
           
 List<?> getCurrentParameterValues(String name)
           
 PluginResponse invoke()
          Invoke the plugin and let it do it's work.
 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
 

Method Detail

invoke

public PluginResponse invoke()
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 to Response.Status.ERROR and the error messages will be available in the PluginResponse.getMessage() and PluginResponse.getErrorList() methods.

Returns:
A PluginResponse object

getCommand

public String getCommand()
Get the command this request will issue to the plugin when invoke() is called.


setParameterValue

public void setParameterValue(String name,
                              Object value)
Set the value of a request parameter to a single value. Normally a plugin validates the value using the information available in the RequestInformation object.

Parameters:
name - The name of the parameter
value - The value of the parameter
See Also:
PluginConfigurationRequest.getRequestInformation()

setParameterValues

public void setParameterValues(String name,
                               List<?> values)
Set the value of a request parameter to a list of values. Normally a plugin validates the value using the information available in the RequestInformation object.

Parameters:
name - The name of the parameter
values - The values of the parameter
See Also:
PluginConfigurationRequest.getRequestInformation()

getCurrentParameterValues

public List<?> getCurrentParameterValues(String name)

getCurrentConfigurationParameterValues

public List<?> getCurrentConfigurationParameterValues(String name)

getCurrentJobParameterValues

public List<?> getCurrentJobParameterValues(String name)

done

public void done()
Aborts the execution of the plugin.


Last update: 2011-06-23