Class HibernateUserManagerImpl
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.hibernate.HibernateUserManagerImpl
- 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
public class HibernateUserManagerImpl extends AbstractUserManager
This implementation persists to a database via Hibernate.
- Version:
- $Id: HibernateUserManagerImpl.java 1845861 2018-11-05 22:43:28Z painter $
- Author:
- Eric Pugh
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HibernateUserManagerImpl()
-
Method Summary
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.PersistenceHelper
getPersistenceHelper()
User
getUser(String userName)
Retrieve a user from persistent storage using username as the key.User
getUserById(Object id)
Retrieve a User object with specified id.User
persistNewUser(User 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, 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 Details
-
HibernateUserManagerImpl
public HibernateUserManagerImpl()
-
-
Method Details
-
checkExists
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.
-
getUser
Retrieve a user from persistent storage using username as the key.- Specified by:
getUser
in interfaceUserManager
- Overrides:
getUser
in classAbstractUserManager
- Parameters:
userName
- the name of the user.- Returns:
- an User object.
- Throws:
UnknownEntityException
- if the user's account does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
getAllUsers
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
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
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
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 backend.UnknownEntityException
- if the role does not exist.
-
getPersistenceHelper
- Returns:
- Returns the persistenceHelper.
-
getUserById
Retrieve a User object with specified id.- Specified by:
getUserById
in interfaceUserManager
- Overrides:
getUserById
in classAbstractUserManager
- Parameters:
id
- the id of the User.- Returns:
- an object representing the User with specified id.
- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the user does not exist.
-