Class HibernateRoleManagerImpl
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.AbstractRoleManager
org.apache.fulcrum.security.hibernate.HibernateRoleManagerImpl
- 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
,RoleManager
public class HibernateRoleManagerImpl extends AbstractRoleManager
This implementation persists to a database via Hibernate.
- Version:
- $Id: HibernateRoleManagerImpl.java 1845861 2018-11-05 22:43:28Z painter $
- Author:
- Eric Pugh
- See Also:
- Serialized Form
-
Field Summary
-
Constructor Summary
Constructors Constructor Description HibernateRoleManagerImpl()
-
Method Summary
Modifier and Type Method Description boolean
checkExists(String roleName)
Determines if theRole
exists in the security system.RoleSet
getAllRoles()
Retrieves all roles defined in the system.PersistenceHelper
getPersistenceHelper()
Role
getRoleById(Object id)
Retrieve a Role object with specified id.protected Role
persistNewRole(Role role)
Creates a new role with specified attributes.void
removeRole(Role role)
Removes a Role from the system.void
renameRole(Role role, String name)
Renames an existing Role.Methods inherited from class org.apache.fulcrum.security.spi.AbstractRoleManager
addRole, checkExists, getRoleByName, getRoleInstance, getRoleInstance
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
-
HibernateRoleManagerImpl
public HibernateRoleManagerImpl()
-
-
Method Details
-
renameRole
Renames an existing Role.- Parameters:
role
- The object describing the role to be renamed.name
- the new name for the role.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the role does not exist.
-
checkExists
Determines if theRole
exists in the security system.- Parameters:
roleName
- aRole
value- Returns:
- true if the role name exists in the system, false otherwise
- Throws:
DataBackendException
- when more than one Role with the same name exists.
-
getAllRoles
Retrieves all roles defined in the system.- Returns:
- the names of all roles defined in the system.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
persistNewRole
Creates a new role with specified attributes.- Specified by:
persistNewRole
in classAbstractRoleManager
- Parameters:
role
- the object describing the role to be created.- Returns:
- a new Role object that has id set up properly.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
removeRole
Removes a Role from the system.- Parameters:
role
- The object describing the role to be removed.- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the role does not exist.
-
getPersistenceHelper
- Returns:
- Returns the persistenceHelper.
-
getRoleById
Retrieve a Role object with specified id.- Specified by:
getRoleById
in interfaceRoleManager
- Overrides:
getRoleById
in classAbstractRoleManager
- Parameters:
id
- the id of the Role.- Returns:
- an object representing the Role with specified id.
- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the role does not exist.
-