Class MemoryRoleManagerImpl
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.memory.MemoryRoleManagerImpl
- 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
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:
-
Field Summary
Fields inherited from class org.apache.fulcrum.security.spi.AbstractManager
manager
Fields inherited from interface org.apache.fulcrum.security.RoleManager
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
checkExists
(String roleName) Determines if theRole
exists in the security system.Retrieves all roles defined in the system.protected <T extends Role>
TpersistNewRole
(T 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, getRoleById, 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
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Constructor Details
-
MemoryRoleManagerImpl
public MemoryRoleManagerImpl()
-
-
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
- aString
value- Returns:
- true if the role exists in the system, false otherwise
-
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.
-