public abstract class AbstractUserManager extends AbstractEntityManager implements UserManager
manager
ROLE
Constructor and Description |
---|
AbstractUserManager() |
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(User user)
Check whether a specified user's account exists.
|
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.
|
ACLFactory |
getACLFactory() |
<T extends User> |
getUser(String name)
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 object with specified Id.
|
<T extends User> |
getUserInstance()
Construct a blank User object.
|
<T extends User> |
getUserInstance(String userName)
Construct a blank User object.
|
protected abstract <T extends User> |
persistNewUser(T user) |
configure, getClassName, setClassName
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
checkExists, getAllUsers, removeUser, saveUser
protected abstract <T extends User> T persistNewUser(T user) throws DataBackendException
DataBackendException
public <T extends AccessControlList> T getACL(User user) throws UnknownEntityException
UserManager
getACL
in interface UserManager
UnknownEntityException
- if the implementation of ACL interface could not be
determined, or does not exist.public boolean checkExists(User user) throws DataBackendException
checkExists
in interface UserManager
user
- The user to be checked.DataBackendException
- if there was an error accessing the data backend.public <T extends User> T getUser(String userName, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException
getUser
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
- if there is a problem accessing the storage.public <T extends User> T getUser(String name) throws DataBackendException, UnknownEntityException
UserManager
getUser
in interface UserManager
name
- the name of the user.DataBackendException
- if there is a problem accessing the storage.UnknownEntityException
- if the user's record does not exist in the database.public <T extends User> T getUserById(Object id) throws DataBackendException, UnknownEntityException
getUserById
in interface UserManager
id
- the id of the User.UnknownEntityException
- if the user does not exist in the database.DataBackendException
- if there is a problem accessing the storage.public void authenticate(User user, String password) throws PasswordMismatchException, UnknownEntityException, DataBackendException
authenticate
in interface UserManager
user
- 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, String oldPassword, String newPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException
changePassword
in interface UserManager
user
- an User to change password for.oldPassword
- The old password to verifynewPassword
- The new password to setPasswordMismatchException
- 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, 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
- if there is a problem accessing the storage.public <T extends User> T getUserInstance() throws DataBackendException
getUserInstance
in interface UserManager
DataBackendException
- if the object could not be instantiated.public <T extends User> T getUserInstance(String userName) throws DataBackendException
getUserInstance
in interface UserManager
userName
- The name of the user.DataBackendException
- if the object could not be instantiated.public <T extends User> T addUser(T user, String password) throws DataBackendException, EntityExistsException
addUser
in interface UserManager
user
- the object describing account to be created.password
- The password to use for the account.DataBackendException
- if there was an error accessing the data backend.EntityExistsException
- if the user account already exists.public ACLFactory getACLFactory()
Copyright © 2011–2017 The Apache Software Foundation. All rights reserved.