Class RebuildIndex

java.lang.Object
com.forgerock.opendj.cli.Tool
org.opends.server.tools.RebuildIndex
All Implemented Interfaces:
Closeable, AutoCloseable, TaskToolHelper.TaskCommand

public final class RebuildIndex extends com.forgerock.opendj.cli.Tool implements TaskToolHelper.TaskCommand
This program provides a utility to rebuild the contents of the indexes of 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).
  • Nested Class Summary

    Nested classes/interfaces inherited from class com.forgerock.opendj.cli.Tool

    com.forgerock.opendj.cli.Tool.Style
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The value for the rebuild all long option.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new RebuildIndex with the provided output and error OutputStreams.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Force indexes to be marked untrusted instead of rebuilt.
    Returns the task implementation.
    static void
    main(String[] args)
    Processes the command-line arguments and invokes the rebuild process.
    com.forgerock.opendj.cli.ReturnCode
    Runs the command in offline mode.
    static void
    rebuildIndexEmbeddedOffline(com.forgerock.opendj.cli.ArgumentsBuilder arguments, PrintStream outStream, PrintStream errStream)
    This method is used for running the rebuild-index tool programmatically against an offline server.
    com.forgerock.opendj.cli.ReturnCode
    This function allow internal use of the rebuild index tools.
    com.forgerock.opendj.cli.ReturnCode
    run(String... args)
    Run this Tool tool 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, report

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.opends.server.tools.tasks.TaskToolHelper.TaskCommand

    validateArguments
  • Field Details

    • OPTION_LONG_REBUILD_ALL

      public static final String OPTION_LONG_REBUILD_ALL
      The value for the rebuild all long option.
      See Also:
  • Constructor Details

  • Method Details

    • main

      public static void main(String[] args)
      Processes the command-line arguments and invokes the rebuild process.
      Parameters:
      args - The command-line arguments provided to this program.
    • rebuildIndexEmbeddedOffline

      public static void rebuildIndexEmbeddedOffline(com.forgerock.opendj.cli.ArgumentsBuilder arguments, PrintStream outStream, PrintStream errStream) throws com.forgerock.opendj.cli.ClientException
      This method is used for running the rebuild-index tool programmatically against an offline server.

      The --offline and --noPropertyFile arguments are automatically added to the tool arguments.
      Rebuilding indexes offline implies that the DirectoryServer will be initialized.

      Parameters:
      arguments - The command-line arguments provided to this program
      outStream - The output stream to use for standard output, or null if standard output is not needed
      errStream - The output stream to use for standard error, or null if standard error is not needed
      Throws:
      com.forgerock.opendj.cli.ClientException - If an error occurs during the tool execution or if the tool has returned an error
    • run

      public com.forgerock.opendj.cli.ReturnCode run(String... args) throws com.forgerock.opendj.cli.ClientException
      Description copied from class: com.forgerock.opendj.cli.Tool
      Run this Tool tool 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:
      run in class com.forgerock.opendj.cli.Tool
      Parameters:
      args - Arguments set to pass to the tool.
      Returns:
      0 if 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.
    • processLocal

      public com.forgerock.opendj.cli.ReturnCode processLocal() throws com.forgerock.opendj.cli.ClientException
      Description copied from interface: TaskToolHelper.TaskCommand
      Runs the command in offline mode.
      Specified by:
      processLocal in interface TaskToolHelper.TaskCommand
      Returns:
      the return code.
      Throws:
      com.forgerock.opendj.cli.ClientException - If an error occurs.
    • forceUntrustedMode

      public void forceUntrustedMode()
      Force indexes to be marked untrusted instead of rebuilt.
    • rebuildIndexesWithinMultipleBackends

      public com.forgerock.opendj.cli.ReturnCode rebuildIndexesWithinMultipleBackends(Collection<String> args)
      This function allow internal use of the rebuild index tools. This function rebuilds indexes shared by multiple backends.
      Parameters:
      args - The arguments used to launch the rebuild index process.
      Returns:
      The return code of this action.
    • getTaskImplementation

      public TaskScheduleInformation.TaskImplementation getTaskImplementation()
      Description copied from interface: TaskToolHelper.TaskCommand
      Returns the task implementation.
      Specified by:
      getTaskImplementation in interface TaskToolHelper.TaskCommand
      Returns:
      the task implementation