public class AdminCommandStateCmdResultJsonProvider extends AdminCommandStateJsonProvider {
@Override
protected void addActionReporter(ActionReporter ar, JSONObject json) throws JSONException {
if (ar != null) {
CommandResult cr = CompositeUtil.instance().getModel(CommandResult.class);
cr.setMessage(ar.getMessage());
cr.setProperties(ar.getTopMessagePart().getProps());
Properties props = ar.getExtraProperties();
if (props != null) {
Map<String, Object> map = new HashMap<String, Object>();
for (Map.Entry<Object, Object> entry : props.entrySet()) {
map.put(entry.getKey().toString(), entry.getValue());
}
cr.setExtraProperties(map);
}
json.put("command-result", (JSONObject) JsonUtil.getJsonObject(cr));
}
}