|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.turbine.services.security.torque.TorqueUserManager
An UserManager performs User
objects related tasks on behalf of the
BaseSecurityService.
This implementation uses a relational database for storing user data. It
expects that the User interface implementation will be castable to
BaseObject.
| Constructor Summary | |
TorqueUserManager()
|
|
| Method Summary | |
boolean |
accountExists(java.lang.String userName)
Check whether a specified user's account exists. |
boolean |
accountExists(User user)
Check whether a specified user's account exists. |
void |
authenticate(User user,
java.lang.String password)
Authenticate an User with the specified password. |
void |
changePassword(User user,
java.lang.String oldPassword,
java.lang.String newPassword)
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)
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)
Retrieve a set of users that meet the specified criteria. |
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)
Saves User data when the session is unbound. |
void |
store(User user)
Save an 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 TorqueUserManager()
| Method Detail |
public void init(org.apache.commons.configuration.Configuration conf)
throws InitializationException
init in interface UserManagerconf - A Configuration object to init this Manager
InitializationException - When something went wrong.
public boolean accountExists(User user)
throws DataBackendException
accountExists in interface UserManageruser - The user to be checked.
DataBackendException - if there was an error accessing
the data backend.
public boolean accountExists(java.lang.String userName)
throws DataBackendException
accountExists in interface UserManageruserName - The name of the user to be checked.
DataBackendException - if there was an error accessing
the data backend.
public User retrieve(java.lang.String userName)
throws UnknownEntityException,
DataBackendException
retrieve in interface UserManageruserName - the name of the user.
UnknownEntityException - if the user's account does not
exist in the database.
DataBackendException - if there is a problem accessing the
storage.
public User retrieveById(java.lang.Object key)
throws UnknownEntityException,
DataBackendException
retrieveById in interface UserManagerkey - 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
UserManagerUser 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 DB implementation.
retrieve in interface UserManagercriteria - The criteria of selection.
DataBackendException - if there is a problem accessing the
storage.
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 UserManagercriteria - 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 UserManageruserName - 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 - if there is a problem accessing the
storage.
public void store(User user)
throws UnknownEntityException,
DataBackendException
store in interface UserManageruser - an User object to store.
UnknownEntityException - if the user's account does not
exist in the database.
DataBackendException - if there is a problem accessing the
storage.
public void saveOnSessionUnbind(User user)
throws UnknownEntityException,
DataBackendException
saveOnSessionUnbind in interface UserManagerUnknownEntityException - 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 UserManageruser - an 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 - if there is a problem accessing the
storage.
public void changePassword(User user,
java.lang.String oldPassword,
java.lang.String newPassword)
throws PasswordMismatchException,
UnknownEntityException,
DataBackendException
changePassword in interface UserManageruser - an User to change password for.oldPassword - The old password to verifynewPassword - The new password to set
PasswordMismatchException - if the supplied password was
incorrect.
UnknownEntityException - if the user's account does not
exist in the database.
DataBackendException - if there is a problem accessing the
storage.
public void forcePassword(User user,
java.lang.String password)
throws UnknownEntityException,
DataBackendException
forcePassword in interface UserManageruser - an User to change password for.password - the new password.
UnknownEntityException - if the user's record does not
exist in the database.
DataBackendException - if there is a problem accessing the
storage.
public void createAccount(User user,
java.lang.String initialPassword)
throws EntityExistsException,
DataBackendException
createAccount in interface UserManageruser - The object describing account to be created.initialPassword - the password for the new account
DataBackendException - if there was an error accessing
the data backend.
EntityExistsException - if the user account already exists.
public void removeAccount(User user)
throws UnknownEntityException,
DataBackendException
removeAccount in interface UserManageruser - the object describing the account to be removed.
DataBackendException - if there was an error accessing
the data backend.
UnknownEntityException - if the user account is not present.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||