|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.turbine.services.security.ldap.LDAPUserManager
A UserManager performs User
object related tasks on behalf of the
SecurityService
.
This implementation uses ldap for retrieving user data. It
expects that the User interface implementation will be castable to
org.apache.turbine.om.BaseObject
.
Constructor Summary | |
LDAPUserManager()
|
Method Summary | |
boolean |
accountExists(java.lang.String username)
Check wether a specified user's account exists. |
boolean |
accountExists(User user)
Check wether a specified user's account exists. |
void |
authenticate(User user,
java.lang.String password)
Authenticate a User with the specified password. |
static javax.naming.directory.DirContext |
bind(java.lang.String username,
java.lang.String password)
Creates an initial context. |
static javax.naming.directory.DirContext |
bindAsAdmin()
Bind as the admin user. |
void |
changePassword(User user,
java.lang.String oldPass,
java.lang.String newPass)
This method is not yet implemented Change the password for an User. |
void |
createAccount(User user,
java.lang.String initialPassword)
Creates new user account with specified attributes. |
void |
forcePassword(User user,
java.lang.String password)
This method is not yet implemented Forcibly sets new password for an User. |
void |
init(org.apache.commons.configuration.Configuration conf)
Initializes the UserManager |
void |
removeAccount(User user)
Removes an user account from the system. |
User[] |
retrieve(org.apache.torque.util.Criteria criteria)
Deprecated. Use retrieveList instead. |
User |
retrieve(java.lang.String username)
Retrieve a user from persistent storage using username as the key. |
User |
retrieve(java.lang.String username,
java.lang.String password)
Retrieve a user from persistent storage using username as the key, and authenticate the user. |
User |
retrieveById(java.lang.Object key)
Retrieve a user from persistent storage using the primary key |
java.util.List |
retrieveList(org.apache.torque.util.Criteria criteria)
Retrieve a list of users that meet the specified criteria. |
void |
saveOnSessionUnbind(User user)
This method is not yet implemented. |
void |
store(User user)
Save a User object to persistent storage. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LDAPUserManager()
Method Detail |
public void init(org.apache.commons.configuration.Configuration conf)
init
in interface UserManager
conf
- A Configuration object to init this Managerpublic boolean accountExists(User user) throws DataBackendException
accountExists
in interface UserManager
user
- The user to be checked.
DataBackendException
- Error accessing the data backend.public boolean accountExists(java.lang.String username) throws DataBackendException
accountExists
in interface UserManager
username
- The name of the user to be checked.
DataBackendException
- Error accessing the data backend.public User retrieve(java.lang.String username) throws UnknownEntityException, DataBackendException
retrieve
in interface UserManager
username
- the name of the user.
UnknownEntityException
- if the user's account does not
exist in the database.
DataBackendException
- Error accessing the data backend.public User retrieveById(java.lang.Object key) throws UnknownEntityException, DataBackendException
retrieveById
in interface UserManager
key
- The primary key object
UnknownEntityException
- if the user's record does not
exist in the database.
DataBackendException
- if there is a problem accessing the
storage.public User[] retrieve(org.apache.torque.util.Criteria criteria) throws DataBackendException
User
interface, plus the the names
of the custom attributes you added to your user representation
in the data storage. Use verbatim names of the attributes -
without table name prefix in case of DB implementation.
retrieve
in interface UserManager
criteria
- The criteria of selection.
DataBackendException
- Error accessing the data backend.public java.util.List retrieveList(org.apache.torque.util.Criteria criteria) throws DataBackendException
User
interface, plus the names
of the custom attributes you added to your user representation
in the data storage. Use verbatim names of the attributes -
without table name prefix in case of Torque implementation.
retrieveList
in interface UserManager
criteria
- The criteria of selection.
DataBackendException
- if there is a problem accessing the
storage.public User retrieve(java.lang.String username, java.lang.String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException
retrieve
in interface UserManager
username
- the name of the user.password
- the user supplied password.
PasswordMismatchException
- if the supplied password was
incorrect.
UnknownEntityException
- if the user's account does not
exist in the database.
DataBackendException
- Error accessing the data backend.public void store(User user) throws UnknownEntityException, DataBackendException
store
in interface UserManager
user
- an User object to store.
UnknownEntityException
- if the user's account does not
exist in the database.
DataBackendException
- if there is an LDAP errorpublic void saveOnSessionUnbind(User user) throws UnknownEntityException, DataBackendException
saveOnSessionUnbind
in interface UserManager
UnknownEntityException
- if the user's account does not
exist in the database.
DataBackendException
- if there is a problem accessing the
storage.public void authenticate(User user, java.lang.String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException
authenticate
in interface UserManager
user
- a User object to authenticate.password
- the user supplied password.
PasswordMismatchException
- if the supplied password was
incorrect.
UnknownEntityException
- if the user's account does not
exist in the database.
DataBackendException
- Error accessing the data backend.public void changePassword(User user, java.lang.String oldPass, java.lang.String newPass) throws PasswordMismatchException, UnknownEntityException, DataBackendException
changePassword
in interface UserManager
user
- an User to change password for.newPass
- the new password.oldPass
- the old password.
PasswordMismatchException
- if the supplied password was
incorrect.
UnknownEntityException
- if the user's account does not
exist in the database.
DataBackendException
- Error accessing the data backend.public void forcePassword(User user, java.lang.String password) throws UnknownEntityException, DataBackendException
forcePassword
in interface UserManager
user
- an User to change password for.password
- the new password.
UnknownEntityException
- if the user's record does not
exist in the database.
DataBackendException
- Error accessing the data backend.public void createAccount(User user, java.lang.String initialPassword) throws EntityExistsException, DataBackendException
createAccount
in interface UserManager
user
- the object describing account to be created.initialPassword
- Not used yet.
DataBackendException
- Error accessing the data backend.
EntityExistsException
- if the user account already exists.public void removeAccount(User user) throws UnknownEntityException, DataBackendException
removeAccount
in interface UserManager
user
- the object describing the account to be removed.
DataBackendException
- Error accessing the data backend.
UnknownEntityException
- if the user account is not present.public static javax.naming.directory.DirContext bindAsAdmin() throws javax.naming.NamingException
javax.naming.NamingException
- when an error occurs with the named server.public static javax.naming.directory.DirContext bind(java.lang.String username, java.lang.String password) throws javax.naming.NamingException
username
- admin username supplied in TRP.password
- admin password supplied in TRP
javax.naming.NamingException
- when an error occurs with the named server.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |