Class TorqueAbstractDynamicRole
- java.lang.Object
-
- org.apache.fulcrum.security.torque.security.TorqueAbstractSecurityEntity
-
- org.apache.fulcrum.security.torque.dynamic.TorqueAbstractDynamicRole
-
- All Implemented Interfaces:
Serializable
,Role
,SecurityEntity
,DynamicRole
,org.apache.torque.om.ObjectModel
,org.apache.torque.om.Persistent
- Direct Known Subclasses:
BaseTorqueDynamicRole
public abstract class TorqueAbstractDynamicRole extends TorqueAbstractSecurityEntity implements DynamicRole
This abstract class provides the SecurityInterface to the managers.- Version:
- $Id:$
- Author:
- Thomas Vandahl
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description TorqueAbstractDynamicRole()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addGroup(Group group)
This method should only be used by a RoleManager.void
addPermission(Permission permission)
This method should only be used by a RoleManager.void
delete()
Delete this entityString
getDatabaseName()
GroupSet
getGroups()
Get the groups this role belongs to<T extends Group>
Set<T>getGroupsAsSet()
Get the groups this role belongs to as a SetPermissionSet
getPermissions()
Get the permission that are part of this role<T extends Permission>
Set<T>getPermissionsAsSet()
Get the permission that are part of this role as Setprotected List<TorqueDynamicGroupRole>
getTorqueDynamicGroupRolesJoinTorqueDynamicGroup(org.apache.torque.criteria.Criteria criteria, Connection con)
Forward reference to generated code Get a list of association objects, pre-populated with their TorqueDynamicGroup objects.protected List<TorqueDynamicRolePermission>
getTorqueDynamicRolePermissionsJoinTorqueDynamicPermission(org.apache.torque.criteria.Criteria criteria, Connection con)
Forward reference to generated code Get a list of association objects, pre-populated with their TorqueDynamicPermission objects.void
removeGroup(Group group)
This method should only be used by a RoleManager.void
removePermission(Permission permission)
This method should only be used by a RoleManager.void
retrieveAttachedObjects(Connection con)
old contract, lazy is set tofalse
.void
retrieveAttachedObjects(Connection con, Boolean lazy)
Retrieve attached objects such as users, permissions, ...void
setGroups(GroupSet groups)
Set the groups this role belongs to<T extends Group>
voidsetGroupsAsSet(Set<T> groups)
Set the groups this role belongs to as a Setvoid
setPermissions(PermissionSet permissionSet)
Set the permission that are part of this role<T extends Permission>
voidsetPermissionsAsSet(Set<T> permissions)
Set the permission that are part of this role as Setvoid
update(Connection con)
Update this instance to the database with all dependent objects-
Methods inherited from class org.apache.fulcrum.security.torque.security.TorqueAbstractSecurityEntity
getEntityId, getEntityName, getId, getName, setEntityId, setEntityName, setId, setName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.torque.om.ObjectModel
getPrimaryKey, isModified, isNew, setModified, setNew, setPrimaryKey, setPrimaryKey
-
Methods inherited from interface org.apache.fulcrum.security.entity.SecurityEntity
getId, getName, setId, setName
-
-
-
-
Constructor Detail
-
TorqueAbstractDynamicRole
public TorqueAbstractDynamicRole()
-
-
Method Detail
-
getTorqueDynamicRolePermissionsJoinTorqueDynamicPermission
protected List<TorqueDynamicRolePermission> getTorqueDynamicRolePermissionsJoinTorqueDynamicPermission(org.apache.torque.criteria.Criteria criteria, Connection con) throws org.apache.torque.TorqueException
Forward reference to generated code Get a list of association objects, pre-populated with their TorqueDynamicPermission objects.- Parameters:
criteria
- Criteria to define the selection of recordscon
- a database connection- Returns:
- a list of Role/Permission relations
- Throws:
org.apache.torque.TorqueException
- if any database error occurs
-
getTorqueDynamicGroupRolesJoinTorqueDynamicGroup
protected List<TorqueDynamicGroupRole> getTorqueDynamicGroupRolesJoinTorqueDynamicGroup(org.apache.torque.criteria.Criteria criteria, Connection con) throws org.apache.torque.TorqueException
Forward reference to generated code Get a list of association objects, pre-populated with their TorqueDynamicGroup objects.- Parameters:
criteria
- Criteria to define the selection of recordscon
- a database connection- Returns:
- a list of Group/Role relations
- Throws:
org.apache.torque.TorqueException
- if any database error occurs
-
addGroup
public void addGroup(Group group)
Description copied from interface:DynamicRole
This method should only be used by a RoleManager. Not directly.- Specified by:
addGroup
in interfaceDynamicRole
- Parameters:
group
- the Group to add- See Also:
DynamicRole.addGroup(org.apache.fulcrum.security.entity.Group)
-
addPermission
public void addPermission(Permission permission)
Description copied from interface:DynamicRole
This method should only be used by a RoleManager. Not directly.- Specified by:
addPermission
in interfaceDynamicRole
- Parameters:
permission
- the Permission to add- See Also:
DynamicRole.addPermission(org.apache.fulcrum.security.entity.Permission)
-
getGroups
public GroupSet getGroups()
Description copied from interface:DynamicRole
Get the groups this role belongs to- Specified by:
getGroups
in interfaceDynamicRole
- Returns:
- a set of groups
- See Also:
DynamicRole.getGroups()
-
getGroupsAsSet
public <T extends Group> Set<T> getGroupsAsSet()
Description copied from interface:DynamicRole
Get the groups this role belongs to as a Set- Specified by:
getGroupsAsSet
in interfaceDynamicRole
- Returns:
- a set of groups
- See Also:
DynamicRole.getGroupsAsSet()
-
getPermissions
public PermissionSet getPermissions()
Description copied from interface:DynamicRole
Get the permission that are part of this role- Specified by:
getPermissions
in interfaceDynamicRole
- Returns:
- a set of permissions
- See Also:
DynamicRole.getPermissions()
-
getPermissionsAsSet
public <T extends Permission> Set<T> getPermissionsAsSet()
Description copied from interface:DynamicRole
Get the permission that are part of this role as Set- Specified by:
getPermissionsAsSet
in interfaceDynamicRole
- Returns:
- a set of permissions
- See Also:
DynamicRole.getPermissionsAsSet()
-
removeGroup
public void removeGroup(Group group)
Description copied from interface:DynamicRole
This method should only be used by a RoleManager. Not directly.- Specified by:
removeGroup
in interfaceDynamicRole
- Parameters:
group
- the Group to remove- See Also:
DynamicRole.removeGroup(org.apache.fulcrum.security.entity.Group)
-
removePermission
public void removePermission(Permission permission)
Description copied from interface:DynamicRole
This method should only be used by a RoleManager. Not directly.- Specified by:
removePermission
in interfaceDynamicRole
- Parameters:
permission
- the Permission to remove- See Also:
DynamicRole.removePermission(org.apache.fulcrum.security.entity.Permission)
-
setGroups
public void setGroups(GroupSet groups)
Description copied from interface:DynamicRole
Set the groups this role belongs to- Specified by:
setGroups
in interfaceDynamicRole
- Parameters:
groups
- the set of groups- See Also:
DynamicRole.setGroups(org.apache.fulcrum.security.util.GroupSet)
-
setGroupsAsSet
public <T extends Group> void setGroupsAsSet(Set<T> groups)
Description copied from interface:DynamicRole
Set the groups this role belongs to as a Set- Specified by:
setGroupsAsSet
in interfaceDynamicRole
- Parameters:
groups
- the set of groups- See Also:
DynamicRole.setGroupsAsSet(java.util.Set)
-
setPermissions
public void setPermissions(PermissionSet permissionSet)
Description copied from interface:DynamicRole
Set the permission that are part of this role- Specified by:
setPermissions
in interfaceDynamicRole
- Parameters:
permissionSet
- a set of permissions- See Also:
DynamicRole.setPermissions(org.apache.fulcrum.security.util.PermissionSet)
-
setPermissionsAsSet
public <T extends Permission> void setPermissionsAsSet(Set<T> permissions)
Description copied from interface:DynamicRole
Set the permission that are part of this role as Set- Specified by:
setPermissionsAsSet
in interfaceDynamicRole
- Parameters:
permissions
- a set of permissions- See Also:
DynamicRole.setPermissionsAsSet(java.util.Set)
-
getDatabaseName
public String getDatabaseName()
- Returns:
- the database name
-
retrieveAttachedObjects
public void retrieveAttachedObjects(Connection con) throws DataBackendException
Description copied from class:TorqueAbstractSecurityEntity
old contract, lazy is set tofalse
.- Specified by:
retrieveAttachedObjects
in classTorqueAbstractSecurityEntity
- Parameters:
con
- A database connection- Throws:
DataBackendException
- wrapper exception: user information not found exception
-
retrieveAttachedObjects
public void retrieveAttachedObjects(Connection con, Boolean lazy) throws DataBackendException
Description copied from class:TorqueAbstractSecurityEntity
Retrieve attached objects such as users, permissions, ...- Specified by:
retrieveAttachedObjects
in classTorqueAbstractSecurityEntity
- Parameters:
con
- A database connectionlazy
- iftrue
, may load some or all relationships later- Throws:
DataBackendException
- See Also:
TorqueAbstractSecurityEntity.retrieveAttachedObjects(Connection, Boolean)
-
update
public void update(Connection con) throws org.apache.torque.TorqueException
Description copied from class:TorqueAbstractSecurityEntity
Update this instance to the database with all dependent objects- Specified by:
update
in classTorqueAbstractSecurityEntity
- Parameters:
con
- A database connection- Throws:
org.apache.torque.TorqueException
- database not found exception- See Also:
TorqueAbstractSecurityEntity.update(java.sql.Connection)
-
delete
public void delete() throws org.apache.torque.TorqueException
Description copied from class:TorqueAbstractSecurityEntity
Delete this entity- Specified by:
delete
in classTorqueAbstractSecurityEntity
- Throws:
org.apache.torque.TorqueException
- if any database error occurs if any database operation fails- See Also:
TorqueAbstractSecurityEntity.delete()
-
-