Search in sources :

Example 1 with GcHasMember

use of edu.internet2.middleware.grouperClient.api.GcHasMember in project uPortal by Jasig.

the class GrouperEntityGroupStore method contains.

/* (non-Javadoc)
     * @see org.apereo.portal.groups.IEntityGroupStore#contains(org.apereo.portal.groups.IEntityGroup, org.apereo.portal.groups.IGroupMember)
     */
public boolean contains(IEntityGroup group, IGroupMember member) throws GroupsException {
    String groupContainerName = group.getLocalKey();
    String groupMemberName = member.getKey();
    if (!validKey(groupContainerName) || !validKey(groupMemberName)) {
        return false;
    }
    GcHasMember gcHasMember = new GcHasMember();
    gcHasMember.assignGroupName(groupContainerName);
    gcHasMember.addSubjectLookup(new WsSubjectLookup(null, "g:gsa", groupMemberName));
    WsHasMemberResults wsHasMemberResults = gcHasMember.execute();
    if (GrouperClientUtils.length(wsHasMemberResults.getResults()) == 1) {
        WsHasMemberResult wsHasMemberResult = wsHasMemberResults.getResults()[0];
        return StringUtils.equals("IS_MEMBER", wsHasMemberResult.getResultMetadata().getResultCode());
    }
    return false;
}
Also used : GcHasMember(edu.internet2.middleware.grouperClient.api.GcHasMember) WsSubjectLookup(edu.internet2.middleware.grouperClient.ws.beans.WsSubjectLookup) WsHasMemberResult(edu.internet2.middleware.grouperClient.ws.beans.WsHasMemberResult) WsHasMemberResults(edu.internet2.middleware.grouperClient.ws.beans.WsHasMemberResults)

Aggregations

GcHasMember (edu.internet2.middleware.grouperClient.api.GcHasMember)1 WsHasMemberResult (edu.internet2.middleware.grouperClient.ws.beans.WsHasMemberResult)1 WsHasMemberResults (edu.internet2.middleware.grouperClient.ws.beans.WsHasMemberResults)1 WsSubjectLookup (edu.internet2.middleware.grouperClient.ws.beans.WsSubjectLookup)1