Find the <code>IEntities</code> that are members of the <code>IEntityGroup</code>.

@param group the entity group in question
@return java.util.Iterator
510941
@Override
    public Iterator findEntitiesForGroup(IEntityGroup group) throws GroupsException {
        Collection entities = new ArrayList();
        Connection conn = null;
        String groupID = group.getLocalKey();
        Class cls = group.getLeafType();

        try {
            conn = RDBMServices.getConnection();
            Statement stmnt = conn.createStatement();
            try {

                String query =
                        "SELECT "
                                + MEMBER_MEMBER_KEY_COLUMN
                                + " FROM "
                                + MEMBER_TABLE
                                + " WHERE "
                                + MEMBER_GROUP_ID_COLUMN
                                + " = '"
                                + groupID
                                + "' AND "
                                + MEMBER_IS_GROUP_COLUMN
                                + " = '"
                                + MEMBER_IS_ENTITY
                                + "'";

                ResultSet rs = stmnt.executeQuery(query);
                try {
                    while (rs.next()) {
                        String key = rs.getString(1);
                        IEntity e = newEntity(cls, key);
                        entities.add(e);
                    }
                } finally {
                    rs.close();
                }
            } finally {
                stmnt.close();
            }
        } catch (SQLException sqle) {
            LOG.error("Problem retrieving Entities for Group: " + group, sqle);
            throw new GroupsException("Problem retrieving Entities for Group", sqle);
        } finally {
            RDBMServices.releaseConnection(conn);
        }

        return entities.iterator();
    }
392214
public static IEntityGroup newGroup(Class<?> type) throws GroupsException {
        LOGGER.trace("Invoking newGroup for type='{}'", type);
        return instance().inewGroup(type);
    }
318668
public static ILockableEntityGroup findLockableGroup(String key, String lockOwner)
            throws GroupsException {
        LOGGER.trace("Invoking findLockableGroup for key='{}', lockOwner='{}'", key, lockOwner);
        return instance().ifindLockableGroup(key, lockOwner);
    }
210861
@Override
	public List<CPInstance> findByGroupId(long groupId) {
		return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
	}
1219732
@Override
    public EntityIdentifier[] searchForGroups(
            String query, IGroupConstants.SearchMethod method, Class leaftype)
            throws GroupsException {
        Set allIds = new HashSet();

        for (Iterator services = getComponentServices().values().iterator(); services.hasNext(); ) {
            IIndividualGroupService service = (IIndividualGroupService) services.next();
            EntityIdentifier[] ids = service.searchForGroups(query, method, leaftype);
            for (int i = 0; i < ids.length; i++) {
                try {
                    CompositeEntityIdentifier cei =
                            new CompositeEntityIdentifier(ids[i].getKey(), ids[i].getType());
                    cei.setServiceName(service.getServiceName());
                    allIds.add(cei);
                } catch (javax.naming.InvalidNameException ine) {
                }
            }
        }
        return (EntityIdentifier[]) allIds.toArray(new EntityIdentifier[allIds.size()]);
    }
1258636
protected IEntity primGetEntity(String key, Class type) throws GroupsException {
        return entityFactory.newInstance(key, type);
    }
1082640
@Override
    public IEntityGroup find(String key) throws GroupsException {

        try {

            // Search the Grouper server for groups with the specified local
            // key
            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug("Searching Grouper for a direct match for key: " + key);
            }
            WsGroup wsGroup = findGroupFromKey(key);
            if (wsGroup == null) {
                return null;
            }
            IEntityGroup group = createUportalGroupFromGrouperGroup(wsGroup);

            if (LOGGER.isDebugEnabled()) {
                LOGGER.debug(
                        "Retrieved group from the Grouper server matching key "
                                + key
                                + ": "
                                + group.toString());
            }

            // return the group
            return group;

        } catch (Exception e) {
            LOGGER.warn(
                    "Exception while attempting to retrieve "
                            + "group with key "
                            + key
                            + " from Grouper web services: "
                            + e.getMessage());
            return null;
        }
    }
207438
public static IEntityGroup findGroup(String key) throws GroupsException {
        LOGGER.trace("Invoking findGroup for key='{}'", key);
        return instance().ifindGroup(key);
    }
