Package org.apache.fulcrum.security.spi
Klasse AbstractUserManager
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.apache.fulcrum.security.spi.AbstractManager
org.apache.fulcrum.security.spi.AbstractEntityManager
org.apache.fulcrum.security.spi.AbstractUserManager
- Alle implementierten Schnittstellen:
Serializable
,org.apache.avalon.framework.activity.Disposable
,org.apache.avalon.framework.configuration.Configurable
,org.apache.avalon.framework.logger.LogEnabled
,org.apache.avalon.framework.service.Serviceable
,org.apache.avalon.framework.thread.ThreadSafe
,UserManager
This implementation keeps all objects in memory. This is mostly meant to help
with testing and prototyping of ideas.
- Version:
- $Id$
- Autor:
- Eric Pugh
- Siehe auch:
-
Feldübersicht
Von Klasse geerbte Felder org.apache.fulcrum.security.spi.AbstractManager
manager
Von Schnittstelle geerbte Felder org.apache.fulcrum.security.UserManager
ROLE
-
Konstruktorübersicht
Konstruktoren -
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
(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>
TReturn a Class object representing the system's chosen implementation of of ACL interface.<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 object with specified Id.<T extends User>
TConstruct a blank User object.<T extends User>
TgetUserInstance
(String userName) Construct a blank User object.protected abstract <T extends User>
TpersistNewUser
(T user) Von Klasse geerbte Methoden org.apache.fulcrum.security.spi.AbstractEntityManager
configure, getClassName, setClassName
Von Klasse geerbte Methoden org.apache.fulcrum.security.spi.AbstractManager
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
Von Klasse geerbte Methoden org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Von Klasse geerbte Methoden java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Von Schnittstelle geerbte Methoden org.apache.fulcrum.security.UserManager
checkExists, getAllUsers, removeUser, retrieveUserList, saveUser
-
Konstruktordetails
-
AbstractUserManager
public AbstractUserManager()
-
-
Methodendetails
-
persistNewUser
- Typparameter:
T
- User type- Parameter:
user
- user to persist- Gibt zurück:
- a User object
- Löst aus:
DataBackendException
- if fail to connect
-
getACL
Beschreibung aus Schnittstelle kopiert:UserManager
Return a Class object representing the system's chosen implementation of of ACL interface.- Angegeben von:
getACL
in SchnittstelleUserManager
- 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.
-
checkExists
Check whether a specified user's account exists. The login name is used for looking up the account.- Angegeben von:
checkExists
in SchnittstelleUserManager
- Parameter:
user
- 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
public <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.- Angegeben von:
getUser
in SchnittstelleUserManager
- 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 account does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getUser
Beschreibung aus Schnittstelle kopiert:UserManager
Retrieve a user from persistent storage using username as the key.- Angegeben von:
getUser
in SchnittstelleUserManager
- Typparameter:
T
- User- Parameter:
name
- the name of the user.- Gibt zurück:
- an User object.
- Löst aus:
DataBackendException
- if there is a problem accessing the storage.UnknownEntityException
- if the user's record does not exist in the database.
-
getUserById
public <T extends User> T getUserById(Object id) throws DataBackendException, UnknownEntityException Retrieve a User object with specified Id.- Angegeben von:
getUserById
in SchnittstelleUserManager
- Typparameter:
T
- User- Parameter:
id
- the id of the User.- Gibt zurück:
- an object representing the User with specified id.
- Löst aus:
UnknownEntityException
- if the user does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
authenticate
public 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.- Angegeben von:
authenticate
in SchnittstelleUserManager
- 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 account does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
changePassword
public void changePassword(User user, String oldPassword, String newPassword) throws PasswordMismatchException, UnknownEntityException, DataBackendException Change the password for an User. The user must have supplied the old password to allow the change.- Angegeben von:
changePassword
in SchnittstelleUserManager
- Parameter:
user
- an User to change password for.oldPassword
- The old password to verifynewPassword
- The new password to set- Löst aus:
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.
-
forcePassword
public void forcePassword(User user, String password) throws UnknownEntityException, DataBackendException 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.- Angegeben von:
forcePassword
in SchnittstelleUserManager
- 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.
-
getUserInstance
Construct a blank User object. This method calls getUserClass, and then creates a new object using the default constructor.- Angegeben von:
getUserInstance
in SchnittstelleUserManager
- 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.- Angegeben von:
getUserInstance
in SchnittstelleUserManager
- 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.
-
addUser
public <T extends User> T addUser(T user, String password) throws DataBackendException, EntityExistsException Creates new user account with specified attributes.- Angegeben von:
addUser
in SchnittstelleUserManager
- Parameter:
user
- the object describing account to be created.password
- The password to use for the account.- 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.
-
getACLFactory
- Gibt zurück:
- Returns the ACLFactory.
-