com.sun.jndi.ldap.obj
Class GroupOfNames.Members

java.lang.Object
  extended by com.sun.jndi.ldap.obj.GroupOfNames.Members
All Implemented Interfaces:
java.util.Enumeration, javax.naming.NamingEnumeration
Enclosing class:
GroupOfNames

 class GroupOfNames.Members
extends java.lang.Object
implements javax.naming.NamingEnumeration

The members of a static group.


Field Summary
private  boolean expandSubgroups
           
private  javax.naming.NamingEnumeration memberDNs
           
private  javax.naming.NamingEnumeration subgroupMembers
           
private  java.util.ArrayList subgroups
           
 
Constructor Summary
GroupOfNames.Members()
           
GroupOfNames.Members(javax.naming.NamingEnumeration memberDNs)
           
 
Method Summary
 void close()
          Closes the enumeration and releases its resources.
private  javax.naming.directory.DirContext getRootContext()
           
 boolean hasMore()
          Check if the group has more members.
 boolean hasMoreElements()
          Check if the group has more members.
 java.lang.Object next()
          Retrieve the next member of the group.
 java.lang.Object nextElement()
          Retrieve the next member of the group.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

memberDNs

private javax.naming.NamingEnumeration memberDNs

expandSubgroups

private boolean expandSubgroups

subgroups

private java.util.ArrayList subgroups

subgroupMembers

private javax.naming.NamingEnumeration subgroupMembers
Constructor Detail

GroupOfNames.Members

GroupOfNames.Members()

GroupOfNames.Members

GroupOfNames.Members(javax.naming.NamingEnumeration memberDNs)
Method Detail

hasMoreElements

public boolean hasMoreElements()
Check if the group has more members.

Specified by:
hasMoreElements in interface java.util.Enumeration
Returns:
true if the group has another member.

hasMore

public boolean hasMore()
                throws javax.naming.NamingException
Check if the group has more members.

Specified by:
hasMore in interface javax.naming.NamingEnumeration
Returns:
true if the group has another member.
Throws:
javax.naming.NamingException - If a problem is encountered while checking whether the group has any more members.

nextElement

public java.lang.Object nextElement()
Retrieve the next member of the group. Some members may themselves be groups. Such a member is returned as an object of class Group.

Note that in order to determine whether a member is itself a group this method reads each member's LDAP entry. As this is potentially an expensive activity the feature may be disabled by setting the environment property "com.sun.jndi.ldap.obj.expandGroup" to the string value "false". When the feature is disabled then an object of class Principal is returned. By default, the feature is enabled.

Specified by:
nextElement in interface java.util.Enumeration
Returns:
The next member of the group. When only the LdapGroupFactory object factory is active then an object of class Principal or Group is returned. However, when additional object factories are active then an object of a different class may be returned.
Throws:
java.util.NoSuchElementException - If no more members exist or if a NamingException was encountered while retrieving the next element.

next

public java.lang.Object next()
                      throws javax.naming.NamingException
Retrieve the next member of the group. Some members may themselves be groups. Such a member is returned as an object of class Group.

Note that in order to determine whether a member is itself a group this method reads each member's LDAP entry. As this is potentially an expensive activity the feature may be disabled by setting the environment property "com.sun.jndi.ldap.obj.expandGroup" to the string value "false". When the feature is disabled then an object of class Principal is returned. By default, the feature is enabled.

Specified by:
next in interface javax.naming.NamingEnumeration
Returns:
The next member of the group. When only the LdapGroupFactory object factory is active then an object of class Principal or Group is returned. However, when additional object factories are active then an object of a different class may be returned.
Throws:
javax.naming.NamingException - If a problem is encountered while retrieving the next member of the group.
java.util.NoSuchElementException - If no more members exist.

close

public void close()
           throws javax.naming.NamingException
Closes the enumeration and releases its resources.

Specified by:
close in interface javax.naming.NamingEnumeration
Throws:
javax.naming.NamingException - If a problem is encountered while closing the enumeration.

getRootContext

private javax.naming.directory.DirContext getRootContext()
                                                  throws javax.naming.NamingException
Throws:
javax.naming.NamingException