Console.error(Console.MESSAGES.failed("Loading EE Subsystem"), response.getFailureDescription());
}
else
{
ModelNode payload = response.get(RESULT).asObject();
EESubsystem eeSubsystem = adapter.fromDMR(payload);
if(payload.hasDefined("global-modules"))
{
List<ModelNode> modelNodes = payload.get("global-modules").asList();
List<Module> modules = new ArrayList<Module>(modelNodes.size());
for(ModelNode model : modelNodes)
{
Module module = factory.eeModuleRef().as();
module.setName(model.get("name").asString());
module.setSlot(model.get("slot").asString());
modules.add(module);
}
eeSubsystem.setModules(modules);
}
else
{
eeSubsystem.setModules(Collections.EMPTY_LIST);
}
EEPresenter.this.currentEntity = eeSubsystem;
getView().updateFrom(eeSubsystem);
}