org.kuali.rice.kim.impl.role
Class RoleServiceBase

java.lang.Object
  extended by org.kuali.rice.kim.impl.role.RoleServiceBase
Direct Known Subclasses:
RoleServiceImpl

public class RoleServiceBase
extends Object


Nested Class Summary
protected static class RoleServiceBase.RoleDaoAction
          A helper enumeration for indicating which KimRoleDao method to use when attempting to get role/delegation-related lists that are not in the cache.
 
Constructor Summary
RoleServiceBase()
           
 
Method Summary
protected  boolean checkForCircularRoleMembership(String newMemberId, RoleBo roleBo)
          This method tests to see if assigning a roleBo to another roleBo will create a circular reference.
protected  boolean doAnyMemberRecordsMatch(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
           
protected  boolean doAnyMemberRecordsMatchByExactQualifier(RoleBo role, String memberId, RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
           
protected  boolean doesMemberMatch(RoleMemberBo roleMember, String memberId, String memberTypeCode, Map<String,String> qualifier)
           
 List<DelegateMember> findDelegateMembers(Map<String,String> fieldValues)
           
 RoleMember findRoleMember(String roleMemberId)
           
 List<RoleMember> findRoleMembers(Map<String,String> fieldValues)
           
protected  BusinessObjectService getBusinessObjectService()
           
protected  DelegateMemberBo getDelegateMemberBo(String delegationMemberId)
          Retrieves a DelegateMemberBo object by its ID.
protected  List<DelegateMemberBo> getDelegationMemberBoList(RoleServiceBase.RoleDaoAction daoActionToTake, Collection<String> delegationIds, String principalId, List<String> groupIds)
          Retrieves a List of delegation members from the KimRoleDao as appropriate.
protected  List<DelegateMemberBo> getDelegationMemberBoListByMemberAndDelegationId(String memberId, String delegationId)
          Retrieves a DelegateMemberBo List by (principal/group/role) member ID and delegation ID.
protected  DelegateBo getDelegationOfType(String roleId, String delegationTypeCode)
           
protected  GroupService getGroupService()
           
protected  IdentityService getIdentityService()
           
protected  String getKimAttributeId(String attributeName)
           
protected  LookupService getLookupService()
           
protected  Object getMember(String memberTypeCode, String memberId)
           
protected  String getMemberName(Object member)
           
 List<String> getMemberParentRoleIds(String memberType, String memberId)
           
protected  void getNestedRoleTypeMemberIds(String roleId, Set<String> members)
           
protected  String getNewAttributeDataId()
           
protected  String getNewDelegationId()
           
protected  String getNewDelegationMemberId()
           
protected  DelegateBo getPrimaryDelegation(String roleId, List<DelegateBo> roleDelegates)
           
protected  ResponsibilityInternalService getResponsibilityInternalService()
           
protected  RoleBo getRoleBo(String roleId)
           
protected  RoleBo getRoleBoByName(String namespaceCode, String roleName)
           
 RoleDao getRoleDao()
           
protected  RoleMemberBo getRoleMemberBo(String roleMemberId)
          Retrieves a RoleMemberBo object by its ID.
protected  List<RoleMemberBo> getRoleMemberBoList(RoleServiceBase.RoleDaoAction daoActionToTake, Collection<String> roleIds, String principalId, Collection<String> groupIds, String memberTypeCode, Map<String,String> qualification)
          Retrieves a list of RoleMemberBo instances from the KimRoleDao.
 List<RoleResponsibilityAction> getRoleMemberResponsibilityActions(String roleMemberId)
           
protected  List<RoleMemberBo> getRoleMembersByExactQualifierMatch(RoleBo role, String memberId, RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
           
 Set<String> getRoleTypeRoleMemberIds(String roleId)
           
protected  RoleTypeService getRoleTypeService(KimType typeInfo)
           
protected  RoleTypeService getRoleTypeService(String roleId)
          Retrieves the role type service associated with the given role ID
protected  SequenceAccessorService getSequenceAccessorService()
           
protected  List<DelegateMemberBo> getStoredDelegationGroupsForGroupIdsAndDelegationIds(Collection<String> delegationIds, List<String> groupIds)
          Calls the KimRoleDao's "getDelegationGroupsForGroupIdAndDelegationIds" method and/or retrieves any corresponding members from the cache.
protected  Map<String,DelegateBo> getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds)
          Calls the KimRoleDao's "getDelegationImplMapFromRoleIds" method and/or retrieves any corresponding delegations from the cache.
protected  List<DelegateBo> getStoredDelegationImplsForRoleIds(Collection<String> roleIds)
          Calls the KimRoleDao's "getDelegationBosForRoleIds" method and/or retrieves any corresponding delegations from the cache.
protected  Map<String,List<DelegateMemberBo>> getStoredDelegationMembersForDelegationIds(List<String> delegationIds)
          Calls the KimRoleDao's "getDelegationMembersForDelegationIds" method and/or retrieves any corresponding members from the cache.
protected  List<DelegateMemberBo> getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds(Collection<String> delegationIds, String principalId)
          Calls the KimRoleDao's "getDelegationPrincipalsForPrincipalIdAndDelegationIds" method and/or retrieves any corresponding members from the cache.
protected  List<RoleMemberBo> getStoredRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds, Collection<String> groupIds, Map<String,String> qualification)
          Calls the KimRoleDao's "getRoleGroupsForGroupIdsAndRoleIds" method and/or retrieves any corresponding members from the cache.
protected  List<RoleMemberBo> getStoredRoleMembersForRoleIds(Collection<String> roleIds, String memberTypeCode, Map<String,String> qualification)
          Calls the KimRoleDao's "getRoleMembersForRoleIds" method and/or retrieves any corresponding members from the cache.
protected  List<RoleMemberBo> getStoredRoleMembersForRoleIdsWithFilters(Collection<String> roleIds, String principalId, List<String> groupIds, Map<String,String> qualification)
          Calls the KimRoleDao's "getRoleMembersForRoleIdsWithFilters" method and/or retrieves any corresponding members from the cache.
protected  List<RoleMemberBo> getStoredRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds, Map<String,String> qualification)
          Calls the KimRoleDao's "getRoleMembershipsForRoleIdsAsMembers" method and/or retrieves any corresponding members from the cache.
