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

java.lang.Object
  extended by org.kuali.rice.kim.impl.role.RoleInternalServiceImpl
All Implemented Interfaces:
RoleInternalService

public class RoleInternalServiceImpl
extends Object
implements RoleInternalService


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.
 
Field Summary
protected  DataObjectService dataObjectService
           
protected  DateTimeService dateTimeService
           
protected  GroupService groupService
           
protected  IdentityService identityService
           
protected  KimTypeInfoService kimTypeInfoService
           
protected  NamespaceService namespaceService
           
protected  ResponsibilityInternalService responsibilityInternalService
           
protected  RoleDao roleDao
           
 
Constructor Summary
RoleInternalServiceImpl()
           
 
Method Summary
protected  Map<String,String> convertQualifierKeys(Map<String,String> qualification, Map<String,String> validAttributeIds)
          Converts the Qualifier Name/Value Role qualification set into Qualifier AttributeID/Value set
protected  RoleMember doAnyMemberRecordsMatch(List<RoleMemberBo> roleMembers, String memberId, String memberTypeCode, Map<String,String> qualifier)
           
protected  List<RoleMember> doAnyMemberRecordsMatchByExactQualifier(RoleEbo role, String memberId, RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
           
protected  boolean doesMemberMatch(RoleMemberBo roleMember, String memberId, String memberTypeCode, Map<String,String> qualifier)
           
protected  String getAppIdFromNamespace(String namespaceCode)
           
protected  Collection<KimAttributeBo> getAttributeByName(String attributeName)
           
protected  String getAttributeFromAppId(Collection<KimAttributeBo> attributes, String appId)
           
protected  String getAttributeFromKimType(KimType kimType, String attributeName)
           
protected  String getAttributeFromNamespace(KimType kimType, String attributeName, Collection<KimAttributeBo> attributes)
           
protected  String getCorrectAttributeId(String kimTypeId, String attributeName, Collection<KimAttributeBo> attributeData)
           
 DataObjectService getDataObjectService()
           
 DateTimeService getDateTimeService()
           
protected  DelegateMemberBo getDelegateMemberBo(String delegationMemberId)
          Retrieves a DelegateMemberBo object by its ID.
protected  List<DelegateMemberBo> getDelegationMemberBoListByMemberAndDelegationId(String memberId, String delegationId)
          Retrieves a DelegateMemberBo List by (principal/group/role) member ID and delegation ID.
protected  DelegateTypeBo getDelegationOfType(String roleId, DelegationType delegationType)
           
protected  GroupService getGroupService()
           
protected  IdentityService getIdentityService()
           
protected  String getKimAttributeId(String kimTypeId, String attributeName)
           
protected  KimTypeInfoService getKimTypeInfoService()
           
protected  Object getMember(String memberTypeCode, String memberId)
           
protected  String getMemberName(Object member)
           
protected  NamespaceService getNamespaceService()
           
protected  void getNestedRoleTypeMemberIds(String roleId, Set<String> members)
           
protected  DelegateTypeBo getPrimaryDelegation(String roleId, List<DelegateTypeBo> roleDelegates)
           
protected  ResponsibilityInternalService getResponsibilityInternalService()
           
protected  RoleBo getRoleBo(String roleId)
           
protected  RoleBo getRoleBoByName(String namespaceCode, String roleName)
           
protected  RoleBoLite getRoleBoLite(String roleId)
           
protected  RoleBoLite getRoleBoLiteByName(String namespaceCode, String roleName)
           
protected  RoleDao getRoleDao()
           
 List<RoleMemberBo> getRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds, Collection<String> groupIds, Map<String,String> qualification)
           
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.
protected  List<RoleMemberBo> getRoleMembersByExactQualifierMatch(RoleEbo role, String memberId, RoleServiceBase.RoleDaoAction daoActionToTake, Map<String,String> qualifier)
           
protected  List<RoleMemberBo> getRoleMembersForGroupIds(String roleId, List<String> groupIds)
           
protected  List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds, String principalId)
           
protected  List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds, String principalId, Map<String,String> qualification)
           
protected  List<RoleMemberBo> getRoleMembersForRoleIdsWithFilters(Collection<String> roleIds, String principalId, Collection<String> groupIds, Map<String,String> qualification)
           
protected  List<RoleMemberBo> getRoleMembershipsForMemberId(String memberType, String memberId, Map<String,String> qualification)
           
protected  List<RoleMemberBo> getRoleMembershipsForPredicates(Collection<Predicate> criteria)
           
protected  List<RoleMemberBo> getRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds, Map<String,String> qualification)
           
protected  Predicate getRoleQualificationPredicate(Map<String,String> qualification)
          Attempts to add predicates to the query to filter based on subqueries against the role member attribute data table.
protected  RoleResponsibilityActionBo getRoleResponsibilityActionBo(String roleResponsibilityActionId)
          Retrieves a RoleResponsibilityActionBo object by its ID.
protected  RoleTypeService getRoleTypeService(KimType typeInfo)
           
