public class CachingProjectRoleAndActorStore extends Object implements ProjectRoleAndActorStore
ProjectRoleAndActorStore
that delegates to another ProjectRoleAndActorStore
.
This class maintains two separate unrelated caches, one for ProjectRoles and another for the actors associated with a Project/ProjectRole combination. These use separate approaches to maintain correctness under concurrent usage.
The caching of the ProjectRoleActors maintains its correctness under concurrent updates/miss population by using
ConcurrentMap.putIfAbsent(Object,Object)
to store the result of a retrieval operation from the database
(non-mutative), but Map.put(Object,Object)
to store the result of an update.
Constructor and Description |
---|
CachingProjectRoleAndActorStore(ProjectRoleAndActorStore delegate,
RoleActorFactory roleActorFactory,
com.atlassian.cache.CacheManager cacheManager) |
public CachingProjectRoleAndActorStore(ProjectRoleAndActorStore delegate, RoleActorFactory roleActorFactory, com.atlassian.cache.CacheManager cacheManager)
public Collection<ProjectRole> getAllProjectRoles()
getAllProjectRoles
in interface ProjectRoleAndActorStore
public ProjectRole getProjectRole(Long id)
getProjectRole
in interface ProjectRoleAndActorStore
public ProjectRole getProjectRoleByName(String name)
getProjectRoleByName
in interface ProjectRoleAndActorStore
public ProjectRole addProjectRole(ProjectRole projectRole)
addProjectRole
in interface ProjectRoleAndActorStore
public void updateProjectRole(ProjectRole projectRole)
updateProjectRole
in interface ProjectRoleAndActorStore
public void deleteProjectRole(ProjectRole projectRole)
deleteProjectRole
in interface ProjectRoleAndActorStore
public DefaultRoleActors getDefaultRoleActors(Long projectRoleId)
getDefaultRoleActors
in interface ProjectRoleAndActorStore
public ProjectRoleActors getProjectRoleActors(Long projectRoleId, Long projectId)
getProjectRoleActors
in interface ProjectRoleAndActorStore
public void updateProjectRoleActors(ProjectRoleActors projectRoleActors)
updateProjectRoleActors
in interface ProjectRoleAndActorStore
public void updateDefaultRoleActors(DefaultRoleActors defaultRoleActors)
updateDefaultRoleActors
in interface ProjectRoleAndActorStore
public void applyDefaultsRolesToProject(Project project)
applyDefaultsRolesToProject
in interface ProjectRoleAndActorStore
public void removeAllRoleActorsByKeyAndType(String key, String type)
removeAllRoleActorsByKeyAndType
in interface ProjectRoleAndActorStore
public void removeAllRoleActorsByProject(Project project)
removeAllRoleActorsByProject
in interface ProjectRoleAndActorStore
public Collection<Long> getProjectIdsContainingRoleActorByKeyAndType(String key, String type)
getProjectIdsContainingRoleActorByKeyAndType
in interface ProjectRoleAndActorStore
public List<Long> roleActorOfTypeExistsForProjects(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String projectRoleParameter)
roleActorOfTypeExistsForProjects
in interface ProjectRoleAndActorStore
public Map<Long,List<String>> getProjectIdsForUserInGroupsBecauseOfRole(List<Long> projectsToLimitBy, ProjectRole projectRole, String projectRoleType, String userKey)
getProjectIdsForUserInGroupsBecauseOfRole
in interface ProjectRoleAndActorStore
@EventListener public void onClearCache(ClearCacheEvent event)
public void clearCaches()
public boolean isGroupUsed(@Nonnull String group)
isGroupUsed
in interface ProjectRoleAndActorStore
Copyright © 2002-2015 Atlassian. All Rights Reserved.