站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.6 API 英文版文档

LDAPUserModuleImpl - JBOSS Portal 2.6 API 英文版文档


org.jboss.portal.identity2.ldap
Class LDAPUserModuleImpl

java.lang.Object
  extended byorg.jboss.portal.identity2.ldap.LDAPUserModuleImpl
All Implemented Interfaces:
UserModule
Direct Known Subclasses:
LDAPExtUserModuleImpl

public class LDAPUserModuleImpl
extends java.lang.Object
implements UserModule

Simple implementation of UserModule for LDAP support. Search of users is limited to one place * containerField - DN of entry containing users (like ou=People,dc=example,dc=com). It's where users will be added using createUser() method. Under this DN users will be searched using ONELEVEL_SCOPE * uidAttributeID - attribute that stores user id. Default value is "uid"

Version:
$Revision: 1.1 $
Author:
Boleslaw Dawidowicz

Field Summary
private  LDAPConnectionContext connectionContext
           
private  java.lang.String containerDN
          DN of entry containing users (like ou=People,dc=example,dc=com).
private static org.jboss.logging.Logger log
           
private  java.lang.String uidAttributeID
          Attribute that stores user id
private  UserProfileModule userProfileModule
           
 
Constructor Summary
LDAPUserModuleImpl()
           
 
Method Summary
 User createUser(java.lang.String userName, java.lang.String password, java.lang.String realEmail)
          Creates a new user with the specified name.
protected  LDAPUserImpl createUserInstance(javax.naming.directory.SearchResult sr)
           
 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.
 LDAPConnectionContext getConnectionContext()
           
 java.lang.String getContainerDN()
           
 java.lang.String getUidAttributeID()
           
 int getUserCount()
          Returns the number of users.
 UserProfileModule getUserProfileModule()
           
 void removeUser(java.lang.Object id)
          Remove a user.
 void setConnectionContext(LDAPConnectionContext connectionContext)
           
 void setContainerDN(java.lang.String containerDN)
           
 void setUidAttributeID(java.lang.String uidAttributeID)
           
 void setUserProfileModule(UserProfileModule userProfileModule)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static final org.jboss.logging.Logger log

connectionContext

private LDAPConnectionContext connectionContext

userProfileModule

private UserProfileModule userProfileModule

uidAttributeID

private java.lang.String uidAttributeID
Attribute that stores user id


containerDN

private java.lang.String containerDN
DN of entry containing users (like ou=People,dc=example,dc=com). It's where users will be added using createUser() method. Under this DN users will be searched using ONELEVEL_SCOPE

Constructor Detail

LDAPUserModuleImpl

public LDAPUserModuleImpl()
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,
                       java.lang.String realEmail)
                throws IdentityException,
                       java.lang.IllegalArgumentException
Description copied from interface: UserModule
Creates a new user with the specified name.

Specified by:
createUser in interface UserModule
Parameters:
userName -
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

createUserInstance

protected LDAPUserImpl createUserInstance(javax.naming.directory.SearchResult sr)
                                   throws IdentityException
Throws:
IdentityException

getUserProfileModule

public UserProfileModule getUserProfileModule()

setUserProfileModule

public void setUserProfileModule(UserProfileModule userProfileModule)

getUidAttributeID

public java.lang.String getUidAttributeID()

setUidAttributeID

public void setUidAttributeID(java.lang.String uidAttributeID)

getConnectionContext

public LDAPConnectionContext getConnectionContext()

setConnectionContext

public void setConnectionContext(LDAPConnectionContext connectionContext)

getContainerDN

public java.lang.String getContainerDN()

setContainerDN

public void setContainerDN(java.lang.String containerDN)