Class AbstractBaseTask

    • Field Detail

      • mPrivileges

        protected WebPrivilegesExpression mPrivileges
        We store here the task privileges. They will be verified when the task obtains a session
      • PARAM_NAME_SESSION_STATE

        public static final java.lang.String PARAM_NAME_SESSION_STATE
        The name of the task parameter that identifies the IServer session state.
        See Also:
        Constant Field Values
      • PARAM_NAME_SESSION_ID

        public static final java.lang.String PARAM_NAME_SESSION_ID
        The name of the task parameter that identifies the IServer session ID.
        See Also:
        Constant Field Values
      • PARAM_NAME_RESULT_FLAGS

        protected static final java.lang.String PARAM_NAME_RESULT_FLAGS
        The name of the task parameter that identifies the Result Flags to set.
        See Also:
        Constant Field Values
      • PARAM_NAME_MAX_WAIT

        protected static final java.lang.String PARAM_NAME_MAX_WAIT
        The name of the task parameter that identifies the maximum wait for getting results (in ms).
        See Also:
        Constant Field Values
      • PARAM_NAME_POLLING_FREQ

        protected static final java.lang.String PARAM_NAME_POLLING_FREQ
        The name of the task parameter that identifies the polling frequency (in ms)
        See Also:
        Constant Field Values
      • PARAM_NAME_MESSAGE_ID

        protected static final java.lang.String PARAM_NAME_MESSAGE_ID
        The name of the task parameter that identifies the message ID
        See Also:
        Constant Field Values
      • PARAM_NAME_OBJECT_ID

        protected static final java.lang.String PARAM_NAME_OBJECT_ID
        The name of the task parameter that identifies the object ID
        Since:
        MicroStrategy Web 8.1.1
        See Also:
        Constant Field Values
      • PARAM_NAME_EXEC_FLAGS

        protected static final java.lang.String PARAM_NAME_EXEC_FLAGS
        The name of the task parameter that identifies the Execution Flags to set.
        Since:
        MicroStrategy Web 8.1.1
        See Also:
        Constant Field Values
      • PARAM_NAME_STATE_ID

        protected static final java.lang.String PARAM_NAME_STATE_ID
        The name of the task parameter that identifies the State ID.
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • OTHER_CONTENT_KEY_LAYOUTS

        public static final java.lang.String OTHER_CONTENT_KEY_LAYOUTS
        The name of the other content key that refers to the JUIL JS Layouts.
        Since:
        MicroStrategy Web 9.0.0
        See Also:
        Constant Field Values
      • DEFAULT_MAX_WAIT

        protected static final int DEFAULT_MAX_WAIT
        The default value to use for max wait (in ms)
        See Also:
        Constant Field Values
      • INDEFINITE_MAX_WAIT

        protected static final int INDEFINITE_MAX_WAIT
        The value that indicates an indefinite wait.
        See Also:
        Constant Field Values
      • DEFAULT_POLLING_FREQ

        protected static final int DEFAULT_POLLING_FREQ
        The default value to use for polling frequency (in ms).
        See Also:
        Constant Field Values
      • PREFERENCE_DEFAULT_MAX_WAIT_IN_TASK

        protected static final java.lang.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.
        Since:
        MicroStrategy Web 8.1.2
        See Also:
        Constant Field Values
      • compressOutput

        protected boolean compressOutput
      • CONTENT_TYPE_JSON

        public static final java.lang.String CONTENT_TYPE_JSON
        See Also:
        Constant Field Values
      • CONTENT_TYPE_JSON_P

        public static final java.lang.String CONTENT_TYPE_JSON_P
        See Also:
        Constant Field Values
      • CONTENT_TYPE_JSON_D

        public static final java.lang.String CONTENT_TYPE_JSON_D
        See Also:
        Constant Field Values
      • CONTENT_TYPE_JSON_ALL

        public static final java.lang.String[] CONTENT_TYPE_JSON_ALL
      • CONTENT_TYPE_XML

        public static final java.lang.String CONTENT_TYPE_XML
        See Also:
        Constant Field Values
      • CONTENT_TYPE_XML_ANF

        public static final java.lang.String CONTENT_TYPE_XML_ANF
        See Also:
        Constant Field Values
      • CONTENT_TYPE_HTML

        public static final java.lang.String CONTENT_TYPE_HTML
        See Also:
        Constant Field Values
      • CONTENT_TYPE_BINARY

        public static final java.lang.String CONTENT_TYPE_BINARY
        See Also:
        Constant Field Values
      • metadata

        protected TaskMetadataImpl metadata
        The metadata associated with this task (and its parameters).
      • pollingFreqParam

        protected TaskParameterMetadata pollingFreqParam
        The task parameter for polling frequency.
      • resultFlagsParam

        protected TaskParameterMetadata resultFlagsParam
        The task parameter for result flags.
      • sessionStateParam

        protected TaskParameterMetadata sessionStateParam
        The task parameter for session State.
      • objectIDParam

        protected TaskParameterMetadata objectIDParam
        The task parameter for object ID.
        Since:
        MicroStrategy Web 8.1.1
      • execFlagsParam

        protected TaskParameterMetadata execFlagsParam
        The task parameter for execution flags.
        Since:
        MicroStrategy Web 8.1.1
      • stateIDParam

        protected TaskParameterMetadata stateIDParam
        The task parameter for state ID.
        Since:
        MicroStrategy Web 9.0.0
    • Constructor Detail

      • AbstractBaseTask

        public AbstractBaseTask​(java.lang.String desc)
        Creates a new AbstractBaseTask object.
        Parameters:
        desc - The (textual) description of this task.
    • Method Detail

      • destroy

        public void destroy()
        Description copied from interface: Task
        Destroys the Task. This enables the Task to release any persistent data structures.
        Specified by:
        destroy in interface Task
      • getID

        public java.lang.String getID()
        Description copied from interface: Task
        Returns the identifier of this Task.
        Specified by:
        getID in interface Task
        Returns:
        The identifier of this Task.
      • setID

        public void setID​(java.lang.String id)
        Description copied from interface: Task
        Sets the identifier for this Task.
        Specified by:
        setID in interface Task
        Parameters:
        id - The ID to use for this Task.
      • getMetadata

        public TaskMetadata getMetadata()
        Description copied from interface: Task
        Returns information about this Task. It includes the description of the Task and any parameters which it supports.
        Specified by:
        getMetadata in interface Task
        Returns:
        A TaskMetadata object for this Task.
      • getCompressOutput

        public boolean getCompressOutput()
        Specified by:
        getCompressOutput in interface Task
      • setCompressOutput

        public void setCompressOutput​(boolean newValue)
        Specified by:
        setCompressOutput in interface Task
      • addParameterMetadata

        protected TaskParameterMetadata addParameterMetadata​(java.lang.String name,
                                                             java.lang.String desc,
                                                             boolean required,
                                                             java.lang.Object defValue)
        Adds the metadata for a parameter.
        Parameters:
        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.
        Since:
        MicroStrategy Web 9.0.0
      • addParameterMetadata

        protected TaskParameterMetadata addParameterMetadata​(java.lang.String name,
                                                             java.lang.String desc,
                                                             boolean required,
                                                             java.lang.Object defValue,
                                                             java.lang.String type,
                                                             java.lang.String validator)
        Adds the metadata for a parameter.
        Parameters:
        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.
      • setDescription

        protected void setDescription​(java.lang.String desc)
        Sets the description for this task.
        Parameters:
        desc - The description of the task.
      • addPollingFrequencyParam

        protected void addPollingFrequencyParam​(boolean required,
                                                int pollingFreq)
        Adds a polling frequency parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        pollingFreq - Identifies the default value to use.
      • addPollingFrequencyParam

        protected void addPollingFrequencyParam​(boolean required)
        Adds a polling frequency parameter to this task's definition with a default value specified by DEFAULT_POLLING_FREQ.
        Parameters:
        required - Indicates whether this parameter is required or not.
      • addMaxWaitParam

        protected void addMaxWaitParam​(boolean required,
                                       int maxWait)
        Adds a maximum wait parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        maxWait - Identifies the default value to use.
      • addMaxWaitParam

        protected 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.
        Parameters:
        required - Indicates whether this parameter is required or not.
      • getSysDefaultPreferenceValue

        protected java.lang.String getSysDefaultPreferenceValue​(java.lang.String name)
        Returns the value of a sys default preference
        Parameters:
        name - the preference's name
        Returns:
        the value of a sys default preference
        Since:
        MicroStrategy Web 8.1.2
      • addResultFlagsParam

        protected void addResultFlagsParam​(boolean required,
                                           java.lang.String defValue)
        Adds a results flags parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
      • addSessionIDParam

        protected void addSessionIDParam​(boolean required,
                                         java.lang.String defValue)
        Adds a session ID parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
      • addSessionStateParam

        protected void addSessionStateParam​(boolean required,
                                            java.lang.String defValue)
        Adds a session state parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
      • addMessageIDParam

        protected void addMessageIDParam​(boolean required,
                                         java.lang.String defValue)
        Adds a message ID parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
      • addObjectIDParam

        protected void addObjectIDParam​(boolean required,
                                        java.lang.String defValue)
        Adds an object ID parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
        Since:
        MicroStrategy Web 8.1.1
      • addExecFlagsParam

        protected void addExecFlagsParam​(boolean required,
                                         java.lang.String defValue)
        Adds a execution flags parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
        Since:
        MicroStrategy Web 8.1.1
      • addStateIDParam

        protected void addStateIDParam​(boolean required,
                                       java.lang.String defValue)
        Adds a state ID parameter to this task's definition.
        Parameters:
        required - Indicates whether this parameter is required or not.
        defValue - Identifies the default value to use.
        Since:
        MicroStrategy Web 9.0.0
      • addJuilLayouts

        protected void addJuilLayouts​(TaskOutput taskOutput)
        Adds any referenced Juil layouts to the task payload.
        Parameters:
        taskOutput - The TaskOutput to add the Juil layouts to.
        Since:
        MicroStrategy Web 9.0.0
      • setPrivileges

        public void setPrivileges​(WebPrivilegesExpression value)
        Description copied from interface: Task
        Sets the task privileges. The privileges will be verified when the task obtains a session
        Specified by:
        setPrivileges in interface Task
        Parameters:
        value - The privilege expression