protected  RoleTypeService getRoleTypeService(String roleId)
          Retrieves the role type service associated with the given role ID
protected  RoleTypeService getRoleTypeServiceByName(String serviceName)
          Retrieves the role type service for the given service name.
protected  Map<String,DelegateTypeBo> getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds)
           
protected  List<DelegateTypeBo> getStoredDelegationImplsForRoleIds(Collection<String> roleIds)
           
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.
 void groupInactivated(String groupId)
          Notifies the role service that the group with the given id has been inactivated.
protected  void inactivateApplicationRoleMemberships(String principalId, Timestamp yesterday)
           
protected  void inactivateGroupRoleMemberships(List<String> groupIds, Timestamp yesterday)
           
protected  void inactivatePrincipalDelegations(String principalId, Timestamp yesterday)
           
protected  void inactivatePrincipalGroupMemberships(List<String> groupIds, Timestamp yesterday)
           
protected  void inactivatePrincipalGroupMemberships(String principalId, Timestamp yesterday)
           
protected  void inactivatePrincipalRoleMemberships(String principalId, Timestamp yesterday)
           
protected  boolean isDelegationPrimary(DelegationType delegationType)
           
protected  boolean isDelegationSecondary(DelegationType delegationType)
           
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 principalInactivated(String principalId)
          Notifies all of a principal's roles and role types that the principal has been inactivated.
 void roleInactivated(String roleId)
          Notifies the role service that the role with the given id has been inactivated.
 void setDataObjectService(DataObjectService dataObjectService)
           
 void setDateTimeService(DateTimeService dateTimeService)
           
 void setRoleDao(RoleDao roleDao)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataObjectService

protected DataObjectService dataObjectService

identityService

protected IdentityService identityService

namespaceService

protected NamespaceService namespaceService

kimTypeInfoService

protected KimTypeInfoService kimTypeInfoService

groupService

protected GroupService groupService

responsibilityInternalService

protected ResponsibilityInternalService responsibilityInternalService

roleDao

protected RoleDao roleDao

dateTimeService

protected DateTimeService dateTimeService
Constructor Detail

RoleInternalServiceImpl

public RoleInternalServiceImpl()
Method Detail

principalInactivated

public void principalInactivated(String principalId)
Description copied from interface: RoleInternalService
Notifies all of a principal's roles and role types that the principal has been inactivated.

Specified by:
principalInactivated in interface RoleInternalService

roleInactivated

public void roleInactivated(String roleId)
Description copied from interface: RoleInternalService
Notifies the role service that the role with the given id has been inactivated.

Specified by:
roleInactivated in interface RoleInternalService

groupInactivated

public void groupInactivated(String groupId)
Description copied from interface: RoleInternalService
Notifies the role service that the group with the given id has been inactivated.

Specified by:
groupInactivated in interface RoleInternalService

inactivateApplicationRoleMemberships

protected void inactivateApplicationRoleMemberships(String principalId,
                                                    Timestamp yesterday)

inactivatePrincipalRoleMemberships

protected void inactivatePrincipalRoleMemberships(String principalId,
                                                  Timestamp yesterday)

inactivateGroupRoleMemberships

protected void inactivateGroupRoleMemberships(List<String> groupIds,
                                              Timestamp yesterday)

inactivatePrincipalGroupMemberships

protected void inactivatePrincipalGroupMemberships(String principalId,
                                                   Timestamp yesterday)

inactivatePrincipalGroupMemberships

protected void inactivatePrincipalGroupMemberships(List<String> groupIds,
                                                   Timestamp yesterday)

inactivatePrincipalDelegations

protected void inactivatePrincipalDelegations(String principalId,
                                              Timestamp yesterday)

convertQualifierKeys

protected Map<String,String> convertQualifierKeys(Map<String,String> qualification,
                                                  Map<String,String> validAttributeIds)
Converts the Qualifier Name/Value Role qualification set into Qualifier AttributeID/Value set

Parameters:
qualification - The original role qualification attribute set
validAttributeIds - The mapping of attribute names to their matching attribute ids
Returns:
Converted Map containing ID/value pairs

getNestedRoleTypeMemberIds

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

getRoleMembersForPrincipalId

protected List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds,
                                                          String principalId)

getRoleMembersForPrincipalId

protected List<RoleMemberBo> getRoleMembersForPrincipalId(Collection<String> roleIds,
                                                          String principalId,
                                                          Map<String,String> qualification)

getRoleMembersForGroupIds

protected List<RoleMemberBo> getRoleMembersForGroupIds(String roleId,
                                                       List<String> groupIds)

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.

getRoleGroupsForGroupIdsAndRoleIds

public List<RoleMemberBo> getRoleGroupsForGroupIdsAndRoleIds(Collection<String> roleIds,
                                                             Collection<String> groupIds,
                                                             Map<String,String> qualification)

getRoleMembershipsForRoleIdsAsMembers

protected List<RoleMemberBo> getRoleMembershipsForRoleIdsAsMembers(Collection<String> roleIds,
                                                                   Map<String,String> qualification)

