Methods Summary |
---|
protected boolean | confirmPassword()
return true;
|
protected java.lang.String | getPasswordConfirmationPrompt()
return "FileUserPasswordConfirmationPrompt";
|
protected java.lang.String | getPasswordOption()this methods returns the user/alias password.
//getPassword(optionName, allowedOnCommandLine, readPrefsFile, readPasswordOptionFromPrefs, readMasterPasswordFile, mgr, config,
//promptUser, confirm, validate)
return getPassword(getPasswordOptionName(), getPasswordPrompt(),
getPasswordConfirmationPrompt(),
true, false, false, false, null, null,
true, confirmPassword(), false, true);
|
protected java.lang.String | getPasswordOptionName()
return USER_PASSWORD;
|
protected java.lang.String | getPasswordPrompt()
return "FileUserPasswordPrompt";
|
private java.lang.String | getUserName()
String userName;
if ((getOperands() != null) && (getOperands().size() != 0))
userName = (String) getOperands().get(0);
else //prompt for fileuser
{
try {
InputsAndOutputs.getInstance().getUserOutput().print(
getLocalizedString(this.getUserPrompt()));
userName = InputsAndOutputs.getInstance().getUserInput().getLine();
}
catch (IOException ioe)
{
throw new CommandValidationException(
getLocalizedString("CannotReadOption",
new Object[]{getUserOptionName()}));
}
}
return userName;
|
protected java.lang.String | getUserOptionName()
return FILE_USER_NAME;
|
protected java.lang.String | getUserPrompt()
return "FileUserPrompt";
|
public void | runCommand()
validateOptions();
//use http connector
MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
getUser(), getPassword());
final String objectName = getObjectName();
final Object[] params = getParamsInfo();
final String operationName = getOperationName();
final String[] types = getTypesInfo();
//get fileuser and set it in the params
params[0] = getUserName();
//get fileuser password and set it in the params
params[1] = getPasswordOption();
try
{
//if (System.getProperty("Debug") != null) printDebug(mbsc, objectName);
Object returnValue = mbsc.invoke(new ObjectName(objectName),
operationName, params, types);
handleReturnValue(returnValue);
CLILogger.getInstance().printDetailMessage(getLocalizedString(
"CommandSuccessful",
new Object[] {name}));
}
catch(Exception e)
{
displayExceptionMessage(e);
}
|
public boolean | validateOptions()Validate the userpassword option.
return super.validateOptions();
|