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

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


    static public class PrincipalsCell extends AbstractCell<List<Principal>> {

        @Override
        public void render(final Context context, final List<Principal> principals, final SafeHtmlBuilder builder) {
            for (Iterator<Principal> iterator = principals.iterator(); iterator.hasNext(); ) {
                Principal principal = iterator.next();
                asSafeHtml(principal, builder);
                if (iterator.hasNext()) {
                    builder.append(SafeHtmlUtils.fromString(", "));
                }
            }
View Full Code Here


                // Skip the local user
                return null;
            }

            Principal.Type type = Principal.Type.valueOf(node.get("type").asString());
            Principal principal = new Principal(id, name, type);
            principals.add(principal);

            String realm = null;
            if (node.hasDefined("realm")) {
                realm = node.get("realm").asString();
View Full Code Here

                // Skip the local user
                return null;
            }

            Principal.Type type = Principal.Type.valueOf(node.get("type").asString());
            Principal principal = new Principal(id, name, type);
            principals.add(principal);

            String realm = null;
            if (node.hasDefined("realm")) {
                realm = node.get("realm").asString();
View Full Code Here

                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            // if a realm was specified, include the realm in the principals id.
                            final String realm = realmItem.getValue();
                            Principal principal = principalItem.getValue();
                            if (realm != null && realm.length() != 0) {
                                principal = new Principal(principal.getId() + "@" + realm, principal.getName(),
                                        principal.getType());
                            }
                            RoleAssignment roleAssignment = new RoleAssignment(principal);
                            roleAssignment.setRealm(realm);
                            if ("Include".equals(includeExcludeItem.getValue())) {
                                roleAssignment.addRoles(rolesItem.getValue());
View Full Code Here

        Principal.Type type = Principal.Type.valueOf(principalNode.get("type").asString());
        String realm = null;
        if (principalNode.hasDefined("realm")) {
            realm = principalNode.get("realm").asString();
        }
        Principal principal = principals.lookup(type, id);
        if (principal != null) {
            return new RoleAssignment.PrincipalRealmTupel(principal, realm);
        }
        return null;
    }
View Full Code Here

        });
        wrapper = new InputElementWrapper(suggestBox, this);
    }

    private void parseValue(final String name) {
        Principal principal = null;
        if (name != null && name.trim().length() != 0) {
            principal = cache.get(name);
            if (principal == null) {
                // create a new principal
                String id = type.name().toLowerCase() + "-" + name;
                principal = new Principal(id, name, type);
                cache.put(principal.getId(), principal);
            }
        }
        setValue(principal);
    }
View Full Code Here

        Principal.Type type = Principal.Type.valueOf(principalNode.get("type").asString());
        String realm = null;
        if (principalNode.hasDefined("realm")) {
            realm = principalNode.get("realm").asString();
        }
        Principal principal = principals.lookup(type, id);
        if (principal != null) {
            return new RoleAssignment.PrincipalRealmTupel(principal, realm);
        }
        return null;
    }
View Full Code Here

                // Skip the local user
                return null;
            }

            Principal.Type type = Principal.Type.valueOf(node.get("type").asString());
            Principal principal = new Principal(id, name, type);
            principals.add(principal);

            String realm = null;
            if (node.hasDefined("realm")) {
                realm = node.get("realm").asString();
View Full Code Here

        });
        wrapper = new InputElementWrapper(suggestBox, this);
    }

    private void parseValue(final String name) {
        Principal principal = null;
        if (name != null && name.trim().length() != 0) {
            principal = cache.get(name);
            if (principal == null) {
                // create a new principal
                String id = type.name().toLowerCase() + "-" + name;
                principal = new Principal(id, name, type);
                cache.put(principal.getId(), principal);
            }
        }
        setValue(principal);
    }
View Full Code Here

                    public void onClick(ClickEvent event) {
                        FormValidation validation = form.validate();
                        if (!validation.hasErrors()) {
                            // if a realm was specified, include the realm in the principals id.
                            final String realm = realmItem.getValue();
                            Principal principal = principalItem.getValue();
                            if (realm != null && realm.length() != 0) {
                                principal = new Principal(principal.getId() + "@" + realm, principal.getName(),
                                        principal.getType());
                            }
                            RoleAssignment roleAssignment = new RoleAssignment(principal);
                            roleAssignment.setRealm(realm);
                            if ("Include".equals(includeExcludeItem.getValue())) {
                                roleAssignment.addRoles(rolesItem.getValue());
View Full Code Here

TOP

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

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.