com.sun.jndi.ldap.obj
Class GroupOfUniqueNames

java.lang.Object
  extended by com.sun.jndi.ldap.obj.GroupOfNames
      extended by com.sun.jndi.ldap.obj.GroupOfUniqueNames
All Implemented Interfaces:
java.security.acl.Group, java.security.Principal

public class GroupOfUniqueNames
extends GroupOfNames

A representation of the LDAP groupOfUniqueNames object class. This is a static group: its members are listed in the group's uniqueMember LDAP attribute.

Note that when a GroupOfUniqueNames object is created by the application program then most of its methods throw IllegalStateException until the program binds the object in the directory. However, when a GroupOfUniqueNames object is returned to the application program then the object is already bound in the directory and its methods function normally.

A GroupOfUniqueNames instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a GroupOfUniqueNames should lock the object.

In order to bind a GroupOfUniqueNames object in the directory, the following LDAP object class definition (RFC 2256) must be supported in the directory schema:

     ( 2.5.6.17 NAME 'groupOfUniqueNames'
        SUP top
        STRUCTURAL
        MUST ( uniqueMember $
               cn )
        MAY ( businessCategory $
              seeAlso $
              owner $
              ou $
              o $
              description ) )
 
See DirContext.bind for details on binding an object in the directory.

The code sample in GroupOfNames shows how the class may be used.

Author:
Vincent Ryan

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.jndi.ldap.obj.GroupOfNames
GroupOfNames.Members
 
Field Summary
private static boolean debug
           
private static java.lang.String MEMBER_ATTR_ID
           
private static java.lang.String MEMBER_FILTER_EXPR
           
private static java.lang.String OBJECT_CLASS
           
private static javax.naming.directory.Attribute OBJECT_CLASS_ATTR
           
 
Constructor Summary
  GroupOfUniqueNames()
          Create an empty group object.
  GroupOfUniqueNames(java.util.Set members)
          Create a group object with an initial set of members.
private GroupOfUniqueNames(java.lang.String groupDN, javax.naming.directory.DirContext ctx, javax.naming.Name name, java.util.Hashtable env, javax.naming.directory.Attributes attributes)
           
 
Method Summary
(package private) static java.lang.Object getObjectInstance(java.lang.String groupDN, javax.naming.directory.DirContext ctx, javax.naming.Name name, java.util.Hashtable env, javax.naming.directory.Attributes attributes)
          Create a group object from its entry in the directory.
(package private) static boolean matches(javax.naming.directory.Attribute objectClass)
          Determines whether the supplied LDAP objectClass attribute matches that of the group.
 
Methods inherited from class com.sun.jndi.ldap.obj.GroupOfNames
addMember, addMember, close, generateRootContextProperties, getAttributes, getName, isMember, isMember, members, removeMember, removeMember, setName, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode
 

Field Detail

debug

private static final boolean debug
See Also:
Constant Field Values

OBJECT_CLASS

private static final java.lang.String OBJECT_CLASS
See Also:
Constant Field Values

MEMBER_ATTR_ID

private static final java.lang.String MEMBER_ATTR_ID
See Also:
Constant Field Values

MEMBER_FILTER_EXPR

private static final java.lang.String MEMBER_FILTER_EXPR
See Also:
Constant Field Values

OBJECT_CLASS_ATTR

private static final javax.naming.directory.Attribute OBJECT_CLASS_ATTR
Constructor Detail

GroupOfUniqueNames

public GroupOfUniqueNames()
Create an empty group object.

Note that the newly constructed object does not represent a group in the directory until it is bound by using DirContext.bind.


GroupOfUniqueNames

public GroupOfUniqueNames(java.util.Set members)
Create a group object with an initial set of members.

Note that the newly constructed object does not represent a group in the directory until it is bound by using DirContext.bind.

Parameters:
members - The set of initial members. It may be null. Each element is of class String or Principal

GroupOfUniqueNames

private GroupOfUniqueNames(java.lang.String groupDN,
                           javax.naming.directory.DirContext ctx,
                           javax.naming.Name name,
                           java.util.Hashtable env,
                           javax.naming.directory.Attributes attributes)
Method Detail

getObjectInstance

static java.lang.Object getObjectInstance(java.lang.String groupDN,
                                          javax.naming.directory.DirContext ctx,
                                          javax.naming.Name name,
                                          java.util.Hashtable env,
                                          javax.naming.directory.Attributes attributes)
Create a group object from its entry in the directory. This method is called by LdapGroupFactory

Parameters:
groupDN - The group's distinguished name.
ctx - An LDAP context.
name - The group's name relative to the context.
env - The context's environment properties.
attributes - The group's LDAP attributes.
Returns:
Object The new object instance.

matches

static boolean matches(javax.naming.directory.Attribute objectClass)
Determines whether the supplied LDAP objectClass attribute matches that of the group. A match occurs if the argument contains the value "GroupOfUniqueNames".

Parameters:
objectClass - The non-null objectClass attribute to check against.
Returns:
true if the objectClass attributes match; false otherwise.