Package org.apache.fulcrum.security
Schnittstelle UserManager
- Alle Superschnittstellen:
Serializable
- Alle bekannten Unterschnittstellen:
TurbineUserManager
- Alle bekannten Implementierungsklassen:
AbstractUserManager
An UserManager performs
User
objects related tasks on behalf of the
BaseSecurityService
.
The responsibilities of this class include loading data of an user from the
storage and putting them into the
User
objects, saving those data to
the permanent storage, and authenticating users.- Version:
- $Id$
- Autor:
- Eric Pugh, Rafal Krzewski
-
Feldübersicht
Felder -
Methodenübersicht
Modifizierer und TypMethodeBeschreibung<T extends User>
TCreates new user account with specified attributes.void
authenticate
(User user, String password) Authenticate an User with the specified password.void
changePassword
(User user, String oldPassword, String newPassword) Change the password for an User.boolean
checkExists
(String userName) Check whether a specified user's account exists.boolean
checkExists
(User user) Determines if theUser
exists in the security system.void
forcePassword
(User user, String password) Forcibly sets new password for an User.<T extends AccessControlList>
TReturn a Class object representing the system's chosen implementation of of ACL interface.Retrieves all users defined in the system.<T extends User>
TRetrieve a user from persistent storage using username as the key.<T extends User>
TRetrieve a user from persistent storage using username as the key, and authenticate the user.<T extends User>
TgetUserById
(Object id) Retrieve a user from persistent storage using the id as the key.<T extends User>
TConstruct a blank User object.<T extends User>
TgetUserInstance
(String userName) Construct a blank User object.void
removeUser
(User user) Removes an user account from the system.retrieveUserList
(Object criteria) Retrieve a list of users that meet the specified criteria.void
Saves User's data in the permanent storage.
-
Felddetails
-
ROLE
Avalon role - used to id the component within the manager
-
-
Methodendetails
-
getUserInstance
Construct a blank User object. This method calls getUserClass, and then creates a new object using the default constructor.- Typparameter:
T
- User type- Gibt zurück:
- an object implementing User interface.
- Löst aus:
DataBackendException
- if the object could not be instantiated.
-
getUserInstance
Construct a blank User object. This method calls getUserClass, and then creates a new object using the default constructor.- Typparameter:
T
- User- Parameter:
userName
- The name of the user.- Gibt zurück:
- an object implementing User interface.
- Löst aus:
DataBackendException
- if the object could not be instantiated.
-
checkExists
Determines if theUser
exists in the security system.- Parameter:
user
- aUser
value- Gibt zurück:
- true if the user exists in the system, false otherwise
- Löst aus:
DataBackendException
- when more than one user with the same name exists.
-
checkExists
Check whether a specified user's account exists. The login name is used for looking up the account.- Parameter:
userName
- The name of the user to be checked.- Gibt zurück:
- true if the specified account exists
- Löst aus:
DataBackendException
- if there was an error accessing the data backend.
-
getUser
Retrieve a user from persistent storage using username as the key.- Typparameter:
T
- User- Parameter:
username
- the name of the user.- Gibt zurück:
- an User object.
- Löst aus:
UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getUserById
Retrieve a user from persistent storage using the id as the key.- Typparameter:
T
- User- Parameter:
id
- the id of the user.- Gibt zurück:
- an User object.
- Löst aus:
UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getUser
<T extends User> T getUser(String username, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException Retrieve a user from persistent storage using username as the key, and authenticate the user. The implementation may chose to authenticate to the server as the user whose data is being retrieved.- Typparameter:
T
- User- Parameter:
username
- the name of the user.password
- the user supplied password.- Gibt zurück:
- an User object.
- Löst aus:
PasswordMismatchException
- if the supplied password was incorrect.UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getAllUsers
Retrieves all users defined in the system.- Typparameter:
T
- User type- Gibt zurück:
- the names of all users defined in the system.
- Löst aus:
DataBackendException
- if there was an error accessing the data backend.
-
retrieveUserList
Retrieve a list of users that meet the specified criteria.- Parameter:
criteria
- The criteria of selection.- Gibt zurück:
- a List of users meeting the criteria.
- Löst aus:
DataBackendException
- if there is a problem accessing the storage.
-
saveUser
Saves User's data in the permanent storage. The user account is required to exist in the storage.- Parameter:
user
- the user object to save- Löst aus:
UnknownEntityException
- if the user's account does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
authenticate
void authenticate(User user, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException Authenticate an User with the specified password. If authentication is successful the method returns nothing. If there are any problems, exception was thrown.- Parameter:
user
- an User object to authenticate.password
- the user supplied password.- Löst aus:
PasswordMismatchException
- if the supplied password was incorrect.UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
addUser
<T extends User> T addUser(T user, String password) throws EntityExistsException, DataBackendException Creates new user account with specified attributes.- Parameter:
user
- the object describing account to be created.password
- The password to use for the object creation- Gibt zurück:
- User the user added
- Löst aus:
DataBackendException
- if there was an error accessing the data backend.EntityExistsException
- if the user account already exists.
-
removeUser
Removes an user account from the system.- Parameter:
user
- the object describing the account to be removed.- Löst aus:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the user account is not present.
-
changePassword
void changePassword(User user, String oldPassword, String newPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException Change the password for an User.- Parameter:
user
- an User to change password for.oldPassword
- the current password suplied by the user.newPassword
- the current password requested by the user.- Löst aus:
PasswordMismatchException
- if the supplied password was incorrect.UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
forcePassword
Forcibly sets new password for an User. This is supposed by the administrator to change the forgotten or compromised passwords. Certain implementatations of this feature would require administrative level access to the authenticating server / program.- Parameter:
user
- an User to change password for.password
- the new password.- Löst aus:
UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getACL
Return a Class object representing the system's chosen implementation of of ACL interface.- Typparameter:
T
- AccessControlList- Parameter:
user
- the user- Gibt zurück:
- systems's chosen implementation of ACL interface.
- Löst aus:
UnknownEntityException
- if the implementation of ACL interface could not be determined, or does not exist.
-