org.jboss.portal.core.identity.cache
Class CachedLDAPUserModuleWrapper

java.lang.Object
  extended by org.jboss.portal.identity.service.IdentityModuleService
      extended by org.jboss.portal.identity.service.UserModuleService
          extended by org.jboss.portal.identity.ldap.LDAPUserModule
              extended by org.jboss.portal.core.identity.cache.CachedLDAPUserModuleWrapper
All Implemented Interfaces:
UserModule

public class CachedLDAPUserModuleWrapper
extends LDAPUserModule
implements UserModule

Version:
: 0.1 $
Author:
Boleslaw Dawidowicz

Field Summary
 
Fields inherited from class org.jboss.portal.identity.service.IdentityModuleService
moduleType
 
Constructor Summary
CachedLDAPUserModuleWrapper(LDAPUserModule userModule, IdentityCacheService cacheService)
           
 
Method Summary
 User createUser(java.lang.String userName, java.lang.String password)
          Creates a new user with the specified name.
 LDAPUserImpl createUserInstance(javax.naming.directory.Attributes attrs, java.lang.String dn)
           
 User findUserByDN(java.lang.String dn)
          method not belonging to UserModule interface - ldap specific.
 User findUserById(java.lang.Object id)
          Retrieve a user by its id.
 User findUserById(java.lang.String id)
          Retrieve a user by its id.
 User findUserByUserName(java.lang.String userName)
          Retrieve a user by its name.
 java.util.Set findUsers(int offset, int limit)
          Get a range of users.
 java.util.Set findUsersFilteredByUserName(java.lang.String filter, int offset, int limit)
          Get a range of users.
 int getUserCount()
          Returns the number of users.
 void removeUser(java.lang.Object id)
          Remove a user.
 java.util.List searchUsers(java.lang.String filter, java.lang.Object[] filterArgs)
          This method should be used by over modules to perform searches.
 void updatePassword(LDAPUserImpl ldapu, java.lang.String password)
           
 boolean validatePassword(LDAPUserImpl ldapu, java.lang.String password)
           
 
Methods inherited from class org.jboss.portal.identity.ldap.LDAPUserModule
getAttributesToAdd, getConnectionContext, getContainerDN, getPasswordAttributeId, getPrincipalPreffix, getPrincipalSuffix, getSearchScope, getSearchTimeLimit, getUidAttributeID, getUserProfileModule, getUserSearchCtxDN, getUserSearchFilter, isAllowEmptyPasswords, isUserNameToLowerCase, setConnectionContext, start
 
Methods inherited from class org.jboss.portal.identity.service.UserModuleService
fireUserCreatedEvent, fireUserDestroyedEvent
 
Methods inherited from class org.jboss.portal.identity.service.IdentityModuleService
getConnectionJNDIName, getIdentityConfiguration, getIdentityContext, getIdentityEventBroadcaster, getInitOptions, getJndiBinder, getJNDIName, getModuleType, setConnectionJNDIName, setIdentityContext, setInitOptions, setJndiBinder, setJNDIName, setModuleType, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachedLDAPUserModuleWrapper

public CachedLDAPUserModuleWrapper(LDAPUserModule userModule,
                                   IdentityCacheService cacheService)
Method Detail

findUserByUserName

public User findUserByUserName(java.lang.String userName)
                        throws IdentityException,
                               java.lang.IllegalArgumentException,
                               NoSuchUserException
Description copied from interface: UserModule
Retrieve a user by its name.

Specified by:
findUserByUserName in interface UserModule
Parameters:
userName - the user name
Returns:
the user
Throws:
IdentityException
java.lang.IllegalArgumentException
NoSuchUserException

findUserById

public User findUserById(java.lang.Object id)
                  throws IdentityException,
                         java.lang.IllegalArgumentException,
                         NoSuchUserException
Description copied from interface: UserModule
Retrieve a user by its id.

Specified by:
findUserById in interface UserModule
Parameters:
id - the user id
Returns:
the user
Throws:
java.lang.IllegalArgumentException - if the id is null
IdentityException
NoSuchUserException

