public abstract class TaskTool extends Object implements TaskScheduleInformation
| Modifier and Type | Field and Description |
|---|---|
static 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.
|
| Constructor and Description |
|---|
TaskTool() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkVersion()
Checks that binary version and instance version are the same.
|
protected LDAPConnectionArgumentParser |
createArgParser(String className,
LocalizableMessage toolDescription)
Creates an argument parser prepopulated with arguments for processing
input for scheduling tasks with the task backend.
|
List<String> |
getDependencyIds()
Gets a list of task IDs upon which this task is dependent.
|
FailedDependencyAction |
getFailedDependencyAction()
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.
|
String |
getRecurringDateTime()
Gets the date/time pattern for recurring task schedule.
|
Date |
getStartDateTime()
Gets the date at which this task should be scheduled to start.
|
protected int |
process(LDAPConnectionArgumentParser argParser,
boolean initializeServer,
PrintStream out,
PrintStream err)
Either invokes initiates this tool's local action or schedule this
tool using the tasks interface based on user input.
|
protected abstract int |
processLocal(boolean initializeServer,
PrintStream out,
PrintStream err)
Called when this utility should perform its actions locally in this
JVM.
|
boolean |
testIfOffline()
Indicates whether we must return if the command must be run in off-line
mode.
|
protected void |
validateTaskArgs()
Validates arguments related to task scheduling.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddTaskAttributes, getTaskClass, getTaskId, getTaskObjectclasspublic static final String NOW
public TaskTool()
protected abstract int processLocal(boolean initializeServer, PrintStream out, PrintStream err)
initializeServer - indicates whether or not to initialize the
directory server in the case of a local actionout - stream to write messages; may be nullerr - stream to write messages; may be nullprotected LDAPConnectionArgumentParser createArgParser(String className, LocalizableMessage toolDescription)
className - of this tooltoolDescription - of this toolprotected void validateTaskArgs() throws com.forgerock.opendj.cli.ArgumentException, com.forgerock.opendj.cli.ClientException
ArgumentParser.parseArguments has
been called.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.public Date getStartDateTime()
getStartDateTime in interface TaskScheduleInformationpublic String getRecurringDateTime()
getRecurringDateTime in interface TaskScheduleInformationpublic List<String> getDependencyIds()
getDependencyIds in interface TaskScheduleInformationpublic FailedDependencyAction getFailedDependencyAction()
getFailedDependencyAction in interface TaskScheduleInformationpublic List<String> getNotifyUponCompletionEmailAddresses()
getNotifyUponCompletionEmailAddresses in interface TaskScheduleInformationpublic List<String> getNotifyUponErrorEmailAddresses()
getNotifyUponErrorEmailAddresses in interface TaskScheduleInformationprotected int process(LDAPConnectionArgumentParser argParser, boolean initializeServer, PrintStream out, PrintStream err)
argParser - used to parse user argumentsinitializeServer - indicates whether or not to initialize the
directory server in the case of a local actionout - stream to write messages; may be nullerr - stream to write messages; may be nullpublic boolean testIfOffline()
true if we must return if the command must be run in
off-line mode and false otherwise.protected void checkVersion() throws InitializationException
InitializationException - If versions mismatchCopyright © 2010-2015 ForgeRock AS. All Rights Reserved.