Class MemoryUserManagerImpl
- 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
-
- org.apache.fulcrum.security.memory.MemoryUserManagerImpl
-
- All Implemented Interfaces:
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
- Direct Known Subclasses:
MemoryTurbineUserManagerImpl
public class MemoryUserManagerImpl extends AbstractUserManager
This implementation keeps all objects in memory. This is mostly meant to help with testing and prototyping of ideas.- Version:
- $Id$
- Author:
- Eric Pugh
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.fulcrum.security.spi.AbstractManager
manager
-
Fields inherited from interface org.apache.fulcrum.security.UserManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description MemoryUserManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkExists(String userName)
Check whether a specified user's account exists.UserSet
getAllUsers()
Retrieves all users defined in the system.protected <T extends User>
TpersistNewUser(T user)
Creates new user account with specified attributes.void
removeUser(User user)
Removes an user account from the system.void
saveUser(User user)
Stores User attributes.-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractUserManager
addUser, authenticate, changePassword, checkExists, forcePassword, getACL, getACLFactory, getUser, getUser, getUserById, getUserInstance, getUserInstance
-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractEntityManager
configure, getClassName, setClassName
-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractManager
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
-
-
-
-
Constructor Detail
-
MemoryUserManagerImpl
public MemoryUserManagerImpl()
-
-
Method Detail
-
checkExists
public boolean checkExists(String userName) throws DataBackendException
Check whether a specified user's account exists. The login name is used for looking up the account.- Parameters:
userName
- The name of the user to be checked.- Returns:
- true if the specified account exists
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
getAllUsers
public UserSet getAllUsers() throws DataBackendException
Retrieves all users defined in the system.- Returns:
- the names of all users defined in the system.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
removeUser
public void removeUser(User user) throws DataBackendException, UnknownEntityException
Removes an user account from the system.- Parameters:
user
- the object describing the account to be removed.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the user account is not present.
-
persistNewUser
protected <T extends User> T persistNewUser(T user) throws DataBackendException
Creates new user account with specified attributes.- Specified by:
persistNewUser
in classAbstractUserManager
- Parameters:
user
- the object describing account to be created.- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
saveUser
public void saveUser(User user) throws DataBackendException, UnknownEntityException
Stores User attributes. The User is required to exist in the system.- Parameters:
user
- The User to be stored.- Throws:
DataBackendException
- if there was an error accessing the data backendUnknownEntityException
- if the role does not exist.
-
-