| | |
| | | * |
| | | * |
| | | * 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.*; |
| | |
| | | private StringArgument file; |
| | | private BooleanArgument quiet; |
| | | private BooleanArgument noPrompt; |
| | | private BooleanArgument forceOnError; |
| | | private BooleanArgument verbose; |
| | | private BooleanArgument revertMostRecent; |
| | | private StringArgument reversionArchive; |
| | |
| | | } |
| | | |
| | | /** |
| | | * 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 |
| | |
| | | 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, |
| | |
| | | |
| | | } |
| | | } |
| | | |
| | | 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); |