Class TaskScheduleArgs
- java.lang.Object
-
- org.opends.server.admin.client.cli.TaskScheduleArgs
-
public class TaskScheduleArgs extends Object
A class that contains all the arguments related to the task scheduling.
-
-
Field Summary
Fields Modifier and Type Field Description StringArgumentcompletionNotificationArgArgument for specifying completion notifications.StringArgumentdependencyArgArgument for specifying dependency.StringArgumenterrorNotificationArgArgument for specifying error notifications.StringArgumentfailedDependencyActionArgArgument for specifying a failed dependency action.static StringNOWMagic 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.StringArgumentrecurringArgArgument to indicate a recurring task.StringArgumentstartArgArgument for describing the task's start time.
-
Constructor Summary
Constructors Constructor Description TaskScheduleArgs()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Argument[]getArguments()Returns all the task schedule related arguments.List<String>getDependencyIds()Gets a list of task IDs upon which the associated task is dependent.FailedDependencyActiongetFailedDependencyAction()Gets the action to take should one of the dependent task fail.List<String>getNotifyUponCompletionEmailAddresses()Gets a list of email address to which an email will be sent when this task completes.List<String>getNotifyUponErrorEmailAddresses()Gets a list of email address to which an email will be sent if this task encounters an error during execution.StringgetRecurringDateTime()Gets the date/time pattern for recurring task schedule.DategetStartDateTime()Gets the date at which the associated task should be scheduled to start.booleanisStartNow()Whether the arguments provided by the user, indicate that the task should be executed immediately.voidvalidateArgs()Validates arguments related to task scheduling.voidvalidateArgsIfOffline()Validates arguments related to 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.
-
-
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, ClientExceptionValidates arguments related to task scheduling. This should be called after theArgumentParser.parseArgumentshas 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 methodvalidateArgsIfOffline()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, ClientExceptionValidates arguments related to task scheduling. This should be called after theArgumentParser.parseArgumentshas been called.
This method assumes that the operation is not to be launched as a task. This method covers all the checks done byvalidateArgs(), 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:
trueif the task must be executed immediately andfalseotherwise.
-
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
-
-