Package org.opends.server.tools.tasks
Class TaskScheduleArgs
- java.lang.Object
-
- org.opends.server.tools.tasks.TaskScheduleArgs
-
public class TaskScheduleArgs extends Object
A class that contains all the arguments related to the task scheduling.
-
-
Constructor Summary
Constructors Constructor Description TaskScheduleArgs()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.forgerock.opendj.cli.Argument[]getArguments()Returns all the task schedule related arguments.com.forgerock.opendj.cli.StringArgumentgetCompletionNotificationArg()Returns theStringArgumentcorresponding to the email address of a recipient to be notified when the task completes.com.forgerock.opendj.cli.StringArgumentgetDependencyArg()Returns theStringArgumentcorresponding to the ID of a task upon which this task depends.List<String>getDependencyIds()Gets a list of task IDs upon which the associated task is dependent.StringgetDescription()Gets the description of the task ornullif there is none.com.forgerock.opendj.cli.StringArgumentgetDescriptionArg()Returns the description of the task.com.forgerock.opendj.cli.StringArgumentgetErrorNotificationArg()Returns theStringArgumentcorresponding to the email address of a recipient to be notified if an error occurs when this task executes.FailedDependencyActiongetFailedDependencyAction()Gets the action to take should one of the dependent task fail.com.forgerock.opendj.cli.StringArgumentgetFailedDependencyActionArg()Returns theStringArgumentcorresponding to the action this task will take should one if its dependent tasks fail.Collection<String>getNotifyUponCompletionEmailAddresses()Gets a list of email address to which an email will be sent when this task completes.Collection<String>getNotifyUponErrorEmailAddresses()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.StringArgumentgetRecurringArg()Returns theStringArgumentcorresponding to a crontab(5) compatible date/time pattern.StringgetRecurringDateTime()Gets the date/time pattern for recurring task schedule.com.forgerock.opendj.cli.StringArgumentgetStartArg()Returns theStringArgumentcorresponding to the scheduled start date/time of the task.InstantgetStartDateTime()Gets the date at which the associated task should be scheduled to start.StringgetTaskId()Gets the ID of the task ornullif there is none.com.forgerock.opendj.cli.StringArgumentgetTaskIdArg()Returns ID of the task.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.
-
-
-
Method Detail
-
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
public String getTaskId()
Gets the ID of the task ornullif there is none.- Returns:
- The ID of the task or
nullif there is none.
-
getDescription
public String getDescription()
Gets the description of the task ornullif there is none.- Returns:
- The description of the task or
nullif 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:
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 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 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.
-
-