org.opends.server.tasks
Class ImportTask

java.lang.Object
  extended by org.opends.server.backends.task.Task
      extended by org.opends.server.tasks.ImportTask
All Implemented Interfaces:
java.lang.Comparable<Task>

public class ImportTask
extends Task

This class provides an implementation of a Directory Server task that can be used to import data from an LDIF file into a backend.


Constructor Summary
ImportTask()
           
 
Method Summary
 Message getAttributeDisplayName(java.lang.String name)
          Given an attribute type name returns and locale sensitive representation.
 Message getDisplayName()
          Gets a message that identifies this type of task suitable for presentation to humans in monitoring tools.
 void initializeTask()
          Performs any task-specific initialization that may be required before processing can start.
 void interruptTask(TaskState interruptState, Message interruptReason)
          Performs any necessary processing to prematurely interrupt the execution of this task.
 boolean isInterruptable()
          Indicates whether or not this task is interruptable or not.
protected  TaskState runTask()
          Performs the actual core processing for this task.
 
Methods inherited from class org.opends.server.backends.task.Task
addLogMessage, compareTo, execute, getActualStartTime, getCompletionTime, getDependencyIDs, getFailedDependencyAction, getFinalTaskState, getLogMessages, getNotifyOnCompletionAddresses, getNotifyOnErrorAddresses, getOperation, getRecurringTaskID, getScheduledStartTime, getTaskEntry, getTaskEntryDN, getTaskID, getTaskInterruptState, getTaskState, initializeTaskInternal, isCancelled, logError, replaceAttributeValue, setOperation, setTaskInterruptState
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImportTask

public ImportTask()
Method Detail

getDisplayName

public Message getDisplayName()
Gets a message that identifies this type of task suitable for presentation to humans in monitoring tools.

Overrides:
getDisplayName in class Task
Returns:
name of task

getAttributeDisplayName

public Message getAttributeDisplayName(java.lang.String name)
Given an attribute type name returns and locale sensitive representation.

Overrides:
getAttributeDisplayName in class Task
Parameters:
name - of an attribute type associated with the object class that represents this entry in the directory
Returns:
Message diaplay name

initializeTask

public void initializeTask()
                    throws DirectoryException
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 class Task
Throws:
DirectoryException - If a problem occurs during initialization that should be returned to the client.

interruptTask

public void interruptTask(TaskState interruptState,
                          Message interruptReason)
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 exprected to call Task.setTaskInterruptState(TaskState) if the interruption is accepted by this task.

Overrides:
interruptTask in class Task
Parameters:
interruptState - The state to use for the task if it is successfully interrupted.
interruptReason - A human-readable explanation for the cancellation.

isInterruptable

public boolean isInterruptable()
Indicates whether or not this task is interruptable or not.

Overrides:
isInterruptable in class Task
Returns:
boolean where true indicates that this task can be interrupted.

runTask

protected TaskState runTask()
Performs the actual core processing for this task. This method should not return until all processing associated with this task has completed.

Specified by:
runTask in class Task
Returns:
The final state to use for the task.