findUserById

public User findUserById(java.lang.String id)
                  throws IdentityException,
                         java.lang.IllegalArgumentException,
                         NoSuchUserException
Description copied from interface: UserModule
Retrieve a user by its id.

Specified by:
findUserById in interface UserModule
Parameters:
id - the user id
Returns:
the user
Throws:
java.lang.IllegalArgumentException - if the id is null or not in the good format
IdentityException
NoSuchUserException

createUser

public User createUser(java.lang.String userName,
                       java.lang.String password)
                throws IdentityException,
                       java.lang.IllegalArgumentException
Description copied from interface: UserModule
Creates a new user with the specified name.

Specified by:
createUser in interface UserModule
Returns:
the user
Throws:
IdentityException
java.lang.IllegalArgumentException

removeUser

public void removeUser(java.lang.Object id)
                throws IdentityException,
                       java.lang.IllegalArgumentException
Description copied from interface: UserModule
Remove a user.

Specified by:
removeUser in interface UserModule
Parameters:
id - the user id
Throws:
IdentityException
java.lang.IllegalArgumentException

findUsers

public java.util.Set findUsers(int offset,
                               int limit)
                        throws IdentityException,
                               java.lang.IllegalArgumentException
Description copied from interface: UserModule
Get a range of users.

Specified by:
findUsers in interface UserModule
Parameters:
offset - the offset of the first result to retrieve
limit - the maximum number of users to retrieve
Returns:
the user set
Throws:
IdentityException
java.lang.IllegalArgumentException

findUsersFilteredByUserName

public java.util.Set findUsersFilteredByUserName(java.lang.String filter,
                                                 int offset,
                                                 int limit)
                                          throws IdentityException,
                                                 java.lang.IllegalArgumentException
Description copied from interface: UserModule
Get a range of users.

Specified by:
findUsersFilteredByUserName in interface UserModule
Parameters:
filter - a string filter applied to the user name.
offset - the offset of the frist result to retrieve
limit - the maximum number of users to retrieve
Returns:
the user set
Throws:
IdentityException
java.lang.IllegalArgumentException

getUserCount

public int getUserCount()
                 throws IdentityException,
                        java.lang.IllegalArgumentException
Description copied from interface: UserModule
Returns the number of users.

Specified by:
getUserCount in interface UserModule
Returns:
the number of users
Throws:
IdentityException
java.lang.IllegalArgumentException

searchUsers

public java.util.List searchUsers(java.lang.String filter,
                                  java.lang.Object[] filterArgs)
                           throws javax.naming.NamingException,
                                  IdentityException
Description copied from class: LDAPUserModule
This method should be used by over modules to perform searches. It will allow user module implementation to apply proper filter and search scope from the configuration

Specified by:
searchUsers in class LDAPUserModule
Parameters:
filter - that will be concatenated with proper user search filter from the module
Returns:
Throws:
javax.naming.NamingException
IdentityException

updatePassword

public void updatePassword(LDAPUserImpl ldapu,
                           java.lang.String password)
                    throws IdentityException
Overrides:
updatePassword in class LDAPUserModule
Throws:
IdentityException

validatePassword

public boolean validatePassword(LDAPUserImpl ldapu,
                                java.lang.String password)
                         throws IdentityException
Overrides:
validatePassword in class LDAPUserModule
Throws:
IdentityException

createUserInstance

public LDAPUserImpl createUserInstance(javax.naming.directory.Attributes attrs,
                                       java.lang.String dn)
                                throws IdentityException
Overrides:
createUserInstance in class LDAPUserModule
Throws:
IdentityException

findUserByDN

public User findUserByDN(java.lang.String dn)
                  throws IdentityException,
                         java.lang.IllegalArgumentException,
                         NoSuchUserException
Description copied from class: LDAPUserModule
method not belonging to UserModule interface - ldap specific.

Overrides:
findUserByDN in class LDAPUserModule
Throws:
IdentityException
java.lang.IllegalArgumentException
NoSuchUserException