Class TorqueAbstractGroupManager
- 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.torque.TorqueAbstractGroupManager
-
- 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
,LazyLoadable
- Direct Known Subclasses:
PeerGroupManager
,TorqueBasicGroupManagerImpl
,TorqueDynamicGroupManagerImpl
public abstract class TorqueAbstractGroupManager extends AbstractGroupManager implements LazyLoadable
This implementation persists to a database via Torque.- Version:
- $Id:$
- Author:
- Thomas Vandahl
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Boolean
lazyLoading
-
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 TorqueAbstractGroupManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
checkExists(String groupName)
Determines if theGroup
exists in the security system.void
configure(org.apache.avalon.framework.configuration.Configuration conf)
Avalon Service lifecycle methodprotected abstract <T extends Group>
List<T>doSelectAllGroups(Connection con)
Get all specialized Groupsprotected abstract <T extends Group>
TdoSelectById(Integer id, Connection con)
Get a specialized Group by idprotected abstract <T extends Group>
TdoSelectByName(String name, Connection con)
Get a specialized Group by nameGroupSet
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.Boolean
getLazyLoading()
protected <T extends Group>
TpersistNewGroup(T group)
Creates a new group with specified attributes.void
removeGroup(Group group)
Removes a Group from the system.void
renameGroup(Group group, String name)
Renames an existing Group.void
setLazyLoading(Boolean lazyLoading)
-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractGroupManager
addGroup, checkExists, getGroupInstance, getGroupInstance
-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractEntityManager
getClassName, setClassName
-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractManager
dispose, getGroupManager, getPermissionManager, getRoleManager, getServiceManager, getUserManager, release, resolve, service
-
-
-
-
Field Detail
-
lazyLoading
protected Boolean lazyLoading
-
-
Method Detail
-
configure
public void configure(org.apache.avalon.framework.configuration.Configuration conf) throws org.apache.avalon.framework.configuration.ConfigurationException
Avalon Service lifecycle method- Specified by:
configure
in interfaceorg.apache.avalon.framework.configuration.Configurable
- Overrides:
configure
in classAbstractEntityManager
- Throws:
org.apache.avalon.framework.configuration.ConfigurationException
-
doSelectAllGroups
protected abstract <T extends Group> List<T> doSelectAllGroups(Connection con) throws org.apache.torque.TorqueException
Get all specialized Groups- Parameters:
con
- a database connection- Returns:
- a List of Group instances
- Throws:
org.apache.torque.TorqueException
- if any database error occurs
-
doSelectByName
protected abstract <T extends Group> T doSelectByName(String name, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
Get a specialized Group by name- Parameters:
name
- the name of the groupcon
- a database connection- Returns:
- a Group instance
- Throws:
org.apache.torque.NoRowsException
- if no such group existsorg.apache.torque.TooManyRowsException
- if multiple groups with the given name existorg.apache.torque.TorqueException
- if any database error occurs if any other database error occurs
-
doSelectById
protected abstract <T extends Group> T doSelectById(Integer id, Connection con) throws org.apache.torque.NoRowsException, org.apache.torque.TooManyRowsException, org.apache.torque.TorqueException
Get a specialized Group by id- Parameters:
id
- the id of the groupcon
- a database connection- Returns:
- a Group instance
- Throws:
org.apache.torque.NoRowsException
- if no such group existsorg.apache.torque.TooManyRowsException
- if multiple groups with the given id existorg.apache.torque.TorqueException
- if any database error occurs if any other database error occurs
-
persistNewGroup
protected <T extends Group> T persistNewGroup(T group) throws DataBackendException
Creates a new group with specified attributes.- Specified by:
persistNewGroup
in 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.
-
renameGroup
public void renameGroup(Group group, String name) throws DataBackendException, UnknownEntityException
Renames an existing Group.- Specified by:
renameGroup
in 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.
-
removeGroup
public void removeGroup(Group group) throws DataBackendException, UnknownEntityException
Removes a Group from the system.- Specified by:
removeGroup
in 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.
-
getGroupByName
public <T extends Group> T getGroupByName(String name) throws DataBackendException, UnknownEntityException
Retrieve a Group object with specified name.- Specified by:
getGroupByName
in interfaceGroupManager
- Overrides:
getGroupByName
in classAbstractGroupManager
- 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.
-
getAllGroups
public GroupSet getAllGroups() throws DataBackendException
Retrieves all groups defined in the system.- Specified by:
getAllGroups
in interfaceGroupManager
- Returns:
- the names of all groups defined in the system.
- Throws:
DataBackendException
- if there was an error accessing the data backend.
-
checkExists
public boolean checkExists(String groupName) throws DataBackendException
Determines if theGroup
exists in the security system.- Specified by:
checkExists
in interfaceGroupManager
- Parameters:
groupName
- aGroup
value- Returns:
- true if the group name exists in the system, false otherwise
- Throws:
DataBackendException
- when more than one Group with the same name exists.
-
getGroupById
public <T extends Group> T getGroupById(Object id) throws DataBackendException, UnknownEntityException
Retrieve a Group object with specified id.- Specified by:
getGroupById
in interfaceGroupManager
- Overrides:
getGroupById
in classAbstractGroupManager
- Parameters:
id
- the id of the Group.- Returns:
- an object representing the Group with specified id.
- Throws:
DataBackendException
- if there was an error accessing the data backend.UnknownEntityException
- if the group does not exist.
-
getLazyLoading
public Boolean getLazyLoading()
- Specified by:
getLazyLoading
in interfaceLazyLoadable
-
setLazyLoading
public void setLazyLoading(Boolean lazyLoading)
- Specified by:
setLazyLoading
in interfaceLazyLoadable
-
-