Class HibernateModelManagerImpl
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.apache.fulcrum.security.spi.AbstractManager
-
- org.apache.fulcrum.security.model.dynamic.AbstractDynamicModelManager
-
- org.apache.fulcrum.security.hibernate.dynamic.HibernateModelManagerImpl
-
- All Implemented Interfaces:
Serializable,org.apache.avalon.framework.activity.Disposable,org.apache.avalon.framework.logger.LogEnabled,org.apache.avalon.framework.service.Serviceable,org.apache.avalon.framework.thread.ThreadSafe,DynamicModelManager,ModelManager
public class HibernateModelManagerImpl extends AbstractDynamicModelManager implements DynamicModelManager
This implementation persists to a database via Hibernate.- Version:
- $Id: HibernateModelManagerImpl.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.ModelManager
ROLE
-
-
Constructor Summary
Constructors Constructor Description HibernateModelManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddDelegate(User delegator, User delegatee)It is expected the real implementation will overide this and save either side of the function.PersistenceHelpergetPersistenceHelper()voidgrant(Group group, Role role)Grants a Group a Rolevoidgrant(Role role, Permission permission)Grants a Role a Permissionvoidgrant(User user, Group group)Puts a user in a group.voidremoveDelegate(User delegator, User delegatee)Implementors should overide this to save and call super if they want the base class to do the workvoidrevoke(Group group, Role role)Revokes a Role from a Group.voidrevoke(Role role, Permission permission)Revokes a Permission from a Role.voidrevoke(User user, Group group)Removes a user in a group.-
Methods inherited from class org.apache.fulcrum.security.model.dynamic.AbstractDynamicModelManager
revokeAll, revokeAll, revokeAll, revokeAll
-
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.model.dynamic.DynamicModelManager
revokeAll, revokeAll, revokeAll, revokeAll
-
-
-
-
Constructor Detail
-
HibernateModelManagerImpl
public HibernateModelManagerImpl()
-
-
Method Detail
-
revoke
public void revoke(Group group, Role role) throws DataBackendException, UnknownEntityException
Revokes a Role from a Group.- Specified by:
revokein interfaceDynamicModelManager- Parameters:
group- the Group.role- the Role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if group or role is not present.
-
grant
public void grant(Role role, Permission permission) throws DataBackendException, UnknownEntityException
Grants a Role a Permission- Specified by:
grantin interfaceDynamicModelManager- Parameters:
role- the Role.permission- the Permission.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if role or permission is not present.
-
revoke
public void revoke(Role role, Permission permission) throws DataBackendException, UnknownEntityException
Revokes a Permission from a Role.- Specified by:
revokein interfaceDynamicModelManager- Parameters:
role- the Role.permission- the Permission.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if role or permission is not present.
-
grant
public void grant(User user, Group group) throws DataBackendException, UnknownEntityException
Puts a user in a group. This method is used when adding a user to a group- Specified by:
grantin interfaceDynamicModelManager- Parameters:
user- the User.group- the Group- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the account is not present.
-
revoke
public void revoke(User user, Group group) throws DataBackendException, UnknownEntityException
Removes a user in a group. This method is used when removing a user to a group- Specified by:
revokein interfaceDynamicModelManager- Parameters:
user- the User.group- the Group- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the user or group is not present.
-
grant
public void grant(Group group, Role role) throws DataBackendException, UnknownEntityException
Grants a Group a Role- Specified by:
grantin interfaceDynamicModelManager- Parameters:
group- the Group.role- the Role.- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if group or role is not present.
-
getPersistenceHelper
public PersistenceHelper getPersistenceHelper()
- Returns:
- Returns the persistenceHelper.
-
addDelegate
public void addDelegate(User delegator, User delegatee) throws DataBackendException, UnknownEntityException
Description copied from class:AbstractDynamicModelManagerIt is expected the real implementation will overide this and save either side of the function. It is not abstract as a in memory implementation would not need to do anything.- Specified by:
addDelegatein interfaceDynamicModelManager- Overrides:
addDelegatein classAbstractDynamicModelManager- Parameters:
delegator- Adelegatee- B- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Group is not present.- See Also:
DynamicModelManager.addDelegate(org.apache.fulcrum.security.entity.User, org.apache.fulcrum.security.entity.User)
-
removeDelegate
public void removeDelegate(User delegator, User delegatee) throws DataBackendException, UnknownEntityException
Description copied from class:AbstractDynamicModelManagerImplementors should overide this to save and call super if they want the base class to do the work- Specified by:
removeDelegatein interfaceDynamicModelManager- Overrides:
removeDelegatein classAbstractDynamicModelManager- Parameters:
delegator- Adelegatee- B- Throws:
DataBackendException- if there was an error accessing the data backend.UnknownEntityException- if the Group is not present.- See Also:
DynamicModelManager.removeDelegate(org.apache.fulcrum.security.entity.User, org.apache.fulcrum.security.entity.User)
-
-