protected  List<RoleMemberBo> getStoredRolePrincipalsForPrincipalIdAndRoleIds(Collection<String> roleIds, String principalId, Map<String,String> qualification)
          Calls the KimRoleDao's "getRolePrincipalsForPrincipalIdAndRoleIds" method and/or retrieves any corresponding members from the cache.
protected  boolean isDelegationPrimary(String delegationTypeCode)
           
protected  boolean isDelegationSecondary(String delegationTypeCode)
           
protected  RoleMemberBo matchingMemberRecord(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
           
protected  Map<String,String> populateQualifiersForExactMatch(Map<String,String> defaultQualification, List<String> attributes)
           
 void setRoleDao(RoleDao roleDao)
           
protected  boolean shouldCacheMembersOfRole(String roleId)
          Determines whether or not the given role should allow its members to be cached.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RoleServiceBase

public RoleServiceBase()
Method Detail

getRoleTypeRoleMemberIds

public Set<String> getRoleTypeRoleMemberIds(String roleId)

getNestedRoleTypeMemberIds

protected void getNestedRoleTypeMemberIds(String roleId,
                                          Set<String> members)

getMemberParentRoleIds

public List<String> getMemberParentRoleIds(String memberType,
                                           String memberId)

getRoleMemberBoList

protected List<RoleMemberBo> getRoleMemberBoList(RoleServiceBase.RoleDaoAction daoActionToTake,
                                                 Collection<String> roleIds,
                                                 String principalId,
                                                 Collection<String> groupIds,
                                                 String memberTypeCode,
                                                 Map<String,String> qualification)
Retrieves a list of RoleMemberBo instances from the KimRoleDao.

Parameters:
daoActionToTake - An indicator for which KimRoleDao method should be used to get the results if the desired RoleMemberBos are not cached.
roleIds - The role IDs to filter by; may get used as the IDs for members that are also roles, depending on the daoActionToTake value.
principalId - The principal ID to filter by; may get ignored depending on the daoActionToTake value.
groupIds - The group IDs to filter by; may get ignored depending on the daoActionToTake value.
memberTypeCode - The member type code to filter by; may get overridden depending on the daoActionToTake value.
qualification - The original role qualification attribute set
Returns:
A list of RoleMemberBo instances based on the provided parameters.
Throws:
IllegalArgumentException - if daoActionToTake refers to an enumeration constant that is not role-member-related.

getStoredRolePrincipalsForPrincipalIdAndRoleIds

protected List<RoleMemberBo> getStoredRolePrincipalsForPrincipalIdAndRoleIds(Collection<String> roleIds,
                                                                             String principalId,
                                                                             Map<String,String> qualification)
Calls the KimRoleDao's "getRolePrincipalsForPrincipalIdAndRoleIds" method and/or retrieves any corresponding members from the cache.


getStoredRoleGroupsForGroupIdsAndRoleIds

protected List<RoleMemberBo> getStoredRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds,
                                                                      Collection<String> groupIds,
                                                                      Map<String,String> qualification)
Calls the KimRoleDao's "getRoleGroupsForGroupIdsAndRoleIds" method and/or retrieves any corresponding members from the cache.


getStoredRoleMembersForRoleIds

protected List<RoleMemberBo> getStoredRoleMembersForRoleIds(Collection<String> roleIds,
                                                            String memberTypeCode,
                                                            Map<String,String> qualification)
Calls the KimRoleDao's "getRoleMembersForRoleIds" method and/or retrieves any corresponding members from the cache.


getStoredRoleMembershipsForRoleIdsAsMembers

protected List<RoleMemberBo> getStoredRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds,
                                                                         Map<String,String> qualification)
Calls the KimRoleDao's "getRoleMembershipsForRoleIdsAsMembers" method and/or retrieves any corresponding members from the cache.


getStoredRoleMembersForRoleIdsWithFilters

protected List<RoleMemberBo> getStoredRoleMembersForRoleIdsWithFilters(Collection<String> roleIds,
                                                                       String principalId,
                                                                       List<String> groupIds,
                                                                       Map<String,String> qualification)
Calls the KimRoleDao's "getRoleMembersForRoleIdsWithFilters" method and/or retrieves any corresponding members from the cache.


shouldCacheMembersOfRole

protected boolean shouldCacheMembersOfRole(String roleId)
Determines whether or not the given role should allow its members to be cached. The default implementation always returns true, but subclasses can override this method if other non-default Role implementations forbid their members from being cached.

Parameters:
roleId - The ID of the role to check for determining whether or not to allow caching of its members.
Returns:
True if the given role allows its members to be cached; false otherwise.

getRoleMemberBo

protected RoleMemberBo getRoleMemberBo(String roleMemberId)
Retrieves a RoleMemberBo object by its ID. If the role member already exists in the cache, this method will return the cached version; otherwise, it will retrieve the uncached version from the database and then cache it (if it belongs to a role that allows its members to be cached) before returning it.


getStoredDelegationImplMapFromRoleIds

protected Map<String,DelegateBo> getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds)
Calls the KimRoleDao's "getDelegationImplMapFromRoleIds" method and/or retrieves any corresponding delegations from the cache.


getStoredDelegationImplsForRoleIds

protected List<DelegateBo> getStoredDelegationImplsForRoleIds(Collection<String> roleIds)
Calls the KimRoleDao's "getDelegationBosForRoleIds" method and/or retrieves any corresponding delegations from the cache.


getDelegationMemberBoList

protected List<DelegateMemberBo> getDelegationMemberBoList(RoleServiceBase.RoleDaoAction daoActionToTake,
                                                           Collection<String> delegationIds,
                                                           String principalId,
                                                           List<String> groupIds)
Retrieves a List of delegation members from the KimRoleDao as appropriate.

Parameters:
daoActionToTake - An indicator for which KimRoleDao method to use for retrieving results.
delegationIds - The IDs of the delegations that the members belong to.
principalId - The principal ID of the principal delegation members; may get ignored depending on the RoleDaoAction value.
groupIds - The group IDs of the group delegation members; may get ignored depending on the RoleDaoAction value.
Returns:
A List of DelegateMemberBo objects based on the provided parameters.
Throws:
IllegalArgumentException - if daoActionToTake does not represent a delegation-member-list-related enumeration value.

getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds

protected List<DelegateMemberBo> getStoredDelegationPrincipalsForPrincipalIdAndDelegationIds(Collection<String> delegationIds,
                                                                                             String principalId)
Calls the KimRoleDao's "getDelegationPrincipalsForPrincipalIdAndDelegationIds" method and/or retrieves any corresponding members from the cache.


getStoredDelegationGroupsForGroupIdsAndDelegationIds

protected List<DelegateMemberBo> getStoredDelegationGroupsForGroupIdsAndDelegationIds(Collection<String> delegationIds,
                                                                                      List<String> groupIds)
Calls the KimRoleDao's "getDelegationGroupsForGroupIdAndDelegationIds" method and/or retrieves any corresponding members from the cache.


getStoredDelegationMembersForDelegationIds

protected Map<String,List<DelegateMemberBo>> getStoredDelegationMembersForDelegationIds(List<String> delegationIds)
Calls the KimRoleDao's "getDelegationMembersForDelegationIds" method and/or retrieves any corresponding members from the cache.


getDelegateMemberBo

protected DelegateMemberBo getDelegateMemberBo(String delegationMemberId)
Retrieves a DelegateMemberBo object by its ID. If the delegation member already exists in the cache, this method will return the cached version; otherwise, it will retrieve the uncached version from the database and then cache it before returning it.


getDelegationMemberBoListByMemberAndDelegationId

protected List<DelegateMemberBo> getDelegationMemberBoListByMemberAndDelegationId(String memberId,
                                                                                  String delegationId)
Retrieves a DelegateMemberBo List by (principal/group/role) member ID and delegation ID. If the List already exists in the cache, this method will return the cached one; otherwise, it will retrieve the uncached version from the database and then cache it before returning it.


findRoleMember

public RoleMember findRoleMember(String roleMemberId)

findRoleMembers

public List<RoleMember> findRoleMembers(Map<String,String> fieldValues)

getRoleMemberResponsibilityActions

public List<RoleResponsibilityAction> getRoleMemberResponsibilityActions(String roleMemberId)

findDelegateMembers

public List<DelegateMember> findDelegateMembers(Map<String,String> fieldValues)

getMember

protected Object getMember(String memberTypeCode,
                           String memberId)

getMemberName

protected String getMemberName(Object member)

getRoleBo

protected RoleBo getRoleBo(String roleId)

getDelegationOfType

protected DelegateBo getDelegationOfType(String roleId,
                                         String delegationTypeCode)

getPrimaryDelegation

protected DelegateBo getPrimaryDelegation(String roleId,
                                          List<DelegateBo> roleDelegates)

matchingMemberRecord

protected RoleMemberBo matchingMemberRecord(List<RoleMemberBo> roleMembers,
                                            String memberId,
                                            String memberTypeCode,
                                            Map<String,String> qualifier)

isDelegationPrimary

protected boolean isDelegationPrimary(String delegationTypeCode)

isDelegationSecondary

protected boolean isDelegationSecondary(String delegationTypeCode)

getRoleBoByName

protected RoleBo getRoleBoByName(String namespaceCode,
                                 String roleName)

doAnyMemberRecordsMatchByExactQualifier

protected boolean doAnyMemberRecordsMatchByExactQualifier(RoleBo role,
                                                          String memberId,
                                                          RoleServiceBase.RoleDaoAction daoActionToTake,
                                                          Map<String,String> qualifier)

getRoleMembersByExactQualifierMatch

protected List<RoleMemberBo> getRoleMembersByExactQualifierMatch(RoleBo role,
                                                                 String memberId,
                                                                 RoleServiceBase.RoleDaoAction daoActionToTake,
                                                                 Map<String,String> qualifier)

doAnyMemberRecordsMatch

protected boolean doAnyMemberRecordsMatch(List<RoleMemberBo> roleMembers,
                                          String memberId,
                                          String memberTypeCode,
                                          Map<String,String> qualifier)

doesMemberMatch

protected boolean doesMemberMatch(RoleMemberBo roleMember,
                                  String memberId,
                                  String memberTypeCode,
                                  Map<String,String> qualifier)

getRoleTypeService

protected RoleTypeService getRoleTypeService(String roleId)
Retrieves the role type service associated with the given role ID

Parameters:
roleId - the role ID to get the role type service for
Returns:
the Role Type Service

getRoleTypeService

protected RoleTypeService getRoleTypeService(KimType typeInfo)

populateQualifiersForExactMatch

protected Map<String,String> populateQualifiersForExactMatch(Map<String,String> defaultQualification,
                                                             List<String> attributes)

checkForCircularRoleMembership

protected boolean checkForCircularRoleMembership(String newMemberId,
                                                 RoleBo roleBo)
This method tests to see if assigning a roleBo to another roleBo will create a circular reference. The Role is checked to see if it is a member (direct or nested) of the roleBo to be assigned as a member.

Parameters:
newMemberId -
roleBo -
Returns:
true - assignment is allowed, no circular reference will be created. false - illegal assignment, it will create a circular membership

getKimAttributeId

protected String getKimAttributeId(String attributeName)

getNewDelegationId

protected String getNewDelegationId()

getNewAttributeDataId

protected String getNewAttributeDataId()

getNewDelegationMemberId

protected String getNewDelegationMemberId()

getBusinessObjectService

protected BusinessObjectService getBusinessObjectService()

getLookupService

protected LookupService getLookupService()
Returns:
the lookupService

getIdentityService

protected IdentityService getIdentityService()

getGroupService

protected GroupService getGroupService()

getSequenceAccessorService

protected SequenceAccessorService getSequenceAccessorService()

getResponsibilityInternalService

protected ResponsibilityInternalService getResponsibilityInternalService()

getRoleDao

public RoleDao getRoleDao()
Returns:
the roleDao

setRoleDao

public void setRoleDao(RoleDao roleDao)
Parameters:
roleDao - the roleDao to set


Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.