660915
public Properties getProperties(String group) {
		final Properties properties = new Properties();
		properties.putAll(getMap(group));
		return properties;
	}
773979
public java.util.List<GroupIdentifier> getGroups() {
        if (groups == null) {
            groups = new com.amazonaws.internal.SdkInternalList<GroupIdentifier>();
        }
        return groups;
    }
1252989
@Override
    public Set<IEntityGroup> getParentGroups() throws GroupsException {

        final EntityIdentifier cacheKey = getUnderlyingEntityIdentifier();
        Element element = parentGroupsCache.get(cacheKey);

        if (element == null) {
            final Set<IEntityGroup> groups = buildParentGroupsSet();
            element = new Element(cacheKey, groups);
            parentGroupsCache.put(element);
        }

        @SuppressWarnings("unchecked")
        final Set<IEntityGroup> rslt = (Set<IEntityGroup>) element.getObjectValue();
        return rslt;
    }
965287
@Override
    public Set<Node> getUsersForGroup(Node group) {
		Set<Node> users = new TreeSet<>();
		try {
			String query = "(" + groupIdentifyer + "=" + group.getName() + ")";
			SearchResult searchResult;
			Attributes attributes;
			SearchControls controls = new SearchControls();
			controls.setSearchScope(SearchControls.SUBTREE_SCOPE);
			NamingEnumeration<SearchResult> results = ctx.search("", query, controls);
			Node user;
			while (results.hasMore()) {
				searchResult = results.next();
				attributes = searchResult.getAttributes();
				NamingEnumeration<?> members = attributes.get(groupMemberAttribut).getAll();
				while (members.hasMoreElements()) {
					String memberDN = (String) members.nextElement();
					String uid = getIdentifyerValueFromDN(memberDN);
					user = getUser(uid);
					user.setDn(memberDN);
					users.add(user);
				}
			}
		} catch (NamingException ex) {
			handleNamingException(group, ex);
		}
		return users;
	}
291168
public B group(EventLoopGroup group) {
        if (group == null) {
            throw new NullPointerException("group");
        }
        if (this.group != null) {
            throw new IllegalStateException("group set already");
        }
        this.group = group;
        return self();
    }
496091
public Group getGroupByUUID(final UUID UUID) {
        List<Group> allGroups = getGroups();

        List<Group> groups = ListFilter.filter(allGroups, new Filter<Group>() {

            @Override
            public boolean matches(Group item) {

                if (item.getUuid() != null && item.getUuid().compareTo(UUID) == 0) {
                    return true;
                } else {
                    return false;
                }
            }
        });

        if (groups.size() == 1) {
            return groups.get(0);
        } else {
            return null;
        }
    }
311413
@Override
    public JsonEntityBean getRootEntity(String groupType) {

        EntityEnum type = EntityEnum.getEntityEnum(groupType);

        String rootKey;
        if (EntityEnum.GROUP.equals(type)) {
            rootKey = "local.0";
        } else if (EntityEnum.CATEGORY.equals(type)) {
            IEntityGroup categoryGroup =
                    GroupService.getDistinguishedGroup(IPortletDefinition.DISTINGUISHED_GROUP);
            return new JsonEntityBean(categoryGroup, EntityEnum.CATEGORY);
        } else {
            throw new IllegalArgumentException(
                    "Unable to determine a root entity for group type '" + groupType + "'");
        }

        JsonEntityBean bean = getEntity(groupType, rootKey, false);

        return bean;
    }
500366
@Override
    public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException {
        boolean found = false;
        Iterator itr = (member.isGroup()) ? findMemberGroups(group) : findEntitiesForGroup(group);
        while (itr.hasNext() && !found) {
            found = member.equals(itr.next());
        }
        return found;
    }
751330
private IEntityGroup instanceFromResultSet(ResultSet rs) throws SQLException, GroupsException {
        IEntityGroup eg = null;

        String key = rs.getString(1);
        String creatorID = rs.getString(2);
        Integer entityTypeID = rs.getInt(3);
        Class entityType = EntityTypesLocator.getEntityTypes().getEntityTypeFromID(entityTypeID);
        String groupName = rs.getString(4);
        String description = rs.getString(5);

        if (key != null) {
            eg = newInstance(key, entityType, creatorID, groupName, description);
        }

        return eg;
    }