Class MemoryGroupManagerImpl
- 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.AbstractGroupManager
-
- org.apache.fulcrum.security.memory.MemoryGroupManagerImpl
-
- 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,GroupManager
public class MemoryGroupManagerImpl extends AbstractGroupManager implements GroupManager
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.GroupManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description MemoryGroupManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckExists(String groupName)Determines if theGroupexists in the security system.GroupSetgetAllGroups()Retrieves all groups defined in the system.protected <T extends Group>
TpersistNewGroup(T group)Creates a new group with specified attributes.voidremoveGroup(Group group)Removes a Group from the system.voidrenameGroup(Group group, String name)Renames an existing Group.-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractGroupManager
addGroup, checkExists, getGroupById, getGroupByName, getGroupInstance, getGroupInstance
-
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
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.fulcrum.security.GroupManager
addGroup, checkExists, getGroupById, getGroupByName, getGroupInstance, getGroupInstance
-
-
-
-
Method Detail
-
getAllGroups
public GroupSet getAllGroups() throws DataBackendException
Retrieves all groups defined in the system.- Specified by:
getAllGroupsin interfaceGroupManager- Returns:
- the names of all groups defined in the system.
- Throws:
DataBackendException- if there was an error accessing the data backend.
-
removeGroup
public void removeGroup(Group group) throws DataBackendException, UnknownEntityException
Removes a Group from the system.- Specified by:
removeGroupin interfaceGroupManager- Parameters:
group- The object describing the group to be removed.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the group does not exist.
-
renameGroup
public void renameGroup(Group group, String name) throws DataBackendException, UnknownEntityException
Renames an existing Group.- Specified by:
renameGroupin interfaceGroupManager- Parameters:
group- The object describing the group to be renamed.name- the new name for the group.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the group does not exist.
-
checkExists
public boolean checkExists(String groupName) throws DataBackendException
Determines if theGroupexists in the security system.- Specified by:
checkExistsin interfaceGroupManager- Parameters:
groupName- aGroupvalue- Returns:
- true if the group exists in the system, false otherwise
- Throws:
DataBackendException- when more than one Group with the same name exists.
-
persistNewGroup
protected <T extends Group> T persistNewGroup(T group) throws DataBackendException
Creates a new group with specified attributes.- Specified by:
persistNewGroupin classAbstractGroupManager- Parameters:
group- the object describing the group to be created.- Returns:
- a new Group object that has id set up properly.
- Throws:
DataBackendException- if there was an error accessing the data backend.
-
-