An abstract method that executes the command
if (!validateOptions())
throw new CommandValidationException("Validation failed");
try {
DomainConfig domainConfig = new DomainConfig(null,
getDomainsRoot());
DomainsManager manager = getFeatureFactory().getDomainsManager();
String[] domainsList = manager.listDomainsAndStatus(domainConfig);
if (domainsList.length > 0) {
//*bug fix for #6158809*
//CLILogger.getInstance().printDetailMessage(
// getLocalizedString("ListOfDomains"));
//*end of bug fix*
for (int i = 0; i < domainsList.length; i++) {
CLILogger.getInstance().printMessage(domainsList[i]);
}
} else {
CLILogger.getInstance().printDetailMessage(
getLocalizedString("NoDomainsToList"));
}
CLILogger.getInstance().printDetailMessage(getLocalizedString(
"CommandSuccessful",
new Object[] {name}));
} catch (Exception ex) {
CLILogger.getInstance().printDetailMessage(ex.getLocalizedMessage());
throw new CommandException(getLocalizedString("CommandUnSuccessful",
new Object[] {name} ), ex);
}