Package net.sf.basedb.core.plugin
Interface Request
- All Known Implementing Classes:
ExternalProgramExecutor.RequestWrapper
,NamespaceRequestWrapper
,PluginRequest.RequestImpl
public interface Request
Pass request information to a plugin. Objects implementing
this interface are used by the core to pass information to a
plugin in the
There are three predefind request commands that all plugins understands, those three are
Plugin.run(Request, Response, ProgressReporter)
method. Commands are used to tell the plugin what kind of information
the user want to pass to the plugin.
There are three predefind request commands that all plugins understands, those three are
COMMAND_CONFIGURE_JOB
,
COMMAND_CONFIGURE_PLUGIN
and
COMMAND_EXECUTE
. The configuration setup starts by giving the
plugin the command COMMAND_CONFIGURE_PLUGIN
and it will be saved in the PluginConfiguration
that instantiated the plugin. The starting command for setting the job parameters are the
COMMAND_CONFIGURE_PLUGIN
command.
After the request have been invoked the plugin will respond with a Response
.
The status of the respond will tell the Job
how to proceed.
Plugin defined commands are not allowed to use strings that begins with
an underscore("_"). Strings starting with an underscore is reserved for the
Base 2 system.
- Version:
- 2.0
- Author:
- Nicklas, Samuel, Enell
- Last modified
- $Date$
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
This should be the first command to use when setting the plugin's job parameters.static final String
This should be the first command to use when setting the plugin's configuration.static final String
This command will tell the plugin to start its execution. -
Method Summary
Modifier and TypeMethodDescriptionThe command the plugin should execute.<T> T
getParameterValue
(String name) Get the value for the parameter with the specified name.<T> List<T>
getParameterValues
(String name) Get the values for the parameter with the specified name.getState()
Get state information that was previously saved byResponse.setPause(String, String, java.io.Serializable)
orResponse.setContinue(String, java.io.Serializable)
.boolean
If this plugin has been allowed immediate execution or not.
-
Field Details
-
COMMAND_CONFIGURE_PLUGIN
This should be the first command to use when setting the plugin's configuration.- See Also:
-
COMMAND_CONFIGURE_JOB
This should be the first command to use when setting the plugin's job parameters.- See Also:
-
COMMAND_EXECUTE
This command will tell the plugin to start its execution.- See Also:
-
-
Method Details
-
getCommand
String getCommand()The command the plugin should execute. This value is one of the predefined constants above, or some other value that is supported by the specific plugin. -
getState
Serializable getState()Get state information that was previously saved byResponse.setPause(String, String, java.io.Serializable)
orResponse.setContinue(String, java.io.Serializable)
.- Returns:
- The state information or null
- Since:
- 3.11
-
getParameterValues
Get the values for the parameter with the specified name.- Parameters:
name
- The name of the parameter- Returns:
- An object with the value, or null if no value is given
-
getParameterValue
Get the value for the parameter with the specified name.- Parameters:
name
- The name of the parameter- Returns:
- An object with the value, or null if no value is given
- Throws:
ParameterException
- If getting the value fails.
-
isAllowedImmediateExecution
boolean isAllowedImmediateExecution()If this plugin has been allowed immediate execution or not. If this is true the plugin may end a job configuration sequence withResponse.setExecuteImmediately(String, Job.ExecutionTime, boolean)
or, if the plugin is aImmediateDownloadExporter
,Response.setDownloadImmediately(String, Job.ExecutionTime, boolean)
.- Returns:
- TRUE if it is allowed, FALSE otherwise
- Since:
- 2.2
-