Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


oracle.ldap.util
Class User

java.lang.Object
  extended by oracle.ldap.util.LDAPEntry
      extended by oracle.ldap.util.User

All Implemented Interfaces:
java.io.Serializable

public class User
extends LDAPEntry
implements java.io.Serializable

This class represents a valid User. It allows the browsing and setting of properties for this user.

See Also:
Serialized Form

Field Summary
static int CREDTYPE_PASSWD
          Using userpassword to authenticate
static java.lang.String[] extPrefRefObjList
           
static int EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR
          Extended Preference Type to be used with getExtendedProperties() - Resource Access Descriptor
static java.lang.String[] radContainerObjList
           
static java.lang.String[] radObjList
           

 

Fields inherited from class oracle.ldap.util.LDAPEntry
entryDN, entryIdType, entryPsc, inEntryId, validated

 

Constructor Summary
  User(javax.naming.directory.DirContext ctx, int inUserIdType, java.lang.String inUserIdName, int inSubIdType, java.lang.String inSubIdName, boolean validate)
           
  User(javax.naming.directory.DirContext ctx, int inUserIdType, java.lang.String inUserIdName, int inSubIdType, java.lang.String inSubIdName, boolean validate, java.util.logging.Logger lgr)
          Constructs a User by specifying the user information and the subscriber information if required.
protected User(javax.naming.directory.DirContext ctx, int inUserIdType, java.lang.String inUserIdName, int inSubIdType, java.lang.String inSubIdName, Subscriber inSubscriber, java.lang.String inSpecifiedSearchBase, java.lang.String[] inUserSearchBase, java.lang.String inUserNickNameAttr, java.lang.String[] inAttrList, boolean toBeAutoProvisioned, boolean validateNow)
           
protected User(javax.naming.directory.DirContext ctx, int inUserIdType, java.lang.String inUserIdName, int inSubIdType, java.lang.String inSubIdName, Subscriber inSubscriber, java.lang.String inSpecifiedSearchBase, java.lang.String[] inUserSearchBase, java.lang.String inUserNickNameAttr, java.lang.String[] inAttrList, boolean toBeAutoProvisioned, boolean validateNow, java.util.logging.Logger lgr)
           
  User(javax.naming.directory.DirContext ctx, int inUserIdType, java.lang.String inUserIdName, Subscriber inSubscriber, boolean validate)
           
  User(javax.naming.directory.DirContext ctx, int inUserIdType, java.lang.String inUserIdName, Subscriber inSubscriber, boolean validate, java.util.logging.Logger lgr)
          Constructs a User by specifying the user information and the subscriber information if required.
protected User(javax.naming.directory.DirContext inCtx, java.lang.String inUserDN, java.lang.String inUserGUID, PropertySet inPs)
           
protected User(javax.naming.directory.DirContext inCtx, java.lang.String inUserDN, java.lang.String inUserGUID, PropertySet inPs, java.util.logging.Logger lgr)
           
protected User(javax.naming.directory.DirContext inCtx, java.lang.String inUserDN, java.lang.String inUserGUID, java.lang.String inEnumBase, Subscriber inSubscr, javax.naming.directory.SearchResult inEnum)
           
protected User(javax.naming.directory.DirContext inCtx, java.lang.String inUserDN, java.lang.String inUserGUID, java.lang.String inEnumBase, Subscriber inSubscr, javax.naming.directory.SearchResult inEnum, java.util.logging.Logger lgr)
           

 

Method Summary
 void authenticateUser(javax.naming.directory.DirContext ctx, int authType, java.lang.Object cred)
          Authenticates User using the appropriate credentials.
 void authenticateUser(javax.naming.directory.DirContext ctx, java.lang.String attrName, java.lang.String attrValue)
          Authenticates the user using an attribute-value pair.
 void createExtendedProperties(javax.naming.directory.DirContext ctx, int propType, ModPropertySet mps)
          Creates new extended properties for the user.
 java.lang.String getDn()
          Deprecated. use getDN(DirContext ctx)
 java.lang.String getDN()
          Deprecated. use getDN(DirContext ctx)
 java.lang.String getDn(javax.naming.directory.DirContext ctx)
          Deprecated. use getDN(DirContext ctx)
 java.lang.String getDN(javax.naming.directory.DirContext ctx)
          Returns the DN of this user.
 PropertySetCollection getExtendedProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String[] attrList)
          Returns a property set collection of all the extended properties of this user based on the property type specified.
 PropertySetCollection getExtendedProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String[] attrList, java.lang.String filter)
          Returns a property set collection of the extended properties of this user based on the property type specified
 Group[] getGroupMembership(javax.naming.directory.DirContext ctx, java.lang.String[] attrList, boolean nested)
          Returns an array of Group objects of which this user is a member.
 java.lang.String getGUID()
          Deprecated. use getGUID(DirContext ctx)
 java.lang.String getGUID(javax.naming.directory.DirContext ctx)
          Returns the GUID of the entry (resolves the name if necessary).
 PropertySetCollection getProperties(javax.naming.directory.DirContext ctx, java.lang.String[] attrList)
          Returns the attributes specified from this user.
 PropertySetCollection getProperties(javax.naming.directory.DirContext ctx, java.lang.String[] attrList, boolean usecache)
          Returns the attributes specified from this user.
 boolean isProvisioned()
           
 java.lang.String locateSubscriber(javax.naming.directory.DirContext ctx)
          Locates and returns the subscriber DN of the subscriber this user belongs to
 void resolve(javax.naming.directory.DirContext ctx)
          Validates the user by identifying its DN
 void setExtendedProperties(javax.naming.directory.DirContext ctx, int propType, java.lang.String filter, ModPropertySet mps)
          Sets extended properties of this user.
 void setProperties(javax.naming.directory.DirContext ctx, javax.naming.directory.ModificationItem[] mods)
          Sets the properties of this user using JNDI ModificationItem.
 void setProperties(javax.naming.directory.DirContext ctx, ModPropertySet mps)
          Sets the properties of this user.

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

