RequestContext.java revision 80ca0b9f5ad61b2335af25d4dcf25a04ebfcbc91
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: RequestContext.java,v 1.11 2009/04/02 01:16:07 veiming Exp $
*
*/
/*
* Portions Copyrighted 2011 ForgeRock AS
*/
/**
* Request context class contains information about the request.
* This object is passed to sub command handler which services the request.
*/
public class RequestContext {
private CommandManager commandMgr;
private CLIRequest request;
private ResourceBundle rb;
private SubCommand subCommand;
/**
* Creates a request context object.
*
* @param request Request object.
* @param commandMgr Command Manager object.
* @param subcmd Sub Command object.
* @throws CLIException if this object cannot be constructed.
*/
public RequestContext(
) throws CLIException {
this.commandMgr = commandMgr;
subCommand = subcmd;
if (commandMgr.isVerbose()) {
}
if (commandMgr.isVerbose()) {
getResourceString("verbose-validate-mandatory-options"));
}
argv);
}
}
/**
* Returns the <code>CommandManager</code> object.
*
* @return the <code>CommandManager</code> object.
*/
public CommandManager getCommandManager() {
return commandMgr;
}
/**
* Returns CLI Request object.
*
* @return CLI Request object.
*/
public CLIRequest getCLIRequest() {
return request;
}
/**
* Returns sub command object.
*
* @return sub command object.
*/
public SubCommand getSubCommand() {
return subCommand;
}
/**
* Returns resource string.
*
* @param key Key of resource string.
* @return resource string.
*/
}
/**
*
*/
}
/**
*
*/
public Map getOptions() {
return mapOptions;
}
private void parseArgs(
) throws CLIException {
if (parentArgv != null) {
}
}
private void parseParentArgs(
) throws CLIException {
//skip the first index because it is the sub command name.
if (skip > -1) {
i += skip;
} else {
}
if (skip > -1) {
i += skip;
} else {
if (longOption != null) {
} else {
}
}
if (commandMgr.webEnabled()) {
commandMgr.getDebugger()));
} else {
}
}
}
}
private void parseArgs(
) throws CLIException {
//skip the first index because it is the sub command name.
if (skip > -1) {
i += skip;
} else {
}
if (skip > -1) {
i += skip;
} else {
if (longOption == null) {
} else {
}
}
if (commandMgr.webEnabled()) {
commandMgr.getDebugger()));
} else {
}
}
}
}
int skip = -1;
) {
skip = 0;
skip = 1;
}
return skip;
}
int skip = -1;
) {
skip = 0;
skip = 1;
}
return skip;
}
) {
}
}