public interface UserManager
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.Modifier and Type | Field and Description |
---|---|
static String |
ROLE
Avalon role - used to id the component within the manager
|
Modifier and Type | Method and Description |
---|---|
<T extends User> |
addUser(T user,
String password)
Creates 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 the
User exists in the security system. |
void |
forcePassword(User user,
String password)
Forcibly sets new password for an User.
|
<T extends AccessControlList> |
getACL(User user)
Return a Class object representing the system's chosen implementation of
of ACL interface.
|
UserSet |
getAllUsers()
Retrieves all users defined in the system.
|
<T extends User> |
getUser(String username)
Retrieve a user from persistent storage using username as the key.
|
<T extends User> |
getUser(String username,
String password)
Retrieve a user from persistent storage using username as the key, and
authenticate the user.
|
<T extends User> |
getUserById(Object id)
Retrieve a user from persistent storage using the id as the key.
|
<T extends User> |
getUserInstance()
Construct a blank User object.
|
<T extends User> |
getUserInstance(String userName)
Construct a blank User object.
|
void |
removeUser(User user)
Removes an user account from the system.
|
void |
saveUser(User user)
Saves User's data in the permanent storage.
|
static final String ROLE
<T extends User> T getUserInstance() throws DataBackendException
DataBackendException
- if the object could not be instantiated.<T extends User> T getUserInstance(String userName) throws DataBackendException
userName
- The name of the user.DataBackendException
- if the object could not be instantiated.boolean checkExists(User user) throws DataBackendException
User
exists in the security system.role
- a User
valueDataBackendException
- when more than one user with the same name exists.Exception
- A generic exception.boolean checkExists(String userName) throws DataBackendException
userName
- The name of the user to be checked.DataBackendException
- if there was an error accessing the data backend.<T extends User> T getUser(String username) throws UnknownEntityException, DataBackendException
username
- the name of the user.UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.<T extends User> T getUserById(Object id) throws UnknownEntityException, DataBackendException
id
- the id of the user.UnknownEntityException
- if the user's record does not exist in the database.DataBackendException
- if there is a problem accessing the storage.<T extends User> T getUser(String username, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException
username
- the name of the user.password
- the user supplied password.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.UserSet getAllUsers() throws DataBackendException
DataBackendException
- if there was an error accessing the data backend.void saveUser(User user) throws UnknownEntityException, DataBackendException
user
- the user object to saveUnknownEntityException
- if the user's account does not exist in the database.DataBackendException
- if there is a problem accessing the storage.void authenticate(User user, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException
user
- an User object to authenticate.password
- the user supplied password.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.<T extends User> T addUser(T user, String password) throws EntityExistsException, DataBackendException
user
- the object describing account to be created.password
- The password to use for the object creationDataBackendException
- if there was an error accessing the data backend.EntityExistsException
- if the user account already exists.void removeUser(User user) throws UnknownEntityException, DataBackendException
user
- 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.void changePassword(User user, String oldPassword, String newPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException
user
- an User to change password for.oldPassword
- the current password suplied by the user.newPassword
- the current password requested by the user.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.void forcePassword(User user, String password) throws UnknownEntityException, DataBackendException
user
- 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.<T extends AccessControlList> T getACL(User user) throws UnknownEntityException
UnknownEntityException
- if the implementation of ACL interface could not be
determined, or does not exist.Copyright © 2011-2015 The Apache Software Foundation. All Rights Reserved.