radContainerObjList

public static final java.lang.String[] radContainerObjList

extPrefRefObjList

public static final java.lang.String[] extPrefRefObjList

radObjList

public static final java.lang.String[] radObjList

CREDTYPE_PASSWD

public static int CREDTYPE_PASSWD
Using userpassword to authenticate

EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR

public static int EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR
Extended Preference Type to be used with getExtendedProperties() - Resource Access Descriptor

Constructor Detail

User

protected User(javax.naming.directory.DirContext inCtx,
               java.lang.String inUserDN,
               java.lang.String inUserGUID,
               PropertySet inPs,
               java.util.logging.Logger lgr)

User

protected User(javax.naming.directory.DirContext inCtx,
               java.lang.String inUserDN,
               java.lang.String inUserGUID,
               PropertySet inPs)

User

protected User(javax.naming.directory.DirContext inCtx,
               java.lang.String inUserDN,
               java.lang.String inUserGUID,
               java.lang.String inEnumBase,
               Subscriber inSubscr,
               javax.naming.directory.SearchResult inEnum,
               java.util.logging.Logger lgr)

User

protected User(javax.naming.directory.DirContext inCtx,
               java.lang.String inUserDN,
               java.lang.String inUserGUID,
               java.lang.String inEnumBase,
               Subscriber inSubscr,
               javax.naming.directory.SearchResult inEnum)

User

public User(javax.naming.directory.DirContext ctx,
            int inUserIdType,
            java.lang.String inUserIdName,
            Subscriber inSubscriber,
            boolean validate,
            java.util.logging.Logger lgr)
     throws UtilException
Constructs a User by specifying the user information and the subscriber information if required.
Parameters:
ctx - A valid DirContext
inUserIdType - The type of user id being used - use one of Util.IDTYPE_DN, Util.IDTYPE_SIMPLE or Util.IDTYPE_GUID
inUserIdName - User ID
inSubscriber - A valid Subscriber object
validate - Set to true to validate the user by the constructor
Throws:
UtilException
See Also:
Util

User

public User(javax.naming.directory.DirContext ctx,
            int inUserIdType,
            java.lang.String inUserIdName,
            Subscriber inSubscriber,
            boolean validate)
     throws UtilException
Throws:
UtilException

User

public User(javax.naming.directory.DirContext ctx,
            int inUserIdType,
            java.lang.String inUserIdName,
            int inSubIdType,
            java.lang.String inSubIdName,
            boolean validate,
            java.util.logging.Logger lgr)
     throws UtilException
Constructs a User by specifying the user information and the subscriber information if required.
Parameters:
ctx - A valid DirContext
inUserIdType - The type of user id being used - use one of Util.IDTYPE_DN, Util.IDTYPE_SIMPLE or Util.IDTYPE_GUID
inUserIdName - User ID
inSubIdType - The type of subscriber id being used - use one of Util.IDTYPE_DN, Util.IDTYPE_SIMPLE Util.IDTYPE_GUID, Util.IDTYPE_DEFAULT
inSubIdName - Subscriber ID
validate - Set to true to validate the user by the constructor
Throws:
UtilException
See Also:
Util

User

public User(javax.naming.directory.DirContext ctx,
            int inUserIdType,
            java.lang.String inUserIdName,
            int inSubIdType,
            java.lang.String inSubIdName,
            boolean validate)
     throws UtilException
Throws:
UtilException

User

