com.atlassian.confluence.user.crowd
Class DefaultGroupMembershipCache

java.lang.Object
  extended by com.atlassian.confluence.user.crowd.DefaultGroupMembershipCache
All Implemented Interfaces:
GroupMembershipCache

public class DefaultGroupMembershipCache
extends Object
implements GroupMembershipCache


Constructor Summary
DefaultGroupMembershipCache(com.atlassian.cache.CacheFactory cacheFactory, String cacheKey)
           
 
Method Summary
 List<com.atlassian.crowd.model.group.InternalDirectoryGroup> getGroupsForGroup(long directoryId, String groupName)
          Returns the list of groups which are cached for the given group name in the specified directory.
 void removeAllDirectoryMemberships(long directoryId)
          Removes any entries in the cache which relate to the specified directory.
 void removeAllGroupMemberships(com.atlassian.crowd.model.group.Group group)
          Removes any entries in the cache which contain the group in its directory.
 void removeGroupGroupMemberships(long directoryId, String groupName)
          Removes any list of groups which are cached for the named group in the specified directory.
 void setGroupsForGroup(long directoryId, String groupName, Iterable<com.atlassian.crowd.model.group.InternalDirectoryGroup> referencedGroups)
          Caches the list of Group objects for each membership for the given group name in the specified directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultGroupMembershipCache

public DefaultGroupMembershipCache(com.atlassian.cache.CacheFactory cacheFactory,
                                   String cacheKey)
Method Detail

setGroupsForGroup

public void setGroupsForGroup(long directoryId,
                              String groupName,
                              Iterable<com.atlassian.crowd.model.group.InternalDirectoryGroup> referencedGroups)
Description copied from interface: GroupMembershipCache
Caches the list of Group objects for each membership for the given group name in the specified directory.

Specified by:
setGroupsForGroup in interface GroupMembershipCache

getGroupsForGroup

public List<com.atlassian.crowd.model.group.InternalDirectoryGroup> getGroupsForGroup(long directoryId,
                                                                                      String groupName)
Description copied from interface: GroupMembershipCache
Returns the list of groups which are cached for the given group name in the specified directory. or null if there is no cached list.

Specified by:
getGroupsForGroup in interface GroupMembershipCache

removeGroupGroupMemberships

public void removeGroupGroupMemberships(long directoryId,
                                        String groupName)
Description copied from interface: GroupMembershipCache
Removes any list of groups which are cached for the named group in the specified directory. Does nothing if there is no corresponding entry in the cache.

Specified by:
removeGroupGroupMemberships in interface GroupMembershipCache

removeAllGroupMemberships

public void removeAllGroupMemberships(com.atlassian.crowd.model.group.Group group)
Description copied from interface: GroupMembershipCache
Removes any entries in the cache which contain the group in its directory.

This can be a slow operation if the cache is large. This is a trade-off of the cache design, which is optimised for fast retrieval of the list of groups cached for a group.

Removes any GROUPS_FOR_GROUP entry in this cache for the passed in group.

Specified by:
removeAllGroupMemberships in interface GroupMembershipCache

removeAllDirectoryMemberships

public void removeAllDirectoryMemberships(long directoryId)
Description copied from interface: GroupMembershipCache
Removes any entries in the cache which relate to the specified directory.

This can be a slow operation if the cache is large. This is a trade-off of the cache design, which is optimised for fast retrieval of the list of groups cached for a group.

Specified by:
removeAllDirectoryMemberships in interface GroupMembershipCache


Copyright © 2003-2012 Atlassian. All Rights Reserved.