getRoleMembersForRoleIdsWithFilters

protected List<RoleMemberBo> getRoleMembersForRoleIdsWithFilters(Collection<String> roleIds,
                                                                 String principalId,
                                                                 Collection<String> groupIds,
                                                                 Map<String,String> qualification)

getRoleMembershipsForPredicates

protected List<RoleMemberBo> getRoleMembershipsForPredicates(Collection<Predicate> criteria)

getRoleQualificationPredicate

protected Predicate getRoleQualificationPredicate(Map<String,String> qualification)
Attempts to add predicates to the query to filter based on subqueries against the role member attribute data table. This is used for exact matches only! An "EXISTS" subquery will be created for each non-blank attribute value passed to this method and they will be anded together and returned to the calling code.

Parameters:
qualification - An "and" predicate containing the exists predicates if at least one qualification has a non-blank value. null if all values are blank or the passed in qualification is null or empty.

getRoleMembershipsForMemberId

protected List<RoleMemberBo> getRoleMembershipsForMemberId(String memberType,
                                                           String memberId,
                                                           Map<String,String> qualification)

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.


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.


getRoleResponsibilityActionBo

protected RoleResponsibilityActionBo getRoleResponsibilityActionBo(String roleResponsibilityActionId)
Retrieves a RoleResponsibilityActionBo object by its ID.


getStoredDelegationImplMapFromRoleIds

protected Map<String,DelegateTypeBo> getStoredDelegationImplMapFromRoleIds(Collection<String> roleIds)

getStoredDelegationImplsForRoleIds

protected List<DelegateTypeBo> getStoredDelegationImplsForRoleIds(Collection<String> roleIds)

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.


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.


getMember

protected Object getMember(String memberTypeCode,
                           String memberId)

getMemberName

protected String getMemberName(Object member)

getRoleBo

protected RoleBo getRoleBo(String roleId)

getRoleBoLite

protected RoleBoLite getRoleBoLite(String roleId)

getDelegationOfType

protected DelegateTypeBo getDelegationOfType(String roleId,
                                             DelegationType delegationType)

getPrimaryDelegation

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

matchingMemberRecord

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

isDelegationPrimary

protected boolean isDelegationPrimary(DelegationType delegationType)

isDelegationSecondary

protected boolean isDelegationSecondary(DelegationType delegationType)

getRoleBoByName

protected RoleBo getRoleBoByName(String namespaceCode,
                                 String roleName)

getRoleBoLiteByName

protected RoleBoLite getRoleBoLiteByName(String namespaceCode,
                                         String roleName)

doAnyMemberRecordsMatchByExactQualifier

protected List<RoleMember> doAnyMemberRecordsMatchByExactQualifier(RoleEbo role,
                                                                   String memberId,
                                                                   RoleServiceBase.RoleDaoAction daoActionToTake,
                                                                   Map<String,String> qualifier)

getRoleMembersByExactQualifierMatch

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

doAnyMemberRecordsMatch

protected RoleMember 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

getRoleTypeServiceByName

protected RoleTypeService getRoleTypeServiceByName(String serviceName)
Retrieves the role type service for the given service name.

Parameters:
serviceName - the name of the service to retrieve
Returns:
the Role Type Service

getRoleTypeService

protected RoleTypeService getRoleTypeService(KimType typeInfo)

populateQualifiersForExactMatch

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

getKimAttributeId

protected String getKimAttributeId(String kimTypeId,
                                   String attributeName)

getAttributeByName

protected Collection<KimAttributeBo> getAttributeByName(String attributeName)

getCorrectAttributeId

protected String getCorrectAttributeId(String kimTypeId,
                                       String attributeName,
                                       Collection<KimAttributeBo> attributeData)

getAttributeFromKimType

protected String getAttributeFromKimType(KimType kimType,
                                         String attributeName)

getAttributeFromNamespace

protected String getAttributeFromNamespace(KimType kimType,
                                           String attributeName,
                                           Collection<KimAttributeBo> attributes)

getAppIdFromNamespace

protected String getAppIdFromNamespace(String namespaceCode)

getAttributeFromAppId

protected String getAttributeFromAppId(Collection<KimAttributeBo> attributes,
                                       String appId)

getKimTypeInfoService

protected KimTypeInfoService getKimTypeInfoService()

getNamespaceService

protected NamespaceService getNamespaceService()

getIdentityService

protected IdentityService getIdentityService()

getGroupService

protected GroupService getGroupService()

getResponsibilityInternalService

protected ResponsibilityInternalService getResponsibilityInternalService()

getRoleDao

protected RoleDao getRoleDao()

setRoleDao

public void setRoleDao(RoleDao roleDao)

getDataObjectService

public DataObjectService getDataObjectService()

setDataObjectService

public void setDataObjectService(DataObjectService dataObjectService)

getDateTimeService

public DateTimeService getDateTimeService()

setDateTimeService

public void setDateTimeService(DateTimeService dateTimeService)


Copyright © 2005–2014 The Kuali Foundation. All rights reserved.