protected User(javax.naming.directory.DirContext ctx,
               int inUserIdType,
               java.lang.String inUserIdName,
               int inSubIdType,
               java.lang.String inSubIdName,
               Subscriber inSubscriber,
               java.lang.String inSpecifiedSearchBase,
               java.lang.String[] inUserSearchBase,
               java.lang.String inUserNickNameAttr,
               java.lang.String[] inAttrList,
               boolean toBeAutoProvisioned,
               boolean validateNow,
               java.util.logging.Logger lgr)
        throws UtilException
Throws:
UtilException

User

protected User(javax.naming.directory.DirContext ctx,
               int inUserIdType,
               java.lang.String inUserIdName,
               int inSubIdType,
               java.lang.String inSubIdName,
               Subscriber inSubscriber,
               java.lang.String inSpecifiedSearchBase,
               java.lang.String[] inUserSearchBase,
               java.lang.String inUserNickNameAttr,
               java.lang.String[] inAttrList,
               boolean toBeAutoProvisioned,
               boolean validateNow)
        throws UtilException
Throws:
UtilException

Method Detail

getExtendedProperties

public PropertySetCollection getExtendedProperties(javax.naming.directory.DirContext ctx,
                                                   int propType,
                                                   java.lang.String[] attrList,
                                                   java.lang.String filter)
                                            throws UtilException
Returns a property set collection of the extended properties of this user based on the property type specified
Parameters:
ctx - a valid DirContext
propType - currently only supporting EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR
attrList - a String array of attributes to be retrieved; null indicates that all attributes should be retrieved; an empty array indicates that none should be retrieved
filter - a search filter to identify an particular applications whose properties is to be retrieved
Returns:
a PropertySetCollection containing the results
Throws:
UtilException
See Also:
EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR

getExtendedProperties

public PropertySetCollection getExtendedProperties(javax.naming.directory.DirContext ctx,
                                                   int propType,
                                                   java.lang.String[] attrList)
                                            throws UtilException
Returns a property set collection of all the extended properties of this user based on the property type specified.
Parameters:
ctx - a valid DirContext
propType - currently only supporting EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR
attrList - a String array of attributes to be retrieved; null indicates that all attributes should be retrieved; an empty array indicates that none should be retrieved
Returns:
a PropertySetCollection containing the results
Throws:
UtilException

setExtendedProperties

public void setExtendedProperties(javax.naming.directory.DirContext ctx,
                                  int propType,
                                  java.lang.String filter,
                                  ModPropertySet mps)
                           throws UtilException
Sets extended properties of this user. Currently only EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR is supported.
 Here is an example to modify the orclpasswordattribute of
 the resource whose orclresourcname is "db9i".

   // Define ModPropertySet
   ModPropertySet mps = new ModPropertySet();

   // Setting new orclpasswordattribute value
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE,
       "orclpasswordattribute", "newpw");

   // execute the modification
   user.setExtendedProperties( ctx,
               User.EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR,
               "orclresourcename=db9i",
               mps );
 
Parameters:
ctx - a valid DirContext
propType - only EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR is supported
filter - a filter used in locating the extended properties
mps - a ModPropertySet containing the modifications
Throws:
UtilException

createExtendedProperties

public void createExtendedProperties(javax.naming.directory.DirContext ctx,
                                     int propType,
                                     ModPropertySet mps)
                              throws UtilException
Creates new extended properties for the user. Currently only EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR is supported.
 Here is an example to creating a new resource access descriptor
 for an orclresourcename="db9i" whose orclresourcetypename is
 "OracleDB".  Various other attributes are also set.

   // Define ModPropertySet
   ModPropertySet mps = new ModPropertySet();

   // Setting property values
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_REPLACE,
       "orclpasswordattribute", "newpw");
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,
       "orclpasswordattribute", "testpw");
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,
       "orcluseridattribute", "uid");
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,
       "orclresourcename", "db9i");
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,
       "orclresourcetypename", "OracleDB");
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,
       "orclusermodifiable", "true");
   mps.addProperty(LDIF.ATTRIBUTE_CHANGE_TYPE_ADD,
       "orclownerguid", "BDD1DBD7748F24BEE034080020AB67AA");

   // Create
   user.createExtendedProperties( ctx,
               User.EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR,
               mps );
 
Parameters:
ctx - a valid DirContext
propType - only EXTPROPTYPE_RESOURCE_ACCESS_DESCRIPTOR</ code> is supported
mps - a ModPropertySet containing the modificatio ns
Throws:
UtilException

setProperties

public void setProperties(javax.naming.directory.DirContext ctx,
                          javax.naming.directory.ModificationItem[] mods)
                   throws UtilException
Sets the properties of this user using JNDI ModificationItem.
Parameters:
ctx - A valid DirContext
mods - A valid array of ModificationItem
Throws:
UtilException

setProperties

