Interface Group
-
@NotExtensible @ThreadSafety(level=INTERFACE_NOT_THREADSAFE) public interface Group
This interface defines a set of methods that may be used to interact with a group.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
canRetrieveMemberListEfficiently()
Indicates whether thegetMemberIterator(String,SearchScope,Filter,boolean)
method can be used to efficiently obtain information about all members of this group.DN
getDN()
Retrieves the DN of the entry that defines this group.GroupMemberIterator
getMemberIterator(java.lang.String baseDN, SearchScope scope, Filter filter, boolean includeNestedMembers)
Retrieves an object that may be used to iterate through the members of this group.boolean
isMember(Entry userEntry, boolean directMembershipOnly)
Indicates whether the specified user is a member of this group.boolean
isMember(java.lang.String userDN, boolean directMembershipOnly)
Indicates whether the specified user is a member of this group.
-
-
-
Method Detail
-
getDN
DN getDN()
Retrieves the DN of the entry that defines this group.- Returns:
- The DN of the entry that defines this group.
-
isMember
boolean isMember(java.lang.String userDN, boolean directMembershipOnly) throws LDAPException
Indicates whether the specified user is a member of this group.- Parameters:
userDN
- The DN for the user for whom to make the determination. It must not benull
.directMembershipOnly
- Indicates whether to only consider the user a member of the group if that user is directly named as a member of the group. If this parameter istrue
, then the method will returntrue
only if the user is directly listed as a member of the group, and will not included dynamic or nested membership. If this parameter isfalse
, then the method will returntrue
if the user is a direct member of the group, is a member of a dynamic group in which the user matches the membership criteria, or if the user is a member of a nested group.- Returns:
true
if the specified user is a member of this group, orfalse
if not.- Throws:
LDAPException
- If a problem is encountered while attempting to make the determination.
-
isMember
boolean isMember(Entry userEntry, boolean directMembershipOnly) throws LDAPException
Indicates whether the specified user is a member of this group.- Parameters:
userEntry
- The entry for the user for whom to make the determination. It must not benull
.directMembershipOnly
- Indicates whether to only consider the user a member of the group if that user is directly named as a member of the group. If this parameter istrue
, then the method will returntrue
only if the user is directly listed as a member of the group, and will not included dynamic or nested membership. If this parameter isfalse
, then the method will returntrue
if the user is a direct member of the group, is a member of a dynamic group in which the user matches the membership criteria, or if the user is a member of a nested group.- Returns:
true
if the specified user is a member of this group, orfalse
if not.- Throws:
LDAPException
- If a problem is encountered while attempting to make the determination.
-
canRetrieveMemberListEfficiently
boolean canRetrieveMemberListEfficiently()
Indicates whether thegetMemberIterator(String,SearchScope,Filter,boolean)
method can be used to efficiently obtain information about all members of this group.- Returns:
true
if thegetMembers
method should be able to efficiently retrieve a list of all members of this group, orfalse
if the call togetMembers
may be inefficient.
-
getMemberIterator
GroupMemberIterator getMemberIterator(java.lang.String baseDN, SearchScope scope, Filter filter, boolean includeNestedMembers) throws LDAPException
Retrieves an object that may be used to iterate through the members of this group. It may be used to iterate through all members, or only members that match a specified set of criteria.- Parameters:
baseDN
- A base DN that may be used to restrict the set of members that are made available through the iterator. If this is non-null
, then the iterator will only iterate across entries at or below this base DN that are also within the specified scope.scope
- A search scope that may be used to restrict the set of members that are made available through the iterator. If the base DN is non-null
, then the scope must also be non-null
, and the iterator will only iterate across entries at or below the base DN and within this scope.filter
- A filter that may be used to restrict the set of members that are made available through the iterator. If this is non-null
, then the iterator will only iterate across members that match this filter.includeNestedMembers
- Indicates whether to include members that are not direct members of this group, but that are nested members because they are members of a group that is directly or indirectly a member of this group.- Returns:
- A
GroupMemberIterator
object that may be used to iterate across the members of this group. - Throws:
LDAPException
- If a problem is encountered while creating the requested group member iterator.
-
-