|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.kuali.rice.kim.service.impl.RoleManagementServiceImpl
public class RoleManagementServiceImpl
Field Summary | |
---|---|
protected Map<String,MaxAgeSoftReference<Collection<String>>> |
memberPrincipalIdsCache
|
protected Map<String,MaxAgeSoftReference<Boolean>> |
principalHasRoleCache
|
protected Map<String,MaxAgeSoftReference<KimRoleInfo>> |
roleByIdCache
|
protected Map<String,MaxAgeSoftReference<KimRoleInfo>> |
roleByNameCache
|
protected int |
roleCacheMaxAgeSeconds
|
protected int |
roleCacheMaxSize
|
protected Map<String,MaxAgeSoftReference<List<RoleMembershipInfo>>> |
roleMembersWithDelegationCache
|
protected Map<String,MaxAgeSoftReference<List<AttributeSet>>> |
roleQualifiersForPrincipalCache
|
protected Map<String,Boolean> |
shouldCacheRoleCache
|
Constructor Summary | |
---|---|
RoleManagementServiceImpl()
|
Method Summary | |
---|---|
protected void |
addAttributesToKey(StringBuffer key,
AttributeSet attributes)
|
protected void |
addIdsToKey(StringBuffer key,
List<String> idList)
|
protected void |
addPrincipalHasRoleToCache(String key,
boolean hasRole)
|
protected void |
addRoleMemberPrincipalIdsToCache(String key,
Collection<String> principalIds)
|
protected void |
addRoleMembersWithDelegationToCache(String key,
List<RoleMembershipInfo> members)
|
protected void |
addRoleQualifiersForPrincipalToCache(String key,
List<AttributeSet> qualifiers)
|
protected void |
addRoleToCaches(KimRoleInfo role)
|
void |
afterPropertiesSet()
|
void |
applicationRoleMembershipChanged(String roleId)
|
void |
assignGroupToRole(String groupId,
String namespaceCode,
String roleName,
AttributeSet qualifications)
Assigns the group with the given id to the role with the specified namespace code and name with the supplied set of qualifications. |
void |
assignPermissionToRole(String permissionId,
String roleId)
Assigns the given permission to the given role |
void |
assignPrincipalToRole(String principalId,
String namespaceCode,
String roleName,
AttributeSet qualifications)
Assigns the principal with the given id to the role with the specified namespace code and name with the supplied set of qualifications. |
void |
assignRoleToRole(String roleId,
String namespaceCode,
String roleName,
AttributeSet qualifications)
Assigns the role with the given id to the role with the specified namespace code and name with the supplied set of qualifications. |
protected List<String>[] |
filterRoleIdsByCachingAbility(List<String> roleIds)
Splits the given List of role ids into two Lists, one with roles to cache, and one with roles not to cache |
List<DelegateMemberCompleteInfo> |
findDelegateMembersCompleteInfo(Map<String,String> fieldValues)
|
List<RoleMembershipInfo> |
findRoleMembers(Map<String,String> fieldValues)
Gets role member information based on the given search criteria. |
List<RoleMemberCompleteInfo> |
findRoleMembersCompleteInfo(Map<String,String> fieldValues)
|
void |
flushDelegationCaches()
Flush all of the delegation-related caches. |
void |
flushDelegationMemberCaches()
Flush all of the delegation-member-related caches. |
void |
flushInternalDelegationCache()
Flushes an internal delegation cache used by the base implementation to prevent repeated database I/O. |
void |
flushInternalDelegationMemberCache()
Flushes an internal delegation member cache used by the base implementation to prevent repeated database I/O. |
void |
flushInternalRoleCache()
Flushes an internal role cache used by the base implementation to prevent repeated database I/O. |
void |
flushInternalRoleMemberCache()
Flushes an internal role member cache used by the base implementation to prevent repeated database I/O. |
void |
flushRoleCaches()
Flush all of the role-related caches. |
void |
flushRoleMemberCaches()
Flush all of the role-member-related caches. |
DelegateTypeInfo |
getDelegateTypeInfo(String roleId,
String delegationTypeCode)
|
DelegateTypeInfo |
getDelegateTypeInfoById(String delegationId)
|
DelegateMemberCompleteInfo |
getDelegationMemberByDelegationAndMemberId(String delegationId,
String memberId)
|
DelegateMemberCompleteInfo |
getDelegationMemberById(String delegationMemberId)
|
List<DelegateMemberCompleteInfo> |
getDelegationMembersByDelegationId(String delegationId)
Gets delegation member information based on the given search criteria. |
List<RoleMembershipInfo> |
getFirstLevelRoleMembers(List<String> roleIds)
Gets all direct members of the roles that have ids within the given list of role ids. |
List<String> |
getMemberParentRoleIds(String memberType,
String memberId)
This overridden method ... |
String |
getNextAvailableRoleId()
Returns id available for a new role |
protected Boolean |
getPrincipalHasRoleCacheCache(String key)
|
List<String> |
getPrincipalIdSubListWithRole(List<String> principalIds,
String roleNamespaceCode,
String roleName,
AttributeSet qualification)
Returns the subset of the given principal ID list which has the given role and qualification. |
KimRoleInfo |
getRole(String roleId)
Get the KIM Role object with the given ID. |
protected KimRoleInfo |
getRoleByIdCache(String roleId)
|
KimRoleInfo |
getRoleByName(String namespaceCode,
String roleName)
Get the KIM Role object with the unique combination of namespace, component, and role name. |
protected KimRoleInfo |
getRoleByNameCache(String key)
|
String |
getRoleIdByName(String namespaceCode,
String roleName)
Return the Role ID for the given unique combination of namespace, component and role name. |
Collection<String> |
getRoleMemberPrincipalIds(String namespaceCode,
String roleName,
AttributeSet qualification)
This method gets all the members, then traverses down into members of type role and group to obtain the nested principal ids |
protected Collection<String> |
getRoleMemberPrincipalIdsCache(String key)
|
List<RoleResponsibilityActionInfo> |
getRoleMemberResponsibilityActionInfo(String roleMemberId)
|
List<RoleMembershipInfo> |
getRoleMembers(List<String> roleIds,
AttributeSet qualification)
Get all the role members (groups and principals) associated with the given list of roles where their role membership/assignment matches the given qualification. |
protected List<RoleMembershipInfo> |
getRoleMembersWithDelegationCache(String key)
|
List<AttributeSet> |
getRoleQualifiersForPrincipal(String principalId,
List<String> roleIds,
AttributeSet qualification)
Returns a list of role qualifiers that the given principal has without taking into consideration that the principal may be a member via an assigned group or role. |
List<AttributeSet> |
getRoleQualifiersForPrincipal(String principalId,
String namespaceCode,
String roleName,
AttributeSet qualification)
Returns a list of role qualifiers that the given principal has without taking into consideration that the principal may be a member via an assigned group or role. |
protected List<AttributeSet> |
getRoleQualifiersForPrincipalCache(String key)
|
List<AttributeSet> |
getRoleQualifiersForPrincipalIncludingNested(String principalId,
List<String> roleIds,
AttributeSet qualification)
Returns a list of role qualifiers that the given principal. |
List<AttributeSet> |
getRoleQualifiersForPrincipalIncludingNested(String principalId,
String namespaceCode,
String roleName,
AttributeSet qualification)
Returns a list of role qualifiers that the given principal. |
List<RoleResponsibilityInfo> |
getRoleResponsibilities(String roleId)
|
List<KimRoleInfo> |
getRoles(List<String> roleIds)
Get the KIM Role objects for the role IDs in the given List. |
RoleService |
getRoleService()
|
List<? extends Role> |
getRolesSearchResults(Map<String,String> fieldValues)
This method get search results for role lookup |
protected KimRoleTypeService |
getRoleTypeService(KimTypeInfo typeInfo)
Retrieves a role type from the given type info |
protected KimRoleTypeService |
getRoleTypeService(String roleId)
Retrieves the role type service associated with the given role ID |
RoleUpdateService |
getRoleUpdateService()
|
KimTypeInfoService |
getTypeInfoService()
|
void |
groupInactivated(String groupId)
Notifies the role service that the group with the given id has been inactivated. |
boolean |
isRoleActive(String roleId)
Checks whether the role with the given role ID is active. |
protected void |
logPrincipalHasRoleCheck(String principalId,
List<String> roleIds,
AttributeSet roleQualifiers)
|
List<KimRoleInfo> |
lookupRoles(Map<String,String> searchCriteria)
This overridden method looks up roles based on criteria. |
boolean |
principalHasRole(String principalId,
List<String> roleIds,
AttributeSet qualification)
Returns whether the given principal has any of the passed role IDs with the given qualification. |
void |
principalInactivated(String principalId)
Notifies all of a principal's roles and role types that the principal has been inactivated. |
void |
removeCacheEntries(String roleId,
String principalId)
Remove all cache entries for the given roleId and principalId combination. |
void |
removeGroupFromRole(String groupId,
String namespaceCode,
String roleName,
AttributeSet qualifications)
Remove the group with the given id and qualifications from the role with the specified namespace code and role name. |
void |
removePrincipalFromRole(String principalId,
String namespaceCode,
String roleName,
AttributeSet qualifications)
Remove the principal with the given id and qualifications from the role with the specified namespace code and role name. |
void |
removeRoleFromRole(String roleId,
String namespaceCode,
String roleName,
AttributeSet qualifications)
Remove the group with the given id and qualifications from the role with the specified namespace code and role name. |
void |
roleInactivated(String roleId)
Notifies the role service that the role with the given id has been inactivated. |
void |
saveDelegationMemberForRole(String delegationMemberId,
String roleMemberId,
String memberId,
String memberTypeCode,
String delegationTypeCode,
String roleId,
AttributeSet qualifications,
Date activeFromDate,
Date activeToDate)
Assigns the member with the given id as a delegation member to the role with the specified namespace code and name with the supplied set of qualifications. |
void |
saveRole(String roleId,
String roleName,
String roleDescription,
boolean active,
String kimTypeId,
String namespaceCode)
Creates or updates role with given attributes |
RoleMemberCompleteInfo |
saveRoleMemberForRole(String roleMemberId,
String memberId,
String memberTypeCode,
String roleId,
AttributeSet qualifications,
Date activeFromDate,
Date activeToDate)
Assigns the role with the given id to the role with the specified namespace code and name with the supplied set of qualifications. |
void |
saveRoleRspActions(String roleResponsibilityActionId,
String roleId,
String roleResponsibilityId,
String roleMemberId,
String actionTypeCode,
String actionPolicyCode,
Integer priorityNumber,
Boolean forceAction)
|
void |
setRoleCacheMaxAgeSeconds(int roleCacheMaxAge)
|
void |
setRoleCacheMaxSize(int roleCacheMaxSize)
|
protected boolean |
shouldCacheRole(String roleId)
Determines if the role with the given id will be cached |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int roleCacheMaxSize
protected int roleCacheMaxAgeSeconds
protected Map<String,MaxAgeSoftReference<KimRoleInfo>> roleByIdCache
protected Map<String,MaxAgeSoftReference<KimRoleInfo>> roleByNameCache
protected Map<String,MaxAgeSoftReference<List<RoleMembershipInfo>>> roleMembersWithDelegationCache
protected Map<String,MaxAgeSoftReference<List<AttributeSet>>> roleQualifiersForPrincipalCache
protected Map<String,MaxAgeSoftReference<Boolean>> principalHasRoleCache
protected Map<String,MaxAgeSoftReference<Collection<String>>> memberPrincipalIdsCache
protected Map<String,Boolean> shouldCacheRoleCache
Constructor Detail |
---|
public RoleManagementServiceImpl()
Method Detail |
---|
public void afterPropertiesSet() throws Exception
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
public void flushRoleCaches()
RoleManagementService
flushRoleCaches
in interface RoleManagementService
public void flushRoleMemberCaches()
RoleManagementService
flushRoleMemberCaches
in interface RoleManagementService
public void flushDelegationCaches()
RoleManagementService
flushDelegationCaches
in interface RoleManagementService
public void flushDelegationMemberCaches()
RoleManagementService
flushDelegationMemberCaches
in interface RoleManagementService
protected KimRoleInfo getRoleByIdCache(String roleId)
protected KimRoleInfo getRoleByNameCache(String key)
protected List<RoleMembershipInfo> getRoleMembersWithDelegationCache(String key)
protected List<AttributeSet> getRoleQualifiersForPrincipalCache(String key)
protected Boolean getPrincipalHasRoleCacheCache(String key)
protected void addRoleToCaches(KimRoleInfo role)
protected void addRoleMembersWithDelegationToCache(String key, List<RoleMembershipInfo> members)
protected void addRoleQualifiersForPrincipalToCache(String key, List<AttributeSet> qualifiers)
protected void addPrincipalHasRoleToCache(String key, boolean hasRole)
protected Collection<String> getRoleMemberPrincipalIdsCache(String key)
protected void addRoleMemberPrincipalIdsToCache(String key, Collection<String> principalIds)
public Collection<String> getRoleMemberPrincipalIds(String namespaceCode, String roleName, AttributeSet qualification)
RoleService
getRoleMemberPrincipalIds
in interface RoleService
RoleService.getRoleMemberPrincipalIds(java.lang.String, java.lang.String, org.kuali.rice.core.xml.dto.AttributeSet)
public KimRoleInfo getRole(String roleId)
RoleService
null
.
getRole
in interface RoleService
RoleService.getRole(java.lang.String)
public KimRoleInfo getRoleByName(String namespaceCode, String roleName)
RoleService
null
.
getRoleByName
in interface RoleService
RoleService.getRoleByName(java.lang.String, java.lang.String)
public String getRoleIdByName(String namespaceCode, String roleName)
RoleService
getRoleIdByName
in interface RoleService
RoleService.getRoleIdByName(java.lang.String, java.lang.String)
public List<KimRoleInfo> getRoles(List<String> roleIds)
RoleService
getRoles
in interface RoleService
RoleService.getRoles(java.util.List)
protected void addIdsToKey(StringBuffer key, List<String> idList)
protected void addAttributesToKey(StringBuffer key, AttributeSet attributes)
public List<RoleMembershipInfo> getRoleMembers(List<String> roleIds, AttributeSet qualification)
RoleService
getRoleMembers
in interface RoleService
RoleService.getRoleMembers(java.util.List, org.kuali.rice.core.xml.dto.AttributeSet)
public List<AttributeSet> getRoleQualifiersForPrincipal(String principalId, List<String> roleIds, AttributeSet qualification)
RoleService
getRoleQualifiersForPrincipal
in interface RoleService
RoleService.getRoleQualifiersForPrincipal(java.lang.String, java.util.List, org.kuali.rice.core.xml.dto.AttributeSet)
public List<AttributeSet> getRoleQualifiersForPrincipal(String principalId, String namespaceCode, String roleName, AttributeSet qualification)
RoleService
getRoleQualifiersForPrincipal
in interface RoleService
RoleService.getRoleQualifiersForPrincipal(java.lang.String, java.lang.String, java.lang.String, org.kuali.rice.core.xml.dto.AttributeSet)
public boolean isRoleActive(String roleId)
RoleService
isRoleActive
in interface RoleService
public boolean principalHasRole(String principalId, List<String> roleIds, AttributeSet qualification)
RoleService
principalHasRole
in interface RoleService
protected boolean shouldCacheRole(String roleId)
roleId
- the role id of the role to determine caching on
protected List<String>[] filterRoleIdsByCachingAbility(List<String> roleIds)
roleIds
- the List of role ids to split
protected KimRoleTypeService getRoleTypeService(String roleId)
roleId
- the role ID to get the role type service for
protected KimRoleTypeService getRoleTypeService(KimTypeInfo typeInfo)
typeInfo
-
public List<String> getPrincipalIdSubListWithRole(List<String> principalIds, String roleNamespaceCode, String roleName, AttributeSet qualification)
RoleService
getPrincipalIdSubListWithRole
in interface RoleService
RoleService.getPrincipalIdSubListWithRole(java.util.List, java.lang.String, java.lang.String, org.kuali.rice.core.xml.dto.AttributeSet)
public void removeCacheEntries(String roleId, String principalId)
RoleManagementService
removeCacheEntries
in interface RoleManagementService
public List<AttributeSet> getRoleQualifiersForPrincipalIncludingNested(String principalId, List<String> roleIds, AttributeSet qualification)
RoleService
getRoleQualifiersForPrincipalIncludingNested
in interface RoleService
RoleService.getRoleQualifiersForPrincipalIncludingNested(java.lang.String, java.util.List, org.kuali.rice.core.xml.dto.AttributeSet)
public List<AttributeSet> getRoleQualifiersForPrincipalIncludingNested(String principalId, String namespaceCode, String roleName, AttributeSet qualification)
RoleService
getRoleQualifiersForPrincipalIncludingNested
in interface RoleService
RoleService.getRoleQualifiersForPrincipalIncludingNested(java.lang.String, java.lang.String, java.lang.String, org.kuali.rice.core.xml.dto.AttributeSet)
public void assignGroupToRole(String groupId, String namespaceCode, String roleName, AttributeSet qualifications)
RoleUpdateService
assignGroupToRole
in interface RoleUpdateService
public void assignPrincipalToRole(String principalId, String namespaceCode, String roleName, AttributeSet qualifications)
RoleUpdateService
assignPrincipalToRole
in interface RoleUpdateService
public void removeGroupFromRole(String groupId, String namespaceCode, String roleName, AttributeSet qualifications)
RoleUpdateService
removeGroupFromRole
in interface RoleUpdateService
public void removePrincipalFromRole(String principalId, String namespaceCode, String roleName, AttributeSet qualifications)
RoleUpdateService
removePrincipalFromRole
in interface RoleUpdateService
public List<? extends Role> getRolesSearchResults(Map<String,String> fieldValues)
RoleService
getRolesSearchResults
in interface RoleService
RoleService.getRolesSearchResults(java.util.Map)
protected void logPrincipalHasRoleCheck(String principalId, List<String> roleIds, AttributeSet roleQualifiers)
public void principalInactivated(String principalId)
RoleService
principalInactivated
in interface RoleService
RoleService.principalInactivated(java.lang.String)
public void roleInactivated(String roleId)
RoleService
roleInactivated
in interface RoleService
RoleService.roleInactivated(java.lang.String)
public void groupInactivated(String groupId)
RoleService
groupInactivated
in interface RoleService
RoleService.roleInactivated(java.lang.String)
public List<RoleMembershipInfo> getFirstLevelRoleMembers(List<String> roleIds)
RoleService
The resulting List of role membership will contain membership for all the roles with the specified ids. The list is not guaranteed to be in any particular order and may have membership info for the different roles interleaved with each other.
getFirstLevelRoleMembers
in interface RoleService
public List<RoleMembershipInfo> findRoleMembers(Map<String,String> fieldValues)
RoleService
findRoleMembers
in interface RoleService
public void assignRoleToRole(String roleId, String namespaceCode, String roleName, AttributeSet qualifications)
RoleUpdateService
assignRoleToRole
in interface RoleUpdateService
public void saveDelegationMemberForRole(String delegationMemberId, String roleMemberId, String memberId, String memberTypeCode, String delegationTypeCode, String roleId, AttributeSet qualifications, Date activeFromDate, Date activeToDate) throws UnsupportedOperationException
RoleUpdateService
saveDelegationMemberForRole
in interface RoleUpdateService
UnsupportedOperationException
org.kuali.rice.kim.service.RoleUpdateService#assignRoleAsDelegationMemberToRole(java.lang.String, java.lang.String, java.lang.String, org.kuali.rice.core.xml.dto.AttributeSet)
public RoleMemberCompleteInfo saveRoleMemberForRole(String roleMemberId, String memberId, String memberTypeCode, String roleId, AttributeSet qualifications, Date activeFromDate, Date activeToDate) throws UnsupportedOperationException
RoleUpdateService
saveRoleMemberForRole
in interface RoleUpdateService
UnsupportedOperationException
public void removeRoleFromRole(String roleId, String namespaceCode, String roleName, AttributeSet qualifications)
RoleUpdateService
removeRoleFromRole
in interface RoleUpdateService
public List<RoleMemberCompleteInfo> findRoleMembersCompleteInfo(Map<String,String> fieldValues)
findRoleMembersCompleteInfo
in interface RoleService
public List<DelegateMemberCompleteInfo> findDelegateMembersCompleteInfo(Map<String,String> fieldValues)
findDelegateMembersCompleteInfo
in interface RoleService
public List<DelegateMemberCompleteInfo> getDelegationMembersByDelegationId(String delegationId)
RoleService
getDelegationMembersByDelegationId
in interface RoleService
public DelegateMemberCompleteInfo getDelegationMemberByDelegationAndMemberId(String delegationId, String memberId)
getDelegationMemberByDelegationAndMemberId
in interface RoleService
public DelegateMemberCompleteInfo getDelegationMemberById(String delegationMemberId)
getDelegationMemberById
in interface RoleService
public List<RoleResponsibilityActionInfo> getRoleMemberResponsibilityActionInfo(String roleMemberId)
getRoleMemberResponsibilityActionInfo
in interface RoleService
public DelegateTypeInfo getDelegateTypeInfo(String roleId, String delegationTypeCode)
getDelegateTypeInfo
in interface RoleService
public DelegateTypeInfo getDelegateTypeInfoById(String delegationId)
getDelegateTypeInfoById
in interface RoleService
public void saveRoleRspActions(String roleResponsibilityActionId, String roleId, String roleResponsibilityId, String roleMemberId, String actionTypeCode, String actionPolicyCode, Integer priorityNumber, Boolean forceAction)
saveRoleRspActions
in interface RoleUpdateService
public List<RoleResponsibilityInfo> getRoleResponsibilities(String roleId)
getRoleResponsibilities
in interface RoleService
public void applicationRoleMembershipChanged(String roleId)
applicationRoleMembershipChanged
in interface RoleService
public RoleService getRoleService()
public KimTypeInfoService getTypeInfoService()
public RoleUpdateService getRoleUpdateService()
public void setRoleCacheMaxSize(int roleCacheMaxSize)
public void setRoleCacheMaxAgeSeconds(int roleCacheMaxAge)
public List<KimRoleInfo> lookupRoles(Map<String,String> searchCriteria)
lookupRoles
in interface RoleService
RoleService.lookupRoles(java.util.Map)
public void flushInternalRoleCache()
RoleService
flushInternalRoleCache
in interface RoleService
public void flushInternalRoleMemberCache()
RoleService
flushInternalRoleMemberCache
in interface RoleService
public void flushInternalDelegationCache()
RoleService
flushInternalDelegationCache
in interface RoleService
public void flushInternalDelegationMemberCache()
RoleService
flushInternalDelegationMemberCache
in interface RoleService
public void assignPermissionToRole(String permissionId, String roleId) throws UnsupportedOperationException
RoleUpdateService
assignPermissionToRole
in interface RoleUpdateService
UnsupportedOperationException
public String getNextAvailableRoleId() throws UnsupportedOperationException
RoleUpdateService
getNextAvailableRoleId
in interface RoleUpdateService
UnsupportedOperationException
public void saveRole(String roleId, String roleName, String roleDescription, boolean active, String kimTypeId, String namespaceCode) throws UnsupportedOperationException
RoleUpdateService
saveRole
in interface RoleUpdateService
UnsupportedOperationException
public List<String> getMemberParentRoleIds(String memberType, String memberId)
getMemberParentRoleIds
in interface RoleService
RoleService.getMemberParentRoleIds(java.lang.String, java.lang.String)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |