Package org.opends.server.tools
Class ExportLdif
java.lang.Object
com.forgerock.opendj.cli.Tool
org.opends.server.tools.ExportLdif
- All Implemented Interfaces:
Closeable,AutoCloseable,TaskToolHelper.TaskCommand
public final class ExportLdif
extends com.forgerock.opendj.cli.Tool
implements TaskToolHelper.TaskCommand
This program provides a utility that may be used to export the contents of a Directory Server backend to an LDIF
file. Depending on the arguments given, this program will either perform the export directly as a process that runs
separate from Directory Server; or by scheduling a task to perform the action within the Directory Server via the
tasks interface.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.forgerock.opendj.cli.Tool
com.forgerock.opendj.cli.Tool.Style -
Method Summary
Modifier and TypeMethodDescriptionReturns the task implementation.static voidThe main method forExportLdiftool.static com.forgerock.opendj.cli.ReturnCodemainExportLdif(String[] args, ServerContext serverContext, PrintStream outStream, PrintStream errStream) Processes the command-line arguments and invokes the export process.com.forgerock.opendj.cli.ReturnCodeRuns the command in offline mode.com.forgerock.opendj.cli.ReturnCodeRun thisTooltool with the provided arguments.Methods inherited from class com.forgerock.opendj.cli.Tool
askPort, close, confirmAction, enableConsoleLoggingIfVerbose, errPrintln, errPrintln, errPrintln, errPrintlnSurroundedByBlankLines, errPrintVerboseMessage, flush, flushLogStream, getErrorStream, getErrStream, getInputStream, getOutputStream, isFullyInteractive, isQuiet, isScriptFriendly, isVerbose, logVerboseMessage, mayPrompt, parseArguments, pressReturnToContinue, print, println, println, println, printlnNoWrap, printlnSurroundedByBlankLines, printNoWrap, readInput, readInput, readInputAllowEmpty, readLineOfInput, readPassword, readValidatedInput, readValidatedInputOrThrow, reportMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.opends.server.tools.tasks.TaskToolHelper.TaskCommand
validateArguments
-
Method Details
-
main
The main method forExportLdiftool.- Parameters:
args- The command-line arguments provided to this program.
-
mainExportLdif
public static com.forgerock.opendj.cli.ReturnCode mainExportLdif(String[] args, ServerContext serverContext, PrintStream outStream, PrintStream errStream) Processes the command-line arguments and invokes the export process.- Parameters:
args- The command-line arguments provided to this program.serverContext- The server context, ornullif the tool should initialize the server context itself.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 return code.
-
run
public com.forgerock.opendj.cli.ReturnCode run(String... args) throws com.forgerock.opendj.cli.ClientException Description copied from class:com.forgerock.opendj.cli.ToolRun thisTooltool with the provided arguments. Output and errors will be written on the provided streams.This method can be used to run the tool programmatically.
- Overrides:
runin classcom.forgerock.opendj.cli.Tool- Parameters:
args- Arguments set to pass to the tool.- Returns:
0if all processing completed successfully, or non-zero if an error occurred.- Throws:
com.forgerock.opendj.cli.ClientException- If an error occurs while running the tool.
-
getTaskImplementation
Description copied from interface:TaskToolHelper.TaskCommandReturns the task implementation.- Specified by:
getTaskImplementationin interfaceTaskToolHelper.TaskCommand- Returns:
- the task implementation
-
processLocal
public com.forgerock.opendj.cli.ReturnCode processLocal() throws com.forgerock.opendj.cli.ClientExceptionDescription copied from interface:TaskToolHelper.TaskCommandRuns the command in offline mode.- Specified by:
processLocalin interfaceTaskToolHelper.TaskCommand- Returns:
- the return code.
- Throws:
com.forgerock.opendj.cli.ClientException- If an error occurs.
-