Package net.sf.basedb.core.plugin
Class NamespaceRequestWrapper
- java.lang.Object
-
- net.sf.basedb.core.plugin.NamespaceRequestWrapper
-
- All Implemented Interfaces:
Request
public class NamespaceRequestWrapper extends Object implements Request
A helper class that wraps a request object with a namespace. All parameter reading operations will be made to the specified namespace. Eg, the 'name' parameter is replaced with the namespace + dot + the original name. For example, if namespace="export" and name="toDir", the resulting name is "export.toDir". If the parameter doesn't exists, the global namespace is checked. (eg. toDir). All other methods simply forward to the same method of the parent object.The main usage for this class is when a master plug-in needs to use other child plug-ins. By wrapping the request with an instance of this class it makes it possible to forward the request to the child plug-in without having to worry about name clashes among the children.
- Since:
- 2.15
- Author:
- nicklas
- See Also:
NamespaceParameterValuesWrapper
,NamespacePluginParameter
- Last modified
- $Date $
-
-
Field Summary
Fields Modifier and Type Field Description private String
namespace
private Request
parent
-
Fields inherited from interface net.sf.basedb.core.plugin.Request
COMMAND_CONFIGURE_JOB, COMMAND_CONFIGURE_PLUGIN, COMMAND_EXECUTE
-
-
Constructor Summary
Constructors Constructor Description NamespaceRequestWrapper(Request parent, String namespace)
Create a new namespace wrapper for the parent request.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getCommand()
The 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.Serializable
getState()
Get state information that was previously saved byResponse.setPause(String, String, java.io.Serializable)
orResponse.setContinue(String, java.io.Serializable)
.boolean
isAllowedImmediateExecution()
If this plugin has been allowed immediate execution or not.
-
-
-
Method Detail
-
getCommand
public String getCommand()
Description copied from interface:Request
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.- Specified by:
getCommand
in interfaceRequest
-
getState
public Serializable getState()
Description copied from interface:Request
Get state information that was previously saved byResponse.setPause(String, String, java.io.Serializable)
orResponse.setContinue(String, java.io.Serializable)
.
-
getParameterValue
public <T> T getParameterValue(String name) throws ParameterException
Description copied from interface:Request
Get the value for the parameter with the specified name.- Specified by:
getParameterValue
in interfaceRequest
- 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.
-
getParameterValues
public <T> List<T> getParameterValues(String name)
Description copied from interface:Request
Get the values for the parameter with the specified name.- Specified by:
getParameterValues
in interfaceRequest
- Parameters:
name
- The name of the parameter- Returns:
- An object with the value, or null if no value is given
-
isAllowedImmediateExecution
public boolean isAllowedImmediateExecution()
Description copied from interface:Request
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)
.- Specified by:
isAllowedImmediateExecution
in interfaceRequest
- Returns:
- TRUE if it is allowed, FALSE otherwise
-
-