public void setProperties(javax.naming.directory.DirContext ctx,
                          ModPropertySet mps)
                   throws UtilException
Sets the properties of this user.

See documentation on ModPropertySet on how to construct a ModPropertySet object.

If the modification involves user password modification, PasswordPolicyException might be thrown. See documentation on PasswordPolicyException for more details.

Overrides:
setProperties in class LDAPEntry
Parameters:
ctx - a valid DirContext
mps - a valid PropertySet containing the items to be modified
Throws:
UtilException

getProperties

public PropertySetCollection getProperties(javax.naming.directory.DirContext ctx,
                                           java.lang.String[] attrList)
                                    throws UtilException
Returns the attributes specified from this user. Any previously cached values in this user object from previous searches will be used If a new search is desired, use the other getProperties(DirContext, String, boolean)
Parameters:
ctx - a valid DirContext
attrList - an array of attributes to be returned
Throws:
UtilException

getProperties

public PropertySetCollection getProperties(javax.naming.directory.DirContext ctx,
                                           java.lang.String[] attrList,
                                           boolean usecache)
                                    throws UtilException
Returns the attributes specified from this user. If usecache is set to true, any previously cached values in this user object will be used. Otherwise, all values will be fetched from the directory again.
Overrides:
getProperties in class LDAPEntry
Parameters:
ctx - a valid DirContext
attrList - an array of attributes to be returned
usecache - Set to true if previously cached values are to be used
Throws:
UtilException

resolve

public void resolve(javax.naming.directory.DirContext ctx)
             throws UtilException
Validates the user by identifying its DN
Specified by:
resolve in class LDAPEntry
Parameters:
ctx - A valid DirContext
Throws:
UtilException

getDN

public java.lang.String getDN(javax.naming.directory.DirContext ctx)
                       throws UtilException
Returns the DN of this user.
Overrides:
getDN in class LDAPEntry
Parameters:
ctx - a valid DirContext
Throws:
UtilException

getDn

public java.lang.String getDn(javax.naming.directory.DirContext ctx)
                       throws UtilException
Deprecated. use getDN(DirContext ctx)
Returns the DN of this user.
Parameters:
ctx - a valid DirContext
Throws:
UtilException

getDn

public java.lang.String getDn()
                       throws UtilException
Deprecated. use getDN(DirContext ctx)
Returns the DN of this user.
Throws:
UtilException

getDN

public java.lang.String getDN()
                       throws UtilException
Deprecated. use getDN(DirContext ctx)
Returns the DN of this user.
Throws:
UtilException

locateSubscriber

public java.lang.String locateSubscriber(javax.naming.directory.DirContext ctx)
                                  throws UtilException
Locates and returns the subscriber DN of the subscriber this user belongs to
Returns:
Subscriber DN
Throws:
UtilException

getGUID

public java.lang.String getGUID()
                         throws UtilException
Deprecated. use getGUID(DirContext ctx)
Returns the GUID of the entry (resolves the name if necessary).
Throws:
UtilException

getGUID

public java.lang.String getGUID(javax.naming.directory.DirContext ctx)
                         throws UtilException
Returns the GUID of the entry (resolves the name if necessary).
Parameters:
ctx - a valid DirContext
Throws:
UtilException

authenticateUser

public void authenticateUser(javax.naming.directory.DirContext ctx,
                             int authType,
                             java.lang.Object cred)
                      throws UtilException
Authenticates User using the appropriate credentials. If authentication fails, UtilException is thrown. The UtilException could be a PasswordPolicyException. See documentation on the various PasswordPolicyExceptions for more details.

Authentication succeeds if no exception is thrown.

Parameters:
ctx - a valid DirContext
authType - User.CREDTYPE_PASSWD is the only one supported at the moment
cred - the credentials based on the authType
Throws:
UtilException

authenticateUser

public void authenticateUser(javax.naming.directory.DirContext ctx,
                             java.lang.String attrName,
                             java.lang.String attrValue)
                      throws UtilException
Authenticates the user using an attribute-value pair. Authentication succeeds if no exception is thrown.
Parameters:
ctx - a valid DirContext
attrName - the name of the attribute
attrValue - the value of the attribute
Throws:
UtilException

getGroupMembership

public Group[] getGroupMembership(javax.naming.directory.DirContext ctx,
                                  java.lang.String[] attrList,
                                  boolean nested)
                           throws UtilException
Returns an array of Group objects of which this user is a member.
Parameters:
ctx - a valid DirContext
attrList - an array of attributes to be returned from each group
nested - set to true to return nested group membership
Throws:
UtilException

isProvisioned

public boolean isProvisioned()

Skip navigation links

Oracle Internet Directory API Reference
11g Release 1 (11.1.1)

E10664-01


Copyright © 1999, 2009 Oracle. All Rights Reserved.