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

Matthew Swift
21.43.2012 7a6f3dd0c046db02a9cebddd7e635c2189e378ff
opends/src/quicksetup/org/opends/quicksetup/upgrader/UpgradeLauncher.java
@@ -23,12 +23,13 @@
 *
 *
 *      Copyright 2007-2010 Sun Microsystems, Inc.
 *      Portions Copyright 2011 ForgeRock AS
 *      Portions Copyright 2011-2012 ForgeRock AS
 */
package org.opends.quicksetup.upgrader;
import org.opends.messages.Message;
import static org.opends.messages.AdminToolMessages.*;
import static org.opends.messages.QuickSetupMessages.*;
import static org.opends.messages.ToolMessages.*;
@@ -106,6 +107,7 @@
  private StringArgument file;
  private BooleanArgument quiet;
  private BooleanArgument noPrompt;
  private BooleanArgument forceOnError;
  private BooleanArgument verbose;
  private BooleanArgument revertMostRecent;
  private StringArgument reversionArchive;
@@ -211,6 +213,17 @@
  }
  /**
   * Tells whether the user specified to force on non critical error in the non
   * interactive mode.
   * @return <CODE>true</CODE> if the user specified to force on
   * non critical error and <CODE>false</CODE> otherwise.
   */
  public boolean isForceOnError()
  {
    return forceOnError.isPresent();
  }
  /**
   * Indicates whether this invocation is intended to upgrade the current
   * build as opposed to revert.
   * @return boolean where true indicates upgrade
@@ -348,6 +361,14 @@
              INFO_UPGRADE_DESCRIPTION_NO_PROMPT.get());
      argParser.addArgument(noPrompt);
      forceOnError = new BooleanArgument(
          "forceOnError",
          null,
          "forceOnError",
          INFO_UPGRADE_DESCRIPTION_FORCE.get(
              "--"+noPrompt.getLongIdentifier()));
      argParser.addArgument(forceOnError);
      quiet = new BooleanArgument(
              OPTION_LONG_QUIET,
              OPTION_SHORT_QUIET,
@@ -392,6 +413,16 @@
          }
        }
        if (!noPrompt.isPresent() && forceOnError.isPresent())
        {
          Message message =
              ERR_UNINSTALL_FORCE_REQUIRES_NO_PROMPT.get("--"
                  + forceOnError.getLongIdentifier(), "--"
                  + noPrompt.getLongIdentifier());
          System.err.println(message);
          System.exit(ReturnCode.APPLICATION_ERROR.getReturnCode());
        }
      } catch (ArgumentException ae) {
        System.err.println(ae.getMessageObject());
        printUsage(false);