edu.internet2.middleware.grouper.shibboleth.dataConnector.field
Enum FieldMemberFilter

java.lang.Object
  extended by java.lang.Enum<FieldMemberFilter>
      extended by edu.internet2.middleware.grouper.shibboleth.dataConnector.field.FieldMemberFilter
All Implemented Interfaces:
Serializable, Comparable<FieldMemberFilter>

public enum FieldMemberFilter
extends Enum<FieldMemberFilter>

member filter for retrieving members. Originally WsMemberFilter; modified slightly to suit the needs of ldappc - tz

Author:
mchyzer

Enum Constant Summary
all
          retrieve all members (immediate, effective and composite)
composite
          if this is a composite group, then return all the memberships that match the composite operator (union, intersection, complement).
effective
          retrieve members which exist due a group as a member of another group (for composite groups, this will not return anything)
immediate
          return only direct members of a group (for composite groups this will not return anything)
 
Method Summary
static
<E extends Enum<?>>
E
enumValueOfIgnoreCase(Class<E> theEnumClass, String string, boolean exceptionOnNotFound)
          do a case-insensitive matching
abstract  Set<Group> getGroups(Member member)
          get groups for subject
abstract  Set<Group> getGroups(Member member, Field field)
          get groups for subject based on field
 Set<Member> getMembers(Group group, Field field)
          get the members from the group based on type of filter
protected abstract  Set<Member> getMembersHelper(Group group, Field field)
          get the members from the group based on type of filter
 Set<Membership> getMemberships(Group group, Field field)
          get the memberships from the group based on type of filter
protected abstract  Set<Membership> getMembershipsHelper(Group group, Field field)
          get the memberships from the group based on type of filter
 boolean hasMember(Group group, Subject subject, Field field)
          see if a subject is in a group
protected abstract  boolean hasMemberHelper(Group group, Subject subject, Field field)
          see if a subject is in a group
static FieldMemberFilter valueOf(String name)
          Returns the enum constant of this type with the specified name.
static FieldMemberFilter valueOfIgnoreCase(String string)
          do a case-insensitive matching
static FieldMemberFilter[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

all

public static final FieldMemberFilter all
retrieve all members (immediate, effective and composite)


effective

public static final FieldMemberFilter effective
retrieve members which exist due a group as a member of another group (for composite groups, this will not return anything)


immediate

public static final FieldMemberFilter immediate
return only direct members of a group (for composite groups this will not return anything)


composite

public static final FieldMemberFilter composite
if this is a composite group, then return all the memberships that match the composite operator (union, intersection, complement). This will be the same as All for composite groups.

Method Detail

values

public static FieldMemberFilter[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (FieldMemberFilter c : FieldMemberFilter.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static FieldMemberFilter valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

getMembers

public final Set<Member> getMembers(Group group,
                                    Field field)
get the members from the group based on type of filter

Parameters:
group -
field - for membership or null to not check field
Returns:
the set of members (non null)

getMembersHelper

protected abstract Set<Member> getMembersHelper(Group group,
                                                Field field)
                                         throws SchemaException
get the members from the group based on type of filter

Parameters:
group -
field - for membership or null to not check field
Returns:
the set of members (non null)
Throws:
SchemaException - if problem with field

getMembershipsHelper

protected abstract Set<Membership> getMembershipsHelper(Group group,
                                                        Field field)
                                                 throws SchemaException
get the memberships from the group based on type of filter

Parameters:
group -
field - for membership or null to not check field
Returns:
the set of members (non null)
Throws:
SchemaException - is there is a problem with field

getMemberships

public final Set<Membership> getMemberships(Group group,
                                            Field field)
get the memberships from the group based on type of filter

Parameters:
group -
field - for membership or null to not check field
Returns:
the set of members (non null)
Throws:
SchemaException - is there is a problem with field

hasMemberHelper

protected abstract boolean hasMemberHelper(Group group,
                                           Subject subject,
                                           Field field)
                                    throws SchemaException
see if a subject is in a group

Parameters:
group -
subject -
field -
Returns:
the set of members (non null)
Throws:
SchemaException

hasMember

public final boolean hasMember(Group group,
                               Subject subject,
                               Field field)
see if a subject is in a group

Parameters:
group -
subject -
field -
Returns:
the set of members (non null)
Throws:
SchemaException

getGroups

public abstract Set<Group> getGroups(Member member)
get groups for subject

Parameters:
member -
field - to check with membership
Returns:
the set of members (non null)

getGroups

public abstract Set<Group> getGroups(Member member,
                                     Field field)
get groups for subject based on field

Parameters:
member -
field -
field - to check with membership
Returns:
the set of members (non null)

valueOfIgnoreCase

public static FieldMemberFilter valueOfIgnoreCase(String string)
do a case-insensitive matching

Parameters:
string -
Returns:
the enum or null or exception if not found

enumValueOfIgnoreCase

public static <E extends Enum<?>> E enumValueOfIgnoreCase(Class<E> theEnumClass,
                                                          String string,
                                                          boolean exceptionOnNotFound)
                                               throws RuntimeException
do a case-insensitive matching

Type Parameters:
E - generic type
Parameters:
theEnumClass - class of the enum
string -
exceptionOnNotFound - true if exception should be thrown on not found
Returns:
the enum or null or exception if not found
Throws:
GrouperRestInvalidRequest - if there is a problem
RuntimeException


Copyright © 2012 Internet2. All Rights Reserved.