Package org.apache.fulcrum.security.spi
Class AbstractGroupManager
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
- 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
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.GroupManager
ROLE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T extends Group>
TaddGroup
(T group) Creates a new group with specified attributes.boolean
checkExists
(Group group) Check whether a specified group exists.<T extends Group>
TgetGroupById
(Object id) Retrieve a Group object with specified Id.<T extends Group>
TgetGroupByName
(String name) Retrieve a Group object with specified name.<T extends Group>
TConstruct a blank Group object.<T extends Group>
TgetGroupInstance
(String groupName) Construct a blank Group object.protected abstract <T extends Group>
TpersistNewGroup
(T group) 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
checkExists, getAllGroups, removeGroup, renameGroup
-
Constructor Details
-
AbstractGroupManager
public AbstractGroupManager()
-
-
Method Details
-
persistNewGroup
- Throws:
DataBackendException
-
getGroupInstance
Construct a blank Group object. This method calls getGroupClass, and then creates a new object using the default constructor.- Specified by:
getGroupInstance
in interfaceGroupManager
- Type Parameters:
T
- The group extendingGroup
- Returns:
- an object implementing Group interface.
- Throws:
DataBackendException
- if the object could not be instantiated.
-
getGroupInstance
Construct a blank Group object. This method calls getGroupClass, and then creates a new object using the default constructor.- Specified by:
getGroupInstance
in interfaceGroupManager
- Type Parameters:
T
- The group of typeGroup
- Parameters:
groupName
- The name of the Group- Returns:
- an object implementing Group interface.
- Throws:
DataBackendException
- if the object could not be instantiated.
-
getGroupByName
public <T extends Group> T getGroupByName(String name) throws DataBackendException, UnknownEntityException Retrieve a Group object with specified name.- Specified by:
getGroupByName
in interfaceGroupManager
- Type Parameters:
T
- The group of typeGroup
- Parameters:
name
- the name of the Group.- Returns:
- an object representing the Group with specified name.
- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the group does not exist.
-
getGroupById
public <T extends Group> T getGroupById(Object id) throws DataBackendException, UnknownEntityException Retrieve a Group object with specified Id.- Specified by:
getGroupById
in interfaceGroupManager
- Type Parameters:
T
- Group type- Parameters:
id
- the ID of the Group.- Returns:
- an object representing the Group with specified name.
- Throws:
UnknownEntityException
- if the permission does not exist in the database.DataBackendException
- if there is a problem accessing the storage.
-
addGroup
Creates a new group with specified attributes.- Specified by:
addGroup
in interfaceGroupManager
- Type Parameters:
T
-- 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.EntityExistsException
- if the group already exists.
-
checkExists
Check whether a specified group exists. The name is used for looking up the group- Specified by:
checkExists
in interfaceGroupManager
- Parameters:
group
- The group to be checked.- Returns:
- true if the specified group exists
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-