An abstract method that Executes the command
if (!validateOptions())
throw new CommandValidationException("Validation is false");
//use http connector
MBeanServerConnection mbsc = getMBeanServerConnection(getHost(), getPort(),
getUser(), getPassword());
final String targetName = (String)getOption(TARGET_NAME);
//if targetName is not null, then try to get the Config ObjectName of the
//target before deleting the resource because we don't want to delete
//the resource if the target does not exist.
ObjectName scON = (targetName!=null && !targetName.equals(DOMAIN))?
getTargetConfigObjectName(mbsc, targetName):null;
final Object[] params = getParamsInfo();
final String operationName = getOperationName();
final String[] types = getTypesInfo();
try {
if (scON!=null)
{
//remove reference to the target
mbsc.invoke(scON, "removeResourceRefConfig",
new Object[]{new String((String)getOperands().get(0))},
new String[]{"java.lang.String"} );
}
Object returnValue = mbsc.invoke(Util.newObjectName(DOMAIN_CONFIG_OBJECT_NAME),
operationName,
params, types);
CLILogger.getInstance().printDetailMessage(getLocalizedString(
"CommandSuccessful",
new Object[] {name}));
}
catch (Exception e) {
displayExceptionMessage(e);
}