Class HibernateGroupManagerImpl
- 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.hibernate.HibernateGroupManagerImpl
-
- 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 HibernateGroupManagerImpl extends AbstractGroupManager
This implementation persists to a database via Hibernate.- Version:
- $Id: HibernateGroupManagerImpl.java 1374014 2012-08-16 19:47:27Z tv $
- 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 HibernateGroupManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkExists(String groupName)
Determines if theGroup
exists in the security system.GroupSet
getAllGroups()
Retrieves all groups defined in the system.Group
getGroupById(Object id)
Retrieve a Group object with specified id.Group
getGroupByName(String name)
Retrieve a Group object with specified name.PersistenceHelper
getPersistenceHelper()
protected Group
persistNewGroup(Group 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.-
Methods inherited from class org.apache.fulcrum.security.spi.AbstractGroupManager
addGroup, checkExists, 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
-
-
-
-
Constructor Detail
-
HibernateGroupManagerImpl
public HibernateGroupManagerImpl()
-
-
Method Detail
-
getGroupByName
public Group 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.- 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.- 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.- 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 theGroup
exists in the security system.- 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.
-
persistNewGroup
protected Group persistNewGroup(Group 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.
-
getPersistenceHelper
public PersistenceHelper getPersistenceHelper()
- Returns:
- Returns the persistenceHelper.
-
getGroupById
public Group 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.
-
-