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

Examples of org.jboss.as.console.client.administration.role.model.Role$Key


    validateQuery(query);
    validateSplitSize(numSplits);

    List<Query> splits = new ArrayList<Query>(numSplits);
    List<Key> scatterKeys = getScatterKeys(numSplits, query, datastore);
    Key lastKey = null;
    for (Key nextKey : getSplitKey(scatterKeys, numSplits)) {
      splits.add(createSplit(lastKey, nextKey, query));
      lastKey = nextKey;
    }
    splits.add(createSplit(lastKey, null, query));
View Full Code Here


            boolean hasExcludes = !roleAssignment.getExcludes().isEmpty();
            List<Role> roles = new ArrayList<Role>(roleAssignment.getRoles());
            RoleComparator comperator = new RoleComparator();
            Collections.sort(roles, comperator);
            for (Iterator<Role> iterator = roles.iterator(); iterator.hasNext(); ) {
                Role role = iterator.next();
                builder.append(roleAsSafeHtml(role, true));
                if (iterator.hasNext() || hasExcludes) {
                    builder.append(SafeHtmlUtils.fromString(", "));
                }
            }
            if (hasExcludes) {
                List<Role> excludes = new ArrayList<Role>(roleAssignment.getExcludes());
                Collections.sort(excludes, comperator);
                for (Iterator<Role> iterator = excludes.iterator(); iterator.hasNext(); ) {
                    Role exclude = iterator.next();
                    builder.append(roleAsSafeHtml(exclude, false));
                    if (iterator.hasNext()) {
                        builder.append(SafeHtmlUtils.fromString(", "));
                    }
                }
View Full Code Here

            List<String> scope = new ArrayList<String>();
            List<ModelNode> scopeNodes = node.get(scopeName).asList();
            for (ModelNode scopeNode : scopeNodes) {
                scope.add(scopeNode.asString());
            }
            Role scopedRole = new Role(property.getName(), property.getName(), StandardRole.fromString(baseRoleName),
                    type, scope);
            roles.add(scopedRole);
        }
View Full Code Here

        }

        private void addInternalRoleAssignment(final Principals principals, final RoleAssignments assignments,
                final Roles roles, final Property property) {
            String roleName = property.getName();
            Role role = roles.getRole(roleName);
            if (role != null) {
                RoleAssignment.Internal internal = new RoleAssignment.Internal(role);
                ModelNode assignmentNode = property.getValue();
                if (assignmentNode.hasDefined("include-all")) {
                    role.setIncludeAll(assignmentNode.get("include-all").asBoolean());
                }
                if (assignmentNode.hasDefined("include")) {
                    List<Property> inclusions = assignmentNode.get("include").asPropertyList();
                    for (Property inclusion : inclusions) {
                        PrincipalRealmTupel principal = mapPrincipal(principals, inclusion.getValue());
View Full Code Here

        form.setFields(nameItem, baseRoleItem, typeItem, scopeItem, includeAllItem);
        form.setEnabled(false);
        form.setToolsCallback(new FormCallback() {
            @Override
            public void onSave(final Map changeset) {
                Role edited = form.getEditedEntity();
                if (edited != null) {
                    Role newScopedRole = new Role(nameItem.getValue(), nameItem.getValue(), baseRoleItem.getValue(),
                            typeItem.getValue(), scopeItem.getValue());
                    newScopedRole.setIncludeAll(includeAllItem.getValue());
                    presenter.saveScopedRole(newScopedRole, edited);
                }
            }

            @Override
View Full Code Here

                scopeItem.setChoices(hosts);
            } else if (type == Role.Type.SERVER_GROUP) {
                scopeItem.setChoices(serverGroups);
            }
            // restore selection
            Role entity = form.getEditedEntity();
            if (entity != null) {
                scopeItem.setValue(new ArrayList<String>(entity.getScope()));
            }
        }
    }
View Full Code Here

        form.setFields(nameItem, includeAllItem);
        form.setEnabled(false);
        form.setToolsCallback(new FormCallback() {
            @Override
            public void onSave(final Map changeset) {
                Role edited = form.getEditedEntity();
                if (edited != null) {
                    edited.setIncludeAll(includeAllItem.getValue());
                    presenter.modifyIncludeAll(edited);
                }
            }

            @Override
View Full Code Here

                new ClickHandler() {
                    @Override
                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            Role scopedRole = new Role(nameItem.getValue(), nameItem.getValue(),
                                    baseRoleItem.getValue(), typeItem.getValue(), scopeItem.getValue());
                            scopedRole.setIncludeAll(includeAllItem.getValue());
                            presenter.addScopedRole(scopedRole);
                        }
                    }
                },
                new ClickHandler() {
View Full Code Here

            scopeItem.setChoices(hosts);
        } else if (type == SERVER_GROUP) {
            scopeItem.setChoices(serverGroups);
        }
        // restore selection
        Role entity = form.getEditedEntity();
        if (entity != null) {
            scopeItem.setValue(new ArrayList<String>(entity.getScope()));
        }
    }
View Full Code Here

        form.setFields(nameItem, baseRoleItem, typeItem, scopeItem, includeAllItem);
        form.setEnabled(false);
        form.setToolsCallback(new FormCallback() {
            @Override
            public void onSave(final Map changeSet) {
                Role edited = form.getEditedEntity();
                if (edited != null) {
                    edited.setBaseRole(baseRoleItem.getValue());
                    edited.setScope(scopeItem.getValue());
                    edited.setIncludeAll(includeAllItem.getValue());
                    presenter.saveScopedRole(edited);
                }
            }

            @Override
View Full Code Here

TOP

Related Classes of org.jboss.as.console.client.administration.role.model.Role$Key

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.