Package org.rhq.core.domain.resource.group

Examples of org.rhq.core.domain.resource.group.LdapGroup


                }
            }

            // Add new groups, but filter those that are still attached
            for (LdapGroup ldapGroup : newLdapGroups) {
                LdapGroup attachedLdapGroup = (ldapGroup.getId() != 0) ? entityManager.find(LdapGroup.class,
                    ldapGroup.getId()) : null;
                if (attachedLdapGroup == null && !currentLdapGroups.contains(ldapGroup)) {
                    ldapGroup.setRole(attachedRole);
                    entityManager.persist(ldapGroup);
                    attachedLdapGroup = ldapGroup;
View Full Code Here


                throw new IllegalArgumentException("Could not find role[" + roleId + "] to add LDAP groups to.");
            }
            role.getLdapGroups().size(); // load them in

            for (String groupId : groupNames) {
                LdapGroup group = new LdapGroup();
                group.setName(groupId);
                role.addLdapGroup(group);
            }
        }
    }
View Full Code Here

                throw new IllegalArgumentException("Could not find role[" + roleId + "] to remove LDAP groups from.");
            }
            role.getLdapGroups().size(); // load them in

            for (Integer groupId : groupIds) {
                LdapGroup doomedGroup = entityManager.find(LdapGroup.class, groupId);
                if (doomedGroup == null) {
                    throw new IllegalArgumentException("Tried to remove doomedGroup[" + groupId + "] from role["
                        + roleId + "], but doomedGroup was not found.");
                }
                role.removeLdapGroup(doomedGroup);
View Full Code Here

            superuser = createSession(superuser);

            Role role = new Role("role-manager-role");
            role.setFsystem(false);
            role = roleManager.createRole(superuser, role);
            LdapGroup group = new LdapGroup();
            group.setName("Foo");
            role.addLdapGroup(group);
            assert ldapManager.findLdapGroupsByRole(role.getId(), PageControl.getUnlimitedInstance()).size() == 1 : "Ldap Group Foo Should be assigned";
        } finally {
            getTransactionManager().rollback();
        }
View Full Code Here

    public static PageList<LdapGroup> convertToPageList(Set<Map<String, String>> locatedGroupMaps) {
        PageList<LdapGroup> converted = new PageList<LdapGroup>();
        converted.setPageControl(PageControl.getUnlimitedInstance());
        if (locatedGroupMaps != null) {
            for (Map<String, String> locatedGroupMap : locatedGroupMaps) {
                LdapGroup group = new LdapGroup();
                group.setDescription(locatedGroupMap.get("description"));
                group.setName(locatedGroupMap.get("name"));
                //group.setId(0);
                converted.add(group);
            }
        }
        return converted;
View Full Code Here

            setFields(nameField, descriptionField);
        }

        @Override
        public LdapGroup copyValues(Record from) {
            LdapGroup to = new LdapGroup();

            to.setId(from.getAttributeAsInt(FIELD_ID));
            to.setName(from.getAttributeAsString(FIELD_NAME));
            to.setDescription(from.getAttributeAsString(FIELD_DESCRIPTION));

            return to;
        }
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.resource.group.LdapGroup

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.