Package org.opends.server.tools
Class ImportLDIF
- java.lang.Object
-
- org.opends.server.tools.tasks.TaskTool
-
- org.opends.server.tools.ImportLDIF
-
- All Implemented Interfaces:
TaskScheduleInformation
public class ImportLDIF extends TaskTool
This program provides a utility that may be used to import the contents of an LDIF file into a Directory Server backend. This will be a process that is intended to run separate from Directory Server and not internally within the server process (e.g., via the tasks interface).
-
-
Field Summary
-
Fields inherited from class org.opends.server.tools.tasks.TaskTool
NOW, runOfflineArg
-
-
Constructor Summary
Constructors Constructor Description ImportLDIF()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTaskAttributes(List<RawAttribute> attributes)Adds utility specific attributes toattributesfor population of the entry that is added to the task backend.protected voidcleanup()Cleanup task environment after offline run.protected org.forgerock.i18n.LocalizableMessagegetOfflineDescriptionMessage()Class<?>getTaskClass()Gets the Class that implements the utility to execute.StringgetTaskId()Gets an arbitrary task id assigned to this task.StringgetTaskObjectclass()Gets the objectclass used to represent scheduled instances of this utility in the task backend.static voidmain(String[] args)The main method for ImportLDIF tool.static intmainImportLDIF(String[] args, boolean initializeServer, OutputStream outStream, OutputStream errStream)Processes the command-line arguments and invokes the import process.protected intprocessLocal(boolean initializeServer, PrintStream out, PrintStream err)Called when this utility should perform its actions locally in this JVM.-
Methods inherited from class org.opends.server.tools.tasks.TaskTool
checkVersion, createArgParser, getDependencyIds, getFailedDependencyAction, getNotifyUponCompletionEmailAddresses, getNotifyUponErrorEmailAddresses, getRecurringDateTime, getStartDateTime, process, runOffline, validateTaskArgs
-
-
-
-
Method Detail
-
main
public static void main(String[] args)
The main method for ImportLDIF tool.- Parameters:
args- The command-line arguments provided to this program.
-
mainImportLDIF
public static int mainImportLDIF(String[] args, boolean initializeServer, OutputStream outStream, OutputStream errStream)
Processes the command-line arguments and invokes the import process.- Parameters:
args- The command-line arguments provided to this program.initializeServer- Indicates whether to initialize the server.outStream- The output stream to use for standard output, ornullif standard output is not needed.errStream- The output stream to use for standard error, ornullif standard error is not needed.- Returns:
- The error code.
-
getOfflineDescriptionMessage
protected org.forgerock.i18n.LocalizableMessage getOfflineDescriptionMessage()
- Overrides:
getOfflineDescriptionMessagein classTaskTool
-
addTaskAttributes
public void addTaskAttributes(List<RawAttribute> attributes)
Description copied from interface:TaskScheduleInformationAdds utility specific attributes toattributesfor population of the entry that is added to the task backend.- Parameters:
attributes- that will be added to the task backend
-
getTaskObjectclass
public String getTaskObjectclass()
Description copied from interface:TaskScheduleInformationGets the objectclass used to represent scheduled instances of this utility in the task backend.- Returns:
- String representation of this utilities objectclass
-
getTaskClass
public Class<?> getTaskClass()
Description copied from interface:TaskScheduleInformationGets the Class that implements the utility to execute.- Returns:
- class of the tasks implementation
-
processLocal
protected int processLocal(boolean initializeServer, PrintStream out, PrintStream err)Description copied from class:TaskToolCalled when this utility should perform its actions locally in this JVM.- Specified by:
processLocalin classTaskTool- Parameters:
initializeServer- indicates whether 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 null- Returns:
- int indicating the result of this action
-
cleanup
protected void cleanup()
Description copied from class:TaskToolCleanup task environment after offline run. Default implementation does nothing. Tasks which initialize some static part of the DirectoryServer instance (e.g admin data local backends) must override this method to shutdown all needed component to prevent JVM environment alteration.
-
getTaskId
public String getTaskId()
Description copied from interface:TaskScheduleInformationGets an arbitrary task id assigned to this task.- Returns:
- assigned task id if any or
nullotherwise.
-
-