Esri Geoportal Server
1.0

com.esri.gpt.framework.security.identity.ldap
Class LdapEditFunctions

java.lang.Object
  extended by com.esri.gpt.framework.security.identity.ldap.LdapFunctions
      extended by com.esri.gpt.framework.security.identity.ldap.LdapEditFunctions

public class LdapEditFunctions
extends LdapFunctions

Handles functionality related to editing an LDAP identity store.


Constructor Summary
protected LdapEditFunctions()
          Default constructor.
protected LdapEditFunctions(LdapConfiguration configuration)
          Construct with a supplied configuration.
 
Method Summary
protected  void addAttribute(DirContext dirContext, String objectDN, Attributes attributes)
          Adds and attribute(s) to an LDAP object.
protected  void addEntry(DirContext dirContext, String objectDN, Attributes attributes)
          Adds an entry to LDAP.
protected  void addUserToRole(DirContext dirContext, User user, String role)
          Adds user to role.
protected  User recoverUserPassword(DirContext dirContext, String username, String emailAddress)
          Recovers a password.
protected  void registerUser(DirContext dirContext, User user)
          Register a new user.
protected  void removeEntry(DirContext dirContext, String objectDN, Attributes attributes)
          Removes an attribute(s) from an LDAP object.
protected  void updateUserPassword(DirContext dirContext, User user, UsernamePasswordCredentials newCredentials)
          Updates the password for a user.
protected  void updateUserProfile(DirContext dirContext, User user, boolean considerUsername, boolean considerPassword)
          Updates the profile attributes for a user.
 
Methods inherited from class com.esri.gpt.framework.security.identity.ldap.LdapFunctions
buildFullDN, closeEnumeration, getConfiguration, setConfiguration
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LdapEditFunctions

protected LdapEditFunctions()
Default constructor.


LdapEditFunctions

protected LdapEditFunctions(LdapConfiguration configuration)
Construct with a supplied configuration.

Parameters:
configuration - the configuration
Method Detail

addAttribute

protected void addAttribute(DirContext dirContext,
                            String objectDN,
                            Attributes attributes)
                     throws NamingException
Adds and attribute(s) to an LDAP object.

Parameters:
dirContext - the directory context
objectDN - the distinguished name for the object to modify
attributes - the attribute collection to add
Throws:
NamingException - if an exception occurs

addEntry

protected void addEntry(DirContext dirContext,
                        String objectDN,
                        Attributes attributes)
                 throws NamingException
Adds an entry to LDAP.

Parameters:
dirContext - the directory context
objectDN - the distinguished name for the new entry
attributes - the attributes for the new entry
Throws:
NamingException - if an exception occurs

recoverUserPassword

protected User recoverUserPassword(DirContext dirContext,
                                   String username,
                                   String emailAddress)
                            throws NamingException
Recovers a password.
The password is not actually recovered from LDAP, a new password is generated and written to LDAP, the new password is returned within the credentials.

Parameters:
dirContext - the directory context
username - the username
emailAddress - the email address
Returns:
the user associated with the recovered credentials (null if no match)
Throws:
NamingException - if an LDAP naming exception occurs

registerUser

protected void registerUser(DirContext dirContext,
                            User user)
                     throws CredentialPolicyException,
                            NamingException,
                            NameAlreadyBoundException
Register a new user.

Parameters:
dirContext - the directory context
user - the subject user
Throws:
CredentialPolicyException - if the username or password is empty
NamingException - if an LDAP naming exception occurs
NameAlreadyBoundException - if the new user DN already exists

addUserToRole

protected void addUserToRole(DirContext dirContext,
                             User user,
                             String role)
                      throws CredentialPolicyException,
                             NamingException
Adds user to role.

Parameters:
dirContext - the directory context
user - the subject user
role -
Throws:
CredentialPolicyException - if the username or password is empty
NamingException - if an LDAP naming exception occurs
NameAlreadyBoundException - if the new user DN already exists

removeEntry

protected void removeEntry(DirContext dirContext,
                           String objectDN,
                           Attributes attributes)
                    throws NamingException
Removes an attribute(s) from an LDAP object.

Parameters:
dirContext - the directory context
objectDN - the distinguished name for the object to modify
attributes - the attribute collection to remove
Throws:
NamingException - if an exception occurs

updateUserProfile

protected void updateUserProfile(DirContext dirContext,
                                 User user,
                                 boolean considerUsername,
                                 boolean considerPassword)
                          throws NamingException
Updates the profile attributes for a user.

Parameters:
dirContext - the directory context
user - the subject user
considerUsername - true if the username should be considered for update
considerPassword - true if the password should be considered for update
Throws:
NamingException - if an LDAP naming exception occurs

updateUserPassword

protected void updateUserPassword(DirContext dirContext,
                                  User user,
                                  UsernamePasswordCredentials newCredentials)
                           throws NamingException
Updates the password for a user.

Parameters:
dirContext - the directory context
user - the subject user
newCredentials - the credentials containing the new password
Throws:
NamingException - if an LDAP naming exception occurs

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.