edu.internet2.middleware.grouper.internal.dao.hib3
Class Hib3RoleSetDAO

java.lang.Object
  extended by edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
      extended by edu.internet2.middleware.grouper.internal.dao.hib3.Hib3RoleSetDAO
All Implemented Interfaces:
GrouperDAO, RoleSetDAO

public class Hib3RoleSetDAO
extends Hib3DAO
implements RoleSetDAO

Data Access Object for role set

Version:
$Id: Hib3RoleSetDAO.java,v 1.6 2009-11-08 13:16:53 mchyzer Exp $
Author:
mchyzer

Field Summary
 
Fields inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
hibernateInitted
 
Constructor Summary
Hib3RoleSetDAO()
           
 
Method Summary
 void delete(RoleSet roleSet)
          delete a role set
 void deleteByIfHasRole(Role role)
          delete role sets by owner, so the role can be deleted
 RoleSet findById(String id, boolean exceptionIfNotFound)
           
 Set<RoleSet> findByIfHasRoleId(String id)
          find by set owner
 Set<RoleSet> findByIfHasRoleIdImmediate(String id)
           
 Set<RoleSet> findByIfThenHasRoleId(String roleSetForThens, String roleSetForIfs)
           this will help with deletes.
 RoleSet findByIfThenImmediate(String roleIdIf, String roleIdThen, boolean exceptionIfNotFound)
          find by if and then (not same) with depth of 1 (immediate)
 Set<RoleSet> findByThenHasRoleId(String id)
          find by member
 Set<RoleSet> findByThenHasRoleIdImmediate(String id)
           
 RoleSet findByUuidOrKey(String id, String ifHasRoleId, String thenHasRoleId, String parentRoleSetId, int depth, boolean exceptionIfNull)
          find a record by uuid or key
 RoleSet findSelfRoleSet(String groupId, boolean exceptionIfNotFound)
           
 Set<Role> rolesInheritPermissionsFromThis(String id)
          get all the THEN rows from rowSet about this id.
 Set<Role> rolesInheritPermissionsFromThisImmediate(String id)
          get all the THEN rows from rowSet about this id (immediate only).
 Set<Role> rolesInheritPermissionsToThis(String id)
          get all the IF rows from rowSet about this id.
 Set<Role> rolesInheritPermissionsToThisImmediate(String id)
          get all the IF rows from rowSet about this id (immediate only).
 void saveOrUpdate(RoleSet roleSet)
          insert or update an attribute def name set
 void saveUpdateProperties(RoleSet roleSet)
          save the update properties which are auto saved when business method is called
 
Methods inherited from class edu.internet2.middleware.grouper.internal.dao.hib3.Hib3DAO
evict, evictEntity, evictQueries, getConfiguration, getSessionFactory, initHibernateIfNotInitted, resourceNameFromClassName, session
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Hib3RoleSetDAO

public Hib3RoleSetDAO()
Method Detail

findById

public RoleSet findById(String id,
                        boolean exceptionIfNotFound)
                 throws AttributeDefNameSetNotFoundException
Specified by:
findById in interface RoleSetDAO
Returns:
the attribute def name set or null if not there
Throws:
AttributeDefNameSetNotFoundException
See Also:
RoleSetDAO.findById(java.lang.String, boolean)

saveOrUpdate

public void saveOrUpdate(RoleSet roleSet)
Description copied from interface: RoleSetDAO
insert or update an attribute def name set

Specified by:
saveOrUpdate in interface RoleSetDAO
See Also:
RoleSetDAO.saveOrUpdate(edu.internet2.middleware.grouper.permissions.role.RoleSet)

delete

public void delete(RoleSet roleSet)
Description copied from interface: RoleSetDAO
delete a role set

Specified by:
delete in interface RoleSetDAO
See Also:
RoleSetDAO.delete(edu.internet2.middleware.grouper.permissions.role.RoleSet)

findByIfHasRoleId

public Set<RoleSet> findByIfHasRoleId(String id)
Description copied from interface: RoleSetDAO
find by set owner

Specified by:
findByIfHasRoleId in interface RoleSetDAO
Returns:
the role set or null if not there
See Also:
RoleSetDAO.findByIfHasRoleId(java.lang.String)

findByIfHasRoleIdImmediate

public Set<RoleSet> findByIfHasRoleIdImmediate(String id)
Specified by:
findByIfHasRoleIdImmediate in interface RoleSetDAO
Returns:
set of rolesets
See Also:
RoleSetDAO.findByIfHasRoleIdImmediate(java.lang.String)

findByThenHasRoleIdImmediate

public Set<RoleSet> findByThenHasRoleIdImmediate(String id)
Specified by:
findByThenHasRoleIdImmediate in interface RoleSetDAO
Returns:
set of rolesets
See Also:
RoleSetDAO.findByThenHasRoleIdImmediate(java.lang.String)

findByIfThenHasRoleId

public Set<RoleSet> findByIfThenHasRoleId(String roleSetForThens,
                                          String roleSetForIfs)
Description copied from interface: RoleSetDAO
 this will help with deletes.  It will find sets who have if's which match thens provided, and thens which 
 match ifs provided.
 
 So if there is this path: A -> B -> C -> D
 And the inputs here are B and C (removing that path)
 Then return A -> C, A -> D, B -> C, B -> D
 
 

Specified by:
findByIfThenHasRoleId in interface RoleSetDAO
Returns:
the attribute def name set or null if not there
See Also:
RoleSetDAO.findByIfThenHasRoleId(java.lang.String, java.lang.String)

findByIfThenImmediate

public RoleSet findByIfThenImmediate(String roleIdIf,
                                     String roleIdThen,
                                     boolean exceptionIfNotFound)
Description copied from interface: RoleSetDAO
find by if and then (not same) with depth of 1 (immediate)

Specified by:
findByIfThenImmediate in interface RoleSetDAO
Returns:
the roleSet
See Also:
RoleSetDAO.findByIfThenImmediate(java.lang.String, java.lang.String, boolean)

findByThenHasRoleId

public Set<RoleSet> findByThenHasRoleId(String id)
Description copied from interface: RoleSetDAO
find by member

Specified by:
findByThenHasRoleId in interface RoleSetDAO
Returns:
the role set or null if not there
See Also:
RoleSetDAO.findByThenHasRoleId(java.lang.String)

rolesInheritPermissionsFromThis

public Set<Role> rolesInheritPermissionsFromThis(String id)
Description copied from interface: RoleSetDAO
get all the THEN rows from rowSet about this id. So if this is loanAdministrator, seniorLoanAdministator would be returned. Dont return the role for the id passed in

Specified by:
rolesInheritPermissionsFromThis in interface RoleSetDAO
Returns:
the role
See Also:
RoleSetDAO.rolesInheritPermissionsFromThis(java.lang.String)

deleteByIfHasRole

public void deleteByIfHasRole(Role role)
Description copied from interface: RoleSetDAO
delete role sets by owner, so the role can be deleted

Specified by:
deleteByIfHasRole in interface RoleSetDAO
See Also:
RoleSetDAO.deleteByIfHasRole(edu.internet2.middleware.grouper.permissions.role.Role)

rolesInheritPermissionsFromThisImmediate

public Set<Role> rolesInheritPermissionsFromThisImmediate(String id)
Description copied from interface: RoleSetDAO
get all the THEN rows from rowSet about this id (immediate only). So if this is loanAdministrator, seniorLoanAdministator would be returned. Dont return the role for the id passed in

Specified by:
rolesInheritPermissionsFromThisImmediate in interface RoleSetDAO
Returns:
the role
See Also:
RoleSetDAO.rolesInheritPermissionsFromThisImmediate(java.lang.String)

rolesInheritPermissionsToThis

public Set<Role> rolesInheritPermissionsToThis(String id)
Description copied from interface: RoleSetDAO
get all the IF rows from rowSet about this id. So if this is seniorLoanAdministator, loanAdministrator would be returned. Dont return the role for the id passed in

Specified by:
rolesInheritPermissionsToThis in interface RoleSetDAO
Returns:
the role
See Also:
RoleSetDAO.rolesInheritPermissionsToThis(java.lang.String)

rolesInheritPermissionsToThisImmediate

public Set<Role> rolesInheritPermissionsToThisImmediate(String id)
Description copied from interface: RoleSetDAO
get all the IF rows from rowSet about this id (immediate only). So if this is seniorLoanAdministator, loanAdministrator would be returned. Dont return the role for the id passed in

Specified by:
rolesInheritPermissionsToThisImmediate in interface RoleSetDAO
Returns:
the role
See Also:
RoleSetDAO.rolesInheritPermissionsToThisImmediate(java.lang.String)

findByUuidOrKey

public RoleSet findByUuidOrKey(String id,
                               String ifHasRoleId,
                               String thenHasRoleId,
                               String parentRoleSetId,
                               int depth,
                               boolean exceptionIfNull)
Description copied from interface: RoleSetDAO
find a record by uuid or key

Specified by:
findByUuidOrKey in interface RoleSetDAO
Returns:
the roleset or null
See Also:
RoleSetDAO.findByUuidOrKey(java.lang.String, java.lang.String, java.lang.String, java.lang.String, int, boolean)

saveUpdateProperties

public void saveUpdateProperties(RoleSet roleSet)
Description copied from interface: RoleSetDAO
save the update properties which are auto saved when business method is called

Specified by:
saveUpdateProperties in interface RoleSetDAO
See Also:
RoleSetDAO.saveUpdateProperties(edu.internet2.middleware.grouper.permissions.role.RoleSet)

findSelfRoleSet

public RoleSet findSelfRoleSet(String groupId,
                               boolean exceptionIfNotFound)
Specified by:
findSelfRoleSet in interface RoleSetDAO
Returns:
roleSet