Class TaskScheduleArgs

java.lang.Object
org.opends.server.tools.tasks.TaskScheduleArgs

public final class TaskScheduleArgs extends Object
A class that contains all the arguments related to the task scheduling.
  • Constructor Details

    • TaskScheduleArgs

      public TaskScheduleArgs()
      Default constructor.
  • Method Details

    • getArguments

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

      public void validateArgs() throws com.forgerock.opendj.cli.ArgumentException, com.forgerock.opendj.cli.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:
      com.forgerock.opendj.cli.ArgumentException - if there is a problem with the arguments.
      com.forgerock.opendj.cli.ClientException - if there is a problem with one of the values provided by the user.
    • validateArgsIfOffline

      public void validateArgsIfOffline() throws com.forgerock.opendj.cli.ArgumentException, com.forgerock.opendj.cli.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:
      com.forgerock.opendj.cli.ArgumentException - if there is a problem with the arguments.
      com.forgerock.opendj.cli.ClientException - if there is a problem with one of the values provided by the user.
    • getTaskId

      public String getTaskId()
      Gets the ID of the task or null if there is none.
      Returns:
      The ID of the task or null if there is none.
    • getDescription

      public String getDescription()
      Gets the description of the task or null if there is none.
      Returns:
      The description of the task or null if there is none.
    • getStartDateTime

      public Instant 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 Collection<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 Collection<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
    • getTaskIdArg

      public com.forgerock.opendj.cli.StringArgument getTaskIdArg()
      Returns ID of the task.
      Returns:
      The ID of the task.
    • getDescriptionArg

      public com.forgerock.opendj.cli.StringArgument getDescriptionArg()
      Returns the description of the task.
      Returns:
      The description of the task.
    • getStartArg

      public com.forgerock.opendj.cli.StringArgument getStartArg()
      Returns the StringArgument corresponding to the scheduled start date/time of the task.
      Returns:
      the StringArgument corresponding to the scheduled start date/time of the task.
    • getRecurringArg

      public com.forgerock.opendj.cli.StringArgument getRecurringArg()
      Returns the StringArgument corresponding to a crontab(5) compatible date/time pattern.
      Returns:
      the StringArgument corresponding to a crontab(5) compatible date/time pattern.
    • getCompletionNotificationArg

      public com.forgerock.opendj.cli.StringArgument getCompletionNotificationArg()
      Returns the StringArgument corresponding to the email address of a recipient to be notified when the task completes.
      Returns:
      the StringArgument corresponding to the email address of a recipient to be notified when the task completes
    • getErrorNotificationArg

      public com.forgerock.opendj.cli.StringArgument getErrorNotificationArg()
      Returns the StringArgument corresponding to the email address of a recipient to be notified if an error occurs when this task executes.
      Returns:
      the StringArgument corresponding to the email address of a recipient to be notified if an error occurs when this task executes.
    • getDependencyArg

      public com.forgerock.opendj.cli.StringArgument getDependencyArg()
      Returns the StringArgument corresponding to the ID of a task upon which this task depends.
      Returns:
      the StringArgument corresponding to the ID of a task upon which this task depends.
    • getFailedDependencyActionArg

      public com.forgerock.opendj.cli.StringArgument getFailedDependencyActionArg()
      Returns the StringArgument corresponding to the action this task will take should one if its dependent tasks fail.
      Returns:
      the StringArgument corresponding to the action this task will take should one if its dependent tasks fail.