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.StringArgument
getCompletionNotificationArg()
Returns theStringArgument
corresponding to the email address of a recipient to be notified when the task completes.com.forgerock.opendj.cli.StringArgument
getDependencyArg()
Returns theStringArgument
corresponding 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.String
getDescription()
Gets the description of the task ornull
if there is none.com.forgerock.opendj.cli.StringArgument
getDescriptionArg()
Returns the description of the task.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.FailedDependencyAction
getFailedDependencyAction()
Gets the action to take should one of the dependent task fail.com.forgerock.opendj.cli.StringArgument
getFailedDependencyActionArg()
Returns theStringArgument
corresponding 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.StringArgument
getRecurringArg()
Returns theStringArgument
corresponding to a crontab(5) compatible date/time pattern.String
getRecurringDateTime()
Gets the date/time pattern for recurring task schedule.com.forgerock.opendj.cli.StringArgument
getStartArg()
Returns theStringArgument
corresponding to the scheduled start date/time of the task.Instant
getStartDateTime()
Gets the date at which the associated task should be scheduled to start.String
getTaskId()
Gets the ID of the task ornull
if there is none.com.forgerock.opendj.cli.StringArgument
getTaskIdArg()
Returns ID of the task.boolean
isStartNow()
Whether the arguments provided by the user, indicate that the task should be executed immediately.void
validateArgs()
Validates arguments related to task scheduling.void
validateArgsIfOffline()
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.ClientException
Validates 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.ClientException
Validates 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
public String 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
public String 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
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 andfalse
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 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.
-
-