java.lang.Object | |
↳ | com.microstrategy.web.tasks.AbstractBaseTask |
Abstract base class for building Task
objects. This
class provides support for managing an ID (String) along with the task
metadata. It also provides support for adding "common" task parameters
to your task implementation (see addSessionStateParam(boolean, String)
and others).
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
int | DEFAULT_MAX_WAIT | The default value to use for max wait (in ms) | |||||||||
int | DEFAULT_POLLING_FREQ | The default value to use for polling frequency (in ms). | |||||||||
int | INDEFINITE_MAX_WAIT | The value that indicates an indefinite wait. | |||||||||
String | OTHER_CONTENT_KEY_LAYOUTS | The name of the other content key that refers to the JUIL JS Layouts. | |||||||||
String | PARAM_NAME_EXEC_FLAGS | The name of the task parameter that identifies the Execution Flags to set. | |||||||||
String | PARAM_NAME_MAX_WAIT | The name of the task parameter that identifies the maximum wait for getting results (in ms). | |||||||||
String | PARAM_NAME_MESSAGE_ID | The name of the task parameter that identifies the message ID | |||||||||
String | PARAM_NAME_OBJECT_ID | The name of the task parameter that identifies the object ID | |||||||||
String | PARAM_NAME_POLLING_FREQ | The name of the task parameter that identifies the polling frequency (in ms) | |||||||||
String | PARAM_NAME_RESULT_FLAGS | The name of the task parameter that identifies the Result Flags to set. | |||||||||
String | PARAM_NAME_SESSION_ID | The name of the task parameter that identifies the IServer session ID. | |||||||||
String | PARAM_NAME_SESSION_STATE | The name of the task parameter that identifies the IServer session state. | |||||||||
String | PARAM_NAME_STATE_ID | The name of the task parameter that identifies the State ID. | |||||||||
String | PREFERENCE_DEFAULT_MAX_WAIT_IN_TASK | Preference that defines the maximum amount of time (in milliseconds) that a task will wait for the execution results in synchronous mode. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
protected boolean | compressOutput | ||||||||||
protected TaskParameterMetadata | execFlagsParam | The task parameter for execution flags. | |||||||||
protected WebPrivilegesExpression | mPrivileges | We store here the task privileges. | |||||||||
protected TaskParameterMetadata | maxWaitParam | The task parameter for maximum wait. | |||||||||
protected TaskMetadataImpl | metadata | The metadata associated with this task (and its parameters). | |||||||||
protected TaskParameterMetadata | msgIDParam | The task parameter for message ID. | |||||||||
protected TaskParameterMetadata | objectIDParam | The task parameter for object ID. | |||||||||
protected TaskParameterMetadata | pollingFreqParam | The task parameter for polling frequency. | |||||||||
protected TaskParameterMetadata | resultFlagsParam | The task parameter for result flags. | |||||||||
protected TaskParameterMetadata | sessionIDParam | The task parameter for session ID. | |||||||||
protected TaskParameterMetadata | sessionStateParam | The task parameter for session State. | |||||||||
protected TaskParameterMetadata | stateIDParam | The task parameter for state ID. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AbstractBaseTask(String desc)
Creates a new AbstractBaseTask object.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
destroy()
Destroys the Task.
| ||||||||||
boolean | getCompressOutput() | ||||||||||
String |
getID()
Returns the identifier of this Task.
| ||||||||||
TaskMetadata |
getMetadata()
Returns information about this Task.
| ||||||||||
WebPrivilegesExpression |
getPrivileges()
Returns a task privileges
| ||||||||||
void |
init(ContainerServices containerSvcs)
Initializes the Task with the specified
ContainerServices
object. | ||||||||||
TaskRequestContext |
newRequestContext()
Returns a new object to hold per-request data for this Task.
| ||||||||||
void |
processRequest(TaskRequestContext context, MarkupOutput markupOutput)
The default implementation of this version of processRequest is empty.
| ||||||||||
void |
processRequest(TaskRequestContext context, TaskOutput taskOutput)
The default implementation of this method of processRequest gets the Primary Content
from the TaskOutput and invokes the
processRequest(TaskRequestContext, MarkupOutput)
version. | ||||||||||
void | setCompressOutput(boolean newValue) | ||||||||||
void |
setID(String id)
Sets the identifier for this Task.
| ||||||||||
void |
setPrivileges(WebPrivilegesExpression value)
Sets the task privileges.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void |
addExecFlagsParam(boolean required, String defValue)
Adds a execution flags parameter to this task's definition.
| ||||||||||
void |
addJuilLayouts(TaskOutput taskOutput)
Adds any referenced Juil layouts to the task payload.
| ||||||||||
void |
addMaxWaitParam(boolean required, int maxWait)
Adds a maximum wait parameter to this task's definition.
| ||||||||||
void |
addMaxWaitParam(boolean required)
Adds a maximum wait parameter to this task's definition with a
default value specified by sys default preference
PREFERENCE_DEFAULT_MAX_WAIT_IN_TASK . | ||||||||||
void |
addMessageIDParam(boolean required, String defValue)
Adds a message ID parameter to this task's definition.
| ||||||||||
void |
addObjectIDParam(boolean required, String defValue)
Adds an object ID parameter to this task's definition.
| ||||||||||
void |
addParameterMetadata(TaskParameterMetadataImpl paramMetadataImpl)
This method is deprecated.
Use
addParameterMetadata(String, String, boolean, Object) instead.
| ||||||||||
TaskParameterMetadata |
addParameterMetadata(String name, String desc, boolean required, Object defValue, String type, String validator)
Adds the metadata for a parameter.
| ||||||||||
TaskParameterMetadata |
addParameterMetadata(String name, String desc, boolean required, Object defValue)
Adds the metadata for a parameter.
| ||||||||||
void |
addPollingFrequencyParam(boolean required, int pollingFreq)
Adds a polling frequency parameter to this task's definition.
| ||||||||||
void |
addPollingFrequencyParam(boolean required)
Adds a polling frequency parameter to this task's definition
with a default value specified by
DEFAULT_POLLING_FREQ . | ||||||||||
void |
addResultFlagsParam(boolean required, String defValue)
Adds a results flags parameter to this task's definition.
| ||||||||||
void |
addSessionIDParam(boolean required, String defValue)
Adds a session ID parameter to this task's definition.
| ||||||||||
void |
addSessionStateParam(boolean required, String defValue)
Adds a session state parameter to this task's definition.
| ||||||||||
void |
addStateIDParam(boolean required, String defValue)
Adds a state ID parameter to this task's definition.
| ||||||||||
void |
checkForRequiredParameters(RequestKeys requestKeys)
Checks whether all required parameters are present or not.
| ||||||||||
String |
getSysDefaultPreferenceValue(String name)
Returns the value of a sys default preference
| ||||||||||
PostedFile | retrieveUploadedFile(TaskRequestContext context, String fileFieldName) | ||||||||||
void |
setDescription(String desc)
Sets the description for this task.
| ||||||||||
void |
setMetadata(TaskMetadataImpl metadata)
This method is deprecated.
It is prefered to use
addParameterMetadata(String, String, boolean, Object) .
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
The default value to use for max wait (in ms)
The default value to use for polling frequency (in ms).
The value that indicates an indefinite wait.
The name of the other content key that refers to the JUIL JS Layouts.
The name of the task parameter that identifies the Execution Flags to set.
The name of the task parameter that identifies the maximum wait for getting results (in ms).
The name of the task parameter that identifies the message ID
The name of the task parameter that identifies the object ID
The name of the task parameter that identifies the polling frequency (in ms)
The name of the task parameter that identifies the Result Flags to set.
The name of the task parameter that identifies the IServer session ID.
The name of the task parameter that identifies the IServer session state.
The name of the task parameter that identifies the State ID.
Preference that defines the maximum amount of time (in milliseconds) that a task will wait for the execution results in synchronous mode.
We store here the task privileges. They will be verified when the task obtains a session
Creates a new AbstractBaseTask object.
desc | The (textual) description of this task. |
---|
Destroys the Task. This enables the Task to release any persistent data structures.
Returns the identifier of this Task.
Returns information about this Task. It includes the description of the Task and any parameters which it supports.
TaskMetadata
object for this Task.
Initializes the Task with the specified ContainerServices
object.
containerSvcs | The ContainerServices object.
|
---|
Returns a new object to hold per-request data for this Task.
TaskRequestContext
object for this Task.
The default implementation of this version of processRequest is empty. Task implementators may override either version of processRequest.
context | The TaskRequestContext object that maintains
the state of the request. |
---|---|
markupOutput | The MarkupOutput that records the contents
of the Task response. |
TaskException |
---|
The default implementation of this method of processRequest gets the Primary Content
from the TaskOutput and invokes the processRequest(TaskRequestContext, MarkupOutput)
version.
context | The TaskRequestContext object that maintains
the state of the request. |
---|---|
taskOutput | The TaskOutput that contains the output
generated by the Task. |
TaskException |
---|
Sets the identifier for this Task.
id | The ID to use for this Task. |
---|
Sets the task privileges. The privileges will be verified when the task obtains a session
value | The privilege expression |
---|
Adds a execution flags parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
Adds any referenced Juil layouts to the task payload.
taskOutput | The TaskOutput to add the Juil layouts to. |
---|
Adds a maximum wait parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
maxWait | Identifies the default value to use. |
Adds a maximum wait parameter to this task's definition with a
default value specified by sys default preference PREFERENCE_DEFAULT_MAX_WAIT_IN_TASK
.
required | Indicates whether this parameter is required or not. |
---|
Adds a message ID parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
Adds an object ID parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
This method is deprecated.
Use addParameterMetadata(String, String, boolean, Object)
instead.
Adds a task parameter metadata object (to fully describe the parameter).
paramMetadataImpl | The TaskParameterMetadataImpl
object. |
---|
Adds the metadata for a parameter.
name | The name of the parameter. |
---|---|
desc | The description of the parameter. |
required | Whether the parameter is required or not. |
defValue | The default value associated with the parameter, if none is supplied when the task invoked. |
type | The data type of the parameter. |
validator | The validator to check whether the value for the parameter is valid. |
Adds the metadata for a parameter.
name | The name of the parameter. |
---|---|
desc | The description of the parameter. |
required | Whether the parameter is required or not. |
defValue | The default value associated with the parameter, if none is supplied when the task invoked. |
Adds a polling frequency parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
pollingFreq | Identifies the default value to use. |
Adds a polling frequency parameter to this task's definition
with a default value specified by DEFAULT_POLLING_FREQ
.
required | Indicates whether this parameter is required or not. |
---|
Adds a results flags parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
Adds a session ID parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
Adds a session state parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
Adds a state ID parameter to this task's definition.
required | Indicates whether this parameter is required or not. |
---|---|
defValue | Identifies the default value to use. |
Checks whether all required parameters are present or not.
requestKeys | The RequestKeys object that contains all
parameters. |
---|
TaskRequestMalformedException | If some required parameters are missing. |
---|
Returns the value of a sys default preference
name | the preference's name |
---|
Sets the description for this task.
desc | The description of the task. |
---|
This method is deprecated.
It is prefered to use addParameterMetadata(String, String, boolean, Object)
.
Sets the metadata for this task.
metadata | The TaskMetadataImpl object for this
task. |
---|