Package org.apache.fulcrum.security
Interface GroupManager
-
- All Superinterfaces:
Serializable
- All Known Implementing Classes:
AbstractGroupManager
,MemoryGroupManagerImpl
,PeerGroupManager
,TorqueAbstractGroupManager
,TorqueBasicGroupManagerImpl
,TorqueDynamicGroupManagerImpl
,TorqueTurbineGroupManagerImpl
public interface GroupManager extends Serializable
A GroupManager performsGroup
objects related tasks on behalf of theBaseSecurityService
. The responsibilities of this class include loading data of an group from the storage and putting them into theGroup
objects, saving those data to the permanent storage.- Version:
- $Id$
- Author:
- Eric Pugh
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T extends Group>
TaddGroup(T group)
Creates a new group with specified attributes.boolean
checkExists(String groupName)
Determines if aGroup
exists in the security system with the specified name.boolean
checkExists(Group group)
Determines if theGroup
exists in the security system.GroupSet
getAllGroups()
Retrieves all groups defined in the system.<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>
TgetGroupInstance()
Construct a blank Group object.<T extends Group>
TgetGroupInstance(String groupName)
Construct a blank Group object.void
removeGroup(Group group)
Removes a Group from the system.void
renameGroup(Group group, String name)
Renames an existing Group.
-
-
-
Method Detail
-
getGroupInstance
<T extends Group> T getGroupInstance() throws DataBackendException
Construct a blank Group object. This method calls getGroupClass, and then creates a new object using the default constructor.- Type Parameters:
T
- The group extendingGroup
- Returns:
- an object implementing Group interface.
- Throws:
DataBackendException
- if the object could not be instantiated.
-
getGroupInstance
<T extends Group> T getGroupInstance(String groupName) throws DataBackendException
Construct a blank Group object. This method calls getGroupClass, and then creates a new object using the default constructor.- 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
<T extends Group> T getGroupByName(String name) throws DataBackendException, UnknownEntityException
Retrieve a Group object with specified name.- 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
<T extends Group> T getGroupById(Object id) throws DataBackendException, UnknownEntityException
Retrieve a Group object with specified Id.- 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.
-
renameGroup
void renameGroup(Group group, String name) throws DataBackendException, UnknownEntityException
Renames an existing Group.- 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.
-
removeGroup
void removeGroup(Group group) throws DataBackendException, UnknownEntityException
Removes a Group from the system.- 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.
-
addGroup
<T extends Group> T addGroup(T group) throws DataBackendException, EntityExistsException
Creates a new group with specified attributes.- Type Parameters:
T
-- Parameters:
group
- the object describing the group to be created.- Returns:
- the new Group object.
- Throws:
DataBackendException
- if there was an error accessing the data backend.EntityExistsException
- if the group already exists.
-
getAllGroups
GroupSet getAllGroups() throws DataBackendException
Retrieves all groups defined in the system.- Returns:
- the names of all groups defined in the system.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
checkExists
boolean checkExists(Group group) throws DataBackendException
Determines if theGroup
exists in the security system.- Parameters:
group
- aGroup
value- Returns:
- true if the group exists in the system, false otherwise
- Throws:
DataBackendException
- when more than one group with the same name exists.
-
checkExists
boolean checkExists(String groupName) throws DataBackendException
Determines if aGroup
exists in the security system with the specified name.- Parameters:
groupName
- the name of aGroup
to check.- Returns:
- true if the group exists in the system, false otherwise
- Throws:
DataBackendException
- when more than one group with the same name exists.
-
-