Address address = new Address();
ReadResource op = new ReadResource(address);
op.includeRuntime(true);
ComplexResult res = getASConnection().executeComplex(op);
if (res.isSuccess()) {
Map<String, Object> props = res.getResult();
for (MeasurementScheduleRequest request : skmRequests) {
String requestName = request.getName();
String realName = requestName.substring(requestName.indexOf(':') + 1);
String val = null;
if (props.containsKey(realName)) {
val = getStringValue(props.get(realName));
}
if ("null".equals(val)) {
if (realName.equals("product-name"))
val = "JBoss AS";
else if (realName.equals("product-version"))
val = getStringValue(props.get("release-version"));
else if (LOG.isDebugEnabled()) {
LOG.debug("Value for " + realName + " was 'null' and no replacement found");
}
}
MeasurementDataTrait data = new MeasurementDataTrait(request, val);
report.addData(data);
}
} else if (LOG.isDebugEnabled()) {
LOG.debug("getSKMRequests failed: " + res.getFailureDescription());
}
}