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
-
Method Summary
Modifier and TypeMethodDescriptioncom.forgerock.opendj.cli.Argument[]
Returns all the task schedule related arguments.com.forgerock.opendj.cli.StringArgument
Returns theStringArgument
corresponding to the email address of a recipient to be notified when the task completes.com.forgerock.opendj.cli.StringArgument
Returns theStringArgument
corresponding 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 ornull
if there is none.com.forgerock.opendj.cli.StringArgument
Returns the description of the task.com.forgerock.opendj.cli.StringArgument
Returns theStringArgument
corresponding 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.StringArgument
Returns theStringArgument
corresponding 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.StringArgument
Returns theStringArgument
corresponding to a crontab(5) compatible date/time pattern.Gets the date/time pattern for recurring task schedule.com.forgerock.opendj.cli.StringArgument
Returns theStringArgument
corresponding 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 ornull
if there is none.com.forgerock.opendj.cli.StringArgument
Returns ID of the task.boolean
Whether the arguments provided by the user, indicate that the task should be executed immediately.void
Validates arguments related to task scheduling.void
Validates 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.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 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.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 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 ornull
if there is none.- Returns:
- The ID of the task or
null
if there is none.
-
getDescription
Gets the description of the task ornull
if there is none.- Returns:
- The description of the task or
null
if 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:
true
if the task must be executed immediately andfalse
otherwise.
-
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 theStringArgument
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 theStringArgument
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 theStringArgument
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 theStringArgument
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 theStringArgument
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 theStringArgument
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.
-