dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
@Override
public void onSuccess(final DMRResponse response) {
Principals principals = new Principals();
RoleAssignments assignments = new RoleAssignments();
Roles roles = new Roles();
ModelNode result = response.get();
if (result.isFailure()) {
control.getContext().setError(
new RuntimeException("Failed to load contents: " + result.getFailureDescription()));
control.abort();
} else {
ModelNode stepsResult = result.get(RESULT);
// the order of processing is important!
ModelNode standardRoleNames = stepsResult.get("step-1");
if (standardRoleNames.get(RESULT).isDefined()) {
for (ModelNode node : standardRoleNames.get(RESULT).asList()) {
StandardRole.add(node.asString());
}
for (StandardRole standardRole : StandardRole.values()) {
roles.add(new Role(standardRole));
}
}
if (!presenter.isStandalone()) {
List<ModelNode> hostScopedRoles = stepsResult.get("step-2").get(RESULT).asList();