Package org.jboss.as.console.client.administration.role.model

Examples of org.jboss.as.console.client.administration.role.model.RoleAssignments


            operation.get(STEPS).set(steps);
            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().put(Results.ERROR,
                                new RuntimeException("Failed to load contents: " + result.getFailureDescription()));
                        control.abort();
                    } else {
                        ModelNode stepsResult = result.get(RESULT);

                        // the order of processing is important!
                        if (!presenter.isStandalone()) {
                            List<ModelNode> hostScopedRoles = stepsResult.get("step-1").get(RESULT).asList();
                            for (ModelNode node : hostScopedRoles) {
                                addScopedRole(roles, node.asProperty(), "hosts", HOST);
                            }

                            List<ModelNode> serverGroupScopedRoles = stepsResult.get("step-2").get(RESULT).asList();
                            for (ModelNode node : serverGroupScopedRoles) {
                                addScopedRole(roles, node.asProperty(), "server-groups", SERVER_GROUP);
                            }
                        }
                        List<ModelNode> roleMappings = stepsResult.get(presenter.isStandalone() ? "step-1" : "step-3").get(RESULT)
                                .asList();
                        for (ModelNode node : roleMappings) {
                            addInternalRoleAssignment(principals, assignments, roles, node.asProperty());
                        }
                        // All entities are read - now transform the role assignements from the management model to
                        // role assignments used in the UI
                        assignments.toUI(principals);

                        if (!presenter.isInitialized()) {
                            String provider = "undefined";
                            String step = presenter.isStandalone() ? "step-2" : "step-4";
                            ModelNode providerNode = stepsResult.get(step);
View Full Code Here


        this.loadRoleAssignmentsOp = new LoadRoleAssignmentsOp(this, dispatcher, hostInformationStore,
                serverGroupStore);

        // empty defaults to prevent NPE before the first call to loadAssignments()
        this.principals = new Principals();
        this.assignments = new RoleAssignments();
        this.roles = new Roles();
        this.hosts = new ArrayList<String>();
        this.serverGroups = new ArrayList<String>();

        this.initialized = false;
View Full Code Here

        this.beanFactory = beanFactory;
        this.loadRoleAssignmentsOp = new LoadRoleAssignmentsOp(dispatcher, beanFactory, hostInformationStore,
                serverGroupStore);

        this.principals = new Principals();
        this.assignments = new RoleAssignments(beanFactory);
        this.roles = new Roles();
        this.hosts = new ArrayList<String>();
        this.serverGroups = new ArrayList<String>();
    }
View Full Code Here

            operation.get(STEPS).set(steps);
            dispatcher.execute(new DMRAction(operation), new SimpleCallback<DMRResponse>() {
                @Override
                public void onSuccess(final DMRResponse result) {
                    Principals principals = new Principals();
                    RoleAssignments assignments = new RoleAssignments(beanFactory);
                    Roles roles = new Roles();

                    ModelNode response = result.get();
                    if (ModelAdapter.wasSuccess(response)) {
                        ModelNode stepsResult = response.get(RESULT);

                        // the order of processing is important!
                        List<ModelNode> hostScopedRoles = stepsResult.get("step-1").get(RESULT).asList();
                        for (ModelNode node : hostScopedRoles) {
                            addScopedRole(roles, node.asProperty(), "hosts", ScopeType.host);
                        }
                        List<ModelNode> serverGroupScopedRoles = stepsResult.get("step-2").get(RESULT).asList();
                        for (ModelNode node : serverGroupScopedRoles) {
                            addScopedRole(roles, node.asProperty(), "server-groups", ScopeType.serverGroup);
                        }
                        List<ModelNode> roleMappings = stepsResult.get("step-3").get(RESULT).asList();
                        for (ModelNode node : roleMappings) {
                            addManagementModelRoleAssignment(principals, assignments, roles, node.asProperty());
                        }
                        // All entities are read - now transform the role assignements from the management model to
                        // role assignments used in the UI and update the view
                        assignments.transform(principals);

                        control.getContext().put(Results.PRINCIPALS, principals);
                        control.getContext().put(Results.ASSIGNMENTS, assignments);
                        control.getContext().put(Results.ROLES, roles);
                        control.proceed();
View Full Code Here

        this.loadRoleAssignmentsOp = new LoadRoleAssignmentsOp(this, dispatcher, hostInformationStore,
                serverGroupStore);

        // empty defaults to prevent NPE before the first call to loadAssignments()
        this.principals = new Principals();
        this.assignments = new RoleAssignments();
        this.roles = new Roles();
        this.hosts = new ArrayList<String>();
        this.serverGroups = new ArrayList<String>();

        this.initialized = false;
View Full Code Here

        this.loadRoleAssignmentsOp = new LoadRoleAssignmentsOp(this, dispatcher, hostInformationStore,
                serverGroupStore);

        // empty defaults to prevent NPE before the first call to loadAssignments()
        this.principals = new Principals();
        this.assignments = new RoleAssignments();
        this.roles = new Roles();
        this.hosts = new ArrayList<String>();
        this.serverGroups = new ArrayList<String>();

        this.initialized = false;
View Full Code Here

        this.loadRoleAssignmentsOp = new LoadRoleAssignmentsOp(this, dispatcher, hostInformationStore,
                serverGroupStore);

        // empty defaults to prevent NPE before the first call to loadAssignments()
        this.principals = new Principals();
        this.assignments = new RoleAssignments();
        this.roles = new Roles();
        this.hosts = new ArrayList<String>();
        this.serverGroups = new ArrayList<String>();

        this.initialized = false;
View Full Code Here

            operation.get(STEPS).set(steps);
            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();
                            for (ModelNode node : hostScopedRoles) {
                                addScopedRole(roles, node.asProperty(), "hosts", HOST);
                            }

                            List<ModelNode> serverGroupScopedRoles = stepsResult.get("step-3").get(RESULT).asList();
                            for (ModelNode node : serverGroupScopedRoles) {
                                addScopedRole(roles, node.asProperty(), "server-groups", SERVER_GROUP);
                            }
                        }
                        List<ModelNode> roleMappings =
                                stepsResult.get(presenter.isStandalone() ? "step-2" : "step-4").get(RESULT)
                                        .asList();
                        for (ModelNode node : roleMappings) {
                            addInternalRoleAssignment(principals, assignments, roles, node.asProperty());
                        }
                        // All entities are read - now transform the role assignments from the management model to
                        // role assignments used in the UI
                        assignments.toUI(principals);

                        if (!presenter.isInitialized()) {
                            String provider = "undefined";
                            String step = presenter.isStandalone() ? "step-3" : "step-5";
                            ModelNode providerNode = stepsResult.get(step);
View Full Code Here

        this.loadRoleAssignmentsOp = new LoadRoleAssignmentsOp(this, dispatcher, hostInformationStore,
                serverGroupStore);

        // empty defaults to prevent NPE before the first call to loadAssignments()
        this.principals = new Principals();
        this.assignments = new RoleAssignments();
        this.roles = new Roles();
        this.hosts = new ArrayList<String>();
        this.serverGroups = new ArrayList<String>();

        this.initialized = false;
View Full Code Here

            operation.get(STEPS).set(steps);
            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();
                            for (ModelNode node : hostScopedRoles) {
                                addScopedRole(roles, node.asProperty(), "hosts", HOST);
                            }

                            List<ModelNode> serverGroupScopedRoles = stepsResult.get("step-3").get(RESULT).asList();
                            for (ModelNode node : serverGroupScopedRoles) {
                                addScopedRole(roles, node.asProperty(), "server-groups", SERVER_GROUP);
                            }
                        }
                        List<ModelNode> roleMappings =
                                stepsResult.get(presenter.isStandalone() ? "step-2" : "step-4").get(RESULT)
                                        .asList();
                        for (ModelNode node : roleMappings) {
                            addInternalRoleAssignment(principals, assignments, roles, node.asProperty());
                        }
                        // All entities are read - now transform the role assignments from the management model to
                        // role assignments used in the UI
                        assignments.toUI(principals);

                        if (!presenter.isInitialized()) {
                            String provider = "undefined";
                            String step = presenter.isStandalone() ? "step-3" : "step-5";
                            ModelNode providerNode = stepsResult.get(step);
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.administration.role.model.RoleAssignments

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.