mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

jvergara
11.28.2009 7f8ea377760d5da3562a3f2f88001e16a99af7d3
Fix for issue 4167 (Error Reading Configuration with Schema in the control-panel)
The fix consists on extending the ManageTasks class to allow the client to specify whether to initialize the server or not. This is consistent with what is done in other command-lines and is helpful when the class is called from an environment where the Directory Server has already been initialized.
2 files modified
47 ■■■■ changed files
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/CancelTaskTask.java 3 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/server/org/opends/server/tools/ManageTasks.java 44 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/task/CancelTaskTask.java
@@ -219,8 +219,7 @@
        arguments.toArray(args);
        returnCode = ManageTasks.mainTaskInfo(args, System.in,
            outPrintStream, errorPrintStream);
            outPrintStream, errorPrintStream, false);
        if (returnCode != 0)
        {
          break;
opendj-sdk/opends/src/server/org/opends/server/tools/ManageTasks.java
@@ -112,6 +112,27 @@
   *                         {@code null} if standard output is not needed.
   * @param err              The output stream to use for standard error, or
   *                         {@code null} if standard error is not needed.
   * @param initializeServer Indicates whether to initialize the server.
   * @return int return code
   */
  public static int mainTaskInfo(String[] args,
                                 InputStream in,
                                 OutputStream out,
                                 OutputStream err,
                                 boolean initializeServer) {
    ManageTasks tool = new ManageTasks(in, out, err);
    return tool.process(args, initializeServer);
  }
  /**
   * Processes the command-line arguments and invokes the export process.
   *
   * @param args             The command-line arguments provided to this
   * @param in               Input stream from which to solicit user input.
   * @param out              The output stream to use for standard output, or
   *                         {@code null} if standard output is not needed.
   * @param err              The output stream to use for standard error, or
   *                         {@code null} if standard error is not needed.
   * @return int return code
   */
@@ -119,8 +140,7 @@
                                 InputStream in,
                                 OutputStream out,
                                 OutputStream err) {
    ManageTasks tool = new ManageTasks(in, out, err);
    return tool.process(args);
    return mainTaskInfo(args, in, out, err, true);
  }
  private static final int INDENT = 2;
@@ -170,9 +190,25 @@
   *                   program.
   * @return The error code.
   */
  public int process(String[] args) {
  public int process(String[] args)
  {
    return process(args, true);
  }
    DirectoryServer.bootstrapClient();
  /**
   * Processes the command-line arguments and invokes the export process.
   *
   * @param args       The command-line arguments provided to this
   *                   program.
   * @param initializeServer  Indicates whether to initialize the server.
   * @return The error code.
   */
  public int process(String[] args, boolean initializeServer)
  {
    if (initializeServer)
    {
      DirectoryServer.bootstrapClient();
    }
    // Create the command-line argument parser for use with this program.
    LDAPConnectionArgumentParser argParser = new LDAPConnectionArgumentParser(