//System.out.println(response.toString());
List<Server> records = new ArrayList<Server>(payload.size());
for(ModelNode item : payload)
{
Server record = factory.server().as();
ModelNode server = item.asProperty().getValue();
record.setName(server.get("name").asString());
record.setGroup(server.get("group").asString());
if(server.hasDefined("socket-binding-group"))
record.setSocketBinding(server.get("socket-binding-group").asString());
try {
record.setPortOffset(server.get("socket-binding-port-offset").asInt());
} catch (IllegalArgumentException e) {
//
}
try {
record.setAutoStart(server.get("auto-start").asBoolean());
} catch (IllegalArgumentException e) {
// TODO: https://issues.jboss.org/browse/JBAS-9163
}
record.setStarted(server.get("status").asString().equals("STARTED"));
List<PropertyRecord> propertyRecords = ModelAdapter.model2Property(factory, server);
record.setProperties(propertyRecords);
Jvm jvm = ModelAdapter.model2JVM(factory, server);
record.setJvm(jvm);
records.add(record);
}
callback.onSuccess(records);