Package org.opends.server.tools.tasks
Class TaskScheduleArgs
java.lang.Object
org.opends.server.tools.tasks.TaskScheduleArgs
A class that contains all the arguments related to the task scheduling.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.forgerock.opendj.cli.Argument[]Returns all the task schedule related arguments.com.forgerock.opendj.cli.StringArgumentReturns theStringArgumentcorresponding to the email address of a recipient to be notified when the task completes.com.forgerock.opendj.cli.StringArgumentReturns theStringArgumentcorresponding to the ID of a task upon which this task depends.Gets a list of task IDs upon which the associated task is dependent.Gets the description of the task ornullif there is none.com.forgerock.opendj.cli.StringArgumentReturns the description of the task.com.forgerock.opendj.cli.StringArgumentReturns theStringArgumentcorresponding to the email address of a recipient to be notified if an error occurs when this task executes.Gets the action to take should one of the dependent task fail.com.forgerock.opendj.cli.StringArgumentReturns theStringArgumentcorresponding to the action this task will take should one if its dependent tasks fail.Gets a list of email address to which an email will be sent when this task completes.Gets a list of email address to which an email will be sent if this task encounters an error during execution.com.forgerock.opendj.cli.StringArgumentReturns theStringArgumentcorresponding to a crontab(5) compatible date/time pattern.Gets the date/time pattern for recurring task schedule.com.forgerock.opendj.cli.StringArgumentReturns theStringArgumentcorresponding to the scheduled start date/time of the task.Gets the date at which the associated task should be scheduled to start.Gets the ID of the task ornullif there is none.com.forgerock.opendj.cli.StringArgumentReturns ID of the task.booleanWhether the arguments provided by the user, indicate that the task should be executed immediately.voidValidates arguments related to task scheduling.voidValidates arguments related to 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.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:
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.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:
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
Gets the ID of the task ornullif there is none.- Returns:
- The ID of the task or
nullif there is none.
-
getDescription
Gets the description of the task ornullif there is none.- Returns:
- The description of the task or
nullif there is none.
-
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
Gets the date/time pattern for recurring task schedule.- Returns:
- recurring date/time pattern at which the task should be scheduled.
-
getDependencyIds
Gets a list of task IDs upon which the associated task is dependent.- Returns:
- list of task IDs
-
getFailedDependencyAction
Gets the action to take should one of the dependent task fail.- Returns:
- action to take
-
getNotifyUponCompletionEmailAddresses
Gets a list of email address to which an email will be sent when this task completes.- Returns:
- list of email addresses
-
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 theStringArgumentcorresponding to the scheduled start date/time of the task.- Returns:
- the
StringArgumentcorresponding to the scheduled start date/time of the task.
-
getRecurringArg
public com.forgerock.opendj.cli.StringArgument getRecurringArg()Returns theStringArgumentcorresponding to a crontab(5) compatible date/time pattern.- Returns:
- the
StringArgumentcorresponding to a crontab(5) compatible date/time pattern.
-
getCompletionNotificationArg
public com.forgerock.opendj.cli.StringArgument getCompletionNotificationArg()Returns theStringArgumentcorresponding to the email address of a recipient to be notified when the task completes.- Returns:
- the
StringArgumentcorresponding to the email address of a recipient to be notified when the task completes
-
getErrorNotificationArg
public com.forgerock.opendj.cli.StringArgument getErrorNotificationArg()Returns theStringArgumentcorresponding to the email address of a recipient to be notified if an error occurs when this task executes.- Returns:
- the
StringArgumentcorresponding 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 theStringArgumentcorresponding to the ID of a task upon which this task depends.- Returns:
- the
StringArgumentcorresponding to the ID of a task upon which this task depends.
-
getFailedDependencyActionArg
public com.forgerock.opendj.cli.StringArgument getFailedDependencyActionArg()Returns theStringArgumentcorresponding to the action this task will take should one if its dependent tasks fail.- Returns:
- the
StringArgumentcorresponding to the action this task will take should one if its dependent tasks fail.
-