Package org.opends.server.tasks
Class InitializeTask
java.lang.Object
org.opends.server.backends.task.Task
org.opends.server.tasks.InitializeTask
- All Implemented Interfaces:
Comparable<Task>
This class provides an implementation of a Directory Server task that can be used to import data over the replication
protocol from another server hosting the same replication domain.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.opends.server.backends.task.Task
Task.WorkCounters
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionGets a message that identifies this type of task suitable for presentation to humans in monitoring tools.Returns the work counters for the initialization operation.void
initializeTask
(Entry taskEntry) Performs any task-specific initialization that may be required before processing can start.void
interruptTask
(TaskState interruptState, LocalizableMessage interruptReason) Performs any necessary processing to prematurely interrupt the execution of this task.void
retry
(LdapException reason) The task was not successful but can be retried, set the state accordingly.protected TaskState
runTask()
Performs the actual core processing for this task.void
Set the state for the current task.Methods inherited from class org.opends.server.backends.task.Task
addLogMessage, compareTo, execute, getAttributeDisplayName, getCompletionTime, getDependencyIDs, getFailedDependencyAction, getFinalTaskState, getLogMessages, getOperation, getRecurringTaskID, getScheduledStartTime, getServerContext, getTaskID, getTaskName, getTaskState, initializeTask, initializeTaskInternal, isInterruptible, isRecurring, replaceAttributes, sendNotificationEMailMessage, setCompletionTime, setEntriesLeftAndDone, setOperation, setTaskInterruptState, toString
-
Constructor Details
-
InitializeTask
public InitializeTask()
-
-
Method Details
-
getDisplayName
Description copied from class:Task
Gets a message that identifies this type of task suitable for presentation to humans in monitoring tools.- Overrides:
getDisplayName
in classTask
- Returns:
- name of task
-
initializeTask
Description copied from class:Task
Performs any task-specific initialization that may be required before processing can start. This default implementation does not do anything, but subclasses may override it as necessary. This method will be called at the time the task is scheduled, and therefore any failure in this method will be returned to the client.- Overrides:
initializeTask
in classTask
- Parameters:
taskEntry
- the task entry- Throws:
LdapException
- If a problem occurs during initialization that should be returned to the client.
-
runTask
Description copied from class:Task
Performs the actual core processing for this task. This method should not return until all processing associated with this task has completed. -
interruptTask
Description copied from class:Task
Performs any necessary processing to prematurely interrupt the execution of this task. By default no action is performed, but if it is feasible to gracefully interrupt a task, then subclasses should override this method to do so. Implementations of this method are expected to callTask.setTaskInterruptState(TaskState)
if the interruption is accepted by this task.- Overrides:
interruptTask
in classTask
- Parameters:
interruptState
- The state to use for the task if it is successfully interrupted.interruptReason
- A human-readable explanation for the cancellation.
-
updateTaskCompletionState
Set the state for the current task.- Parameters:
e
- When the new state is different from COMPLETED_SUCCESSFULLY this is the exception that contains the cause of the failure.
-
retry
The task was not successful but can be retried, set the state accordingly.- Parameters:
reason
- this is the exception that contains the reason for the retry
-
getWorkCounters
Returns the work counters for the initialization operation.- Returns:
- the work counters for the initialization operation
-