Class TaskScheduleArgs


  • public class TaskScheduleArgs
    extends Object
    A class that contains all the arguments related to the task scheduling.
    • Field Detail

      • NOW

        public static final String NOW
        Magic value used to indicate that the user would like to schedule this operation to run immediately as a task as opposed to running the operation in the local VM.
        See Also:
        Constant Field Values
      • startArg

        public StringArgument startArg
        Argument for describing the task's start time.
      • recurringArg

        public StringArgument recurringArg
        Argument to indicate a recurring task.
      • completionNotificationArg

        public StringArgument completionNotificationArg
        Argument for specifying completion notifications.
      • errorNotificationArg

        public StringArgument errorNotificationArg
        Argument for specifying error notifications.
      • dependencyArg

        public StringArgument dependencyArg
        Argument for specifying dependency.
      • failedDependencyActionArg

        public StringArgument failedDependencyActionArg
        Argument for specifying a failed dependency action.
    • Constructor Detail

      • TaskScheduleArgs

        public TaskScheduleArgs()
        Default constructor.
    • Method Detail

      • getArguments

        public Argument[] getArguments()
        Returns all the task schedule related arguments.
        Returns:
        all the task schedule related arguments.
      • validateArgs

        public void validateArgs()
                          throws ArgumentException,
                                 ClientException
        Validates arguments related to task scheduling. This should be called after the ArgumentParser.parseArguments has been called.
        Note that this method does only validation that is not dependent on whether the operation will be launched as a task or not. If the operation is not to be launched as a task, the method validateArgsIfOffline() should be called instead of this method.
        Throws:
        ArgumentException - if there is a problem with the arguments.
        ClientException - if there is a problem with one of the values provided by the user.
      • validateArgsIfOffline

        public void validateArgsIfOffline()
                                   throws ArgumentException,
                                          ClientException
        Validates arguments related to task scheduling. This should be called after the ArgumentParser.parseArguments has been called.
        This method assumes that the operation is not to be launched as a task. This method covers all the checks done by validateArgs(), so it is not necessary to call that method if this method is being called.
        Throws:
        ArgumentException - if there is a problem with the arguments.
        ClientException - if there is a problem with one of the values provided by the user.
      • getStartDateTime

        public Date getStartDateTime()
        Gets the date at which the associated task should be scheduled to start.
        Returns:
        date/time at which the task should be scheduled
      • isStartNow

        public boolean isStartNow()
        Whether the arguments provided by the user, indicate that the task should be executed immediately.
        This method assumes that the arguments have already been parsed and validated.
        Returns:
        true if the task must be executed immediately and false otherwise.
      • getRecurringDateTime

        public String getRecurringDateTime()
        Gets the date/time pattern for recurring task schedule.
        Returns:
        recurring date/time pattern at which the task should be scheduled.
      • getDependencyIds

        public List<String> getDependencyIds()
        Gets a list of task IDs upon which the associated task is dependent.
        Returns:
        list of task IDs
      • getFailedDependencyAction

        public FailedDependencyAction getFailedDependencyAction()
        Gets the action to take should one of the dependent task fail.
        Returns:
        action to take
      • getNotifyUponCompletionEmailAddresses

        public List<String> getNotifyUponCompletionEmailAddresses()
        Gets a list of email address to which an email will be sent when this task completes.
        Returns:
        list of email addresses
      • getNotifyUponErrorEmailAddresses

        public List<String> getNotifyUponErrorEmailAddresses()
        Gets a list of email address to which an email will be sent if this task encounters an error during execution.
        Returns:
        list of email addresses