* @param context information
*/
@Override
public void execute(AdminCommandContext context) {
final ActionReport report = context.getActionReport();
SystemPropertyBag spb;
Property domainProp = domain.getProperty("administrative.domain.name");
String domainName = domainProp.getValue();
if ("domain".equals(target) || target.equals(domainName)) {
spb = domain;
} else {
spb = domain.getConfigNamed(target);
if (spb == null) {
spb = domain.getClusterNamed(target);
}
if (spb == null) {
spb = domain.getServerNamed(target);
}
}
if (spb == null) {
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
String msg = localStrings.getLocalString("invalid.target.sys.props",
"Invalid target:{0}. Valid targets types are domain, config, cluster, default server, clustered instance, stand alone instance", target);
report.setMessage(msg);
return;
}
try {
List<SystemProperty> sysProps = spb.getSystemProperty();
int length = 0;
if (sysProps.isEmpty()) {
final ActionReport.MessagePart part = report.getTopMessagePart().addChild();
part.setMessage(localStrings.getLocalString(
"NothingToList", "Nothing to List."));