use of com.sun.enterprise.admin.util.CommandModelData in project Payara by payara.
the class RemoteCLICommand method prepare.
@Override
protected void prepare() throws CommandException, CommandValidationException {
try {
processProgramOptions();
initializeAuth();
/*
* Now we have all the information we need to create
* the remote admin command object.
*/
initializeRemoteAdminCommand();
if (responseFormatType != null) {
rac.setResponseFormatType(responseFormatType);
}
if (userOut != null) {
rac.setUserOut(userOut);
}
/*
* Initialize a CookieManager so that we can retreive
* any cookies included in the reply. These cookies
* (e.g. JSESSIONID, JROUTE) are used for CLI session
* based routing.
*/
initializeCookieManager();
/*
* If this is a help request, we don't need the command
* metadata and we throw away all the other options and
* fake everything else.
*/
if (programOpts.isHelp()) {
CommandModelData cm = new CommandModelData(name);
cm.add(new ParamModelData("help", boolean.class, true, "false", "?"));
this.commandModel = cm;
rac.setCommandModel(cm);
return;
}
/*
* Find the metadata for the command.
*/
commandModel = rac.getCommandModel();
} catch (CommandException cex) {
if (logger.isLoggable(Level.FINER))
logger.finer("RemoteCommand.prepare throws " + cex);
throw cex;
} catch (Exception e) {
if (logger.isLoggable(Level.FINER))
logger.finer("RemoteCommand.prepare throws " + e);
throw new CommandException(e.getMessage());
}
}
Aggregations