org.opends.server.extensions
Class DynamicGroupMemberList

java.lang.Object
  extended by org.opends.server.types.MemberList
      extended by org.opends.server.extensions.DynamicGroupMemberList

public class DynamicGroupMemberList
extends MemberList

This class defines a mechanism that may be used to iterate over the members of a dynamic group, optionally using an additional set of criteria to further filter the results.


Constructor Summary
DynamicGroupMemberList(DN groupDN, java.util.Set<LDAPURL> memberURLs)
          Creates a new dynamic group member list with the provided information.
DynamicGroupMemberList(DN groupDN, java.util.Set<LDAPURL> memberURLs, DN baseDN, SearchScope scope, SearchFilter filter)
          Creates a new dynamic group member list with the provided information.
 
Method Summary
 void close()
          Indicates that this member list is no longer required and that the server may clean up any resources that may have been used in the course of processing.
 DN getDynamicGroupDN()
          Retrieves the DN of the dynamic group with which this dynamic group member list is associated.
 boolean hasMoreMembers()
          Indicates whether the group contains any more members.
 Entry nextMemberEntry()
          Retrieves the entry for the next group member.
 
Methods inherited from class org.opends.server.types.MemberList
nextMemberDN
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DynamicGroupMemberList

public DynamicGroupMemberList(DN groupDN,
                              java.util.Set<LDAPURL> memberURLs)
                       throws DirectoryException
Creates a new dynamic group member list with the provided information.

Parameters:
groupDN - The DN of the entry containing the group definition.
memberURLs - The set of LDAP URLs that define the membership criteria for the associated group.
Throws:
DirectoryException - If a problem occurs while creating the member list.

DynamicGroupMemberList

public DynamicGroupMemberList(DN groupDN,
                              java.util.Set<LDAPURL> memberURLs,
                              DN baseDN,
                              SearchScope scope,
                              SearchFilter filter)
                       throws DirectoryException
Creates a new dynamic group member list with the provided information.

Parameters:
groupDN - The DN of the entry containing the group definition.
memberURLs - The set of LDAP URLs that define the membership criteria for the associated group.
baseDN - The base DN that should be enforced for all entries to return.
scope - The scope that should be enforced for all entries to return.
filter - The filter that should be enforced for all entries to return.
Throws:
DirectoryException - If a problem occurs while creating the member list.
Method Detail

getDynamicGroupDN

public final DN getDynamicGroupDN()
Retrieves the DN of the dynamic group with which this dynamic group member list is associated.

Returns:
The DN of the dynamic group with which this dynamic group member list is associated.

hasMoreMembers

public boolean hasMoreMembers()
Indicates whether the group contains any more members.

Specified by:
hasMoreMembers in class MemberList
Returns:
true if the group has at least one more member, or false if not.

nextMemberEntry

public Entry nextMemberEntry()
                      throws MembershipException
Retrieves the entry for the next group member.

Specified by:
nextMemberEntry in class MemberList
Returns:
The entry for the next group member, or null if there are no more members.
Throws:
MembershipException - If a problem occurs while attempting to retrieve the next entry.

close

public void close()
Indicates that this member list is no longer required and that the server may clean up any resources that may have been used in the course of processing. This method must be called if the caller wishes to stop iterating across the member list before the end has been reached, although it will not be necessary if the call to hasMoreMembers returns false.

Specified by:
close in class MemberList