org.opends.server.types
Class MemberList

java.lang.Object
  extended by org.opends.server.types.MemberList
Direct Known Subclasses:
DynamicGroupMemberList, FilteredStaticGroupMemberList, SimpleStaticGroupMemberList

@PublicAPI(stability=VOLATILE,
           mayInstantiate=false,
           mayExtend=true,
           mayInvoke=true)
public abstract class MemberList
extends java.lang.Object

This class defines a mechanism that may be used to iterate over the members of a group. It uses an interface that is similar to that of java.util.Iterator, but is specific to group membership and that provides the ability to throw an exception when attempting to retrieve the next member (e.g., if the group contains a malformed DN or references a member that doesn't exist).


Constructor Summary
MemberList()
           
 
Method Summary
abstract  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.
abstract  boolean hasMoreMembers()
          Indicates whether the group contains any more members.
 DN nextMemberDN()
          Retrieves the DN of the next group member.
abstract  Entry nextMemberEntry()
          Retrieves the entry for the next group member.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemberList

public MemberList()
Method Detail

hasMoreMembers

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

Returns:
true if the group has at least one more member, or false if not.

nextMemberDN

public DN nextMemberDN()
                throws MembershipException
Retrieves the DN of the next group member.

Returns:
The DN of the next group member, or null if there are no more members.
Throws:
MembershipException - If a problem occurs while attempting to retrieve the next member DN.

nextMemberEntry

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

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 abstract 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.