public interface UserManager
User
objects
related tasks on behalf of the
DefaultSecurityService
.
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 | Method and Description |
---|---|
boolean |
accountExists(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,
String password)
Authenticate an User with the specified password.
|
void |
changePassword(User user,
String oldPassword,
String newPassword)
Change the password for an User.
|
void |
createAccount(User user,
String initialPassword)
Creates new user account with specified attributes.
|
void |
forcePassword(User user,
String password)
Forcibly sets new password for an User.
|
<T extends org.apache.fulcrum.security.acl.AccessControlList> |
getACL(User user)
Return a Class object representing the system's chosen implementation of
of ACL interface for the given user
|
<T extends User> |
getAnonymousUser()
Constructs an User object to represent an anonymous user of the
application.
|
<T extends User> |
getUserInstance()
Construct a blank User object.
|
<T extends User> |
getUserInstance(String userName)
Construct a blank User object.
|
void |
init(org.apache.commons.configuration.Configuration conf)
Initializes the UserManager
|
boolean |
isAnonymousUser(User u)
Checks whether a passed user object matches the anonymous user pattern
according to the configured user manager
|
void |
removeAccount(User user)
Removes an user account from the system.
|
<U extends User> |
retrieve(String username)
Retrieve a user from persistent storage using username as the
key.
|
<U extends User> |
retrieve(String username,
String password)
Retrieve a user from persistent storage using username as the
key, and authenticate the user.
|
List<? extends User> |
retrieveList(Object 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.
|
void init(org.apache.commons.configuration.Configuration conf) throws InitializationException
conf
- A Configuration object to init this ManagerInitializationException
- When something went wrong.boolean accountExists(User user) throws org.apache.fulcrum.security.util.DataBackendException
user
- The user to be checked.org.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.boolean accountExists(String userName) throws org.apache.fulcrum.security.util.DataBackendException
userName
- The name of the user to be checked.org.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.<U extends User> U retrieve(String username) throws org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
username
- the name of the user.org.apache.fulcrum.security.util.UnknownEntityException
- if the user's record does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the
storage.List<? extends User> retrieveList(Object criteria) throws org.apache.fulcrum.security.util.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 DB implementation.criteria
- The criteria of selection.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the
storage.<U extends User> U retrieve(String username, String password) throws org.apache.fulcrum.security.util.PasswordMismatchException, org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
username
- the name of the user.password
- the user supplied password.org.apache.fulcrum.security.util.PasswordMismatchException
- if the supplied password was incorrect.org.apache.fulcrum.security.util.UnknownEntityException
- if the user's record does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the storage.void store(User user) throws org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
user
- an User object to store.org.apache.fulcrum.security.util.UnknownEntityException
- if the user's record does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the storage.void saveOnSessionUnbind(User user) throws org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
user
- the user in the sessionorg.apache.fulcrum.security.util.UnknownEntityException
- if the user's account does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the
storage.void authenticate(User user, String password) throws org.apache.fulcrum.security.util.PasswordMismatchException, org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
user
- an User object to authenticate.password
- the user supplied password.org.apache.fulcrum.security.util.PasswordMismatchException
- if the supplied password was incorrect.org.apache.fulcrum.security.util.UnknownEntityException
- if the user's record does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the storage.void createAccount(User user, String initialPassword) throws org.apache.fulcrum.security.util.EntityExistsException, org.apache.fulcrum.security.util.DataBackendException
user
- the object describing account to be created.initialPassword
- password for the new userorg.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.org.apache.fulcrum.security.util.EntityExistsException
- if the user account already exists.void removeAccount(User user) throws org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
user
- the object describing the account to be removed.org.apache.fulcrum.security.util.DataBackendException
- if there was an error accessing the data
backend.org.apache.fulcrum.security.util.UnknownEntityException
- if the user account is not present.void changePassword(User user, String oldPassword, String newPassword) throws org.apache.fulcrum.security.util.PasswordMismatchException, org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
user
- an User to change password for.oldPassword
- the current password suplied by the user.newPassword
- the current password requested by the user.org.apache.fulcrum.security.util.PasswordMismatchException
- if the supplied password was incorrect.org.apache.fulcrum.security.util.UnknownEntityException
- if the user's record does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the storage.void forcePassword(User user, String password) throws org.apache.fulcrum.security.util.UnknownEntityException, org.apache.fulcrum.security.util.DataBackendException
user
- an User to change password for.password
- the new password.org.apache.fulcrum.security.util.UnknownEntityException
- if the user's record does not
exist in the database.org.apache.fulcrum.security.util.DataBackendException
- if there is a problem accessing the storage.<T extends User> T getAnonymousUser() throws org.apache.fulcrum.security.util.UnknownEntityException
org.apache.fulcrum.security.util.UnknownEntityException
- if the anonymous User object couldn't be constructed.boolean isAnonymousUser(User u)
u
- a user object<T extends User> T getUserInstance() throws org.apache.fulcrum.security.util.DataBackendException
org.apache.fulcrum.security.util.DataBackendException
- if the object could not be instantiated.<T extends User> T getUserInstance(String userName) throws org.apache.fulcrum.security.util.DataBackendException
userName
- The name of the user.org.apache.fulcrum.security.util.DataBackendException
- if the object could not be instantiated.<T extends org.apache.fulcrum.security.acl.AccessControlList> T getACL(User user) throws org.apache.fulcrum.security.util.UnknownEntityException
user
- the userorg.apache.fulcrum.security.util.UnknownEntityException
- if the implementation of ACL interface could not be
determined, or does not exist.Copyright © 2000-2015 The Apache Software Foundation. All Rights Reserved.