Interface GroupMembershipCache

All Known Implementing Classes:
DefaultGroupMembershipCache

public interface GroupMembershipCache
A direction agnostic cache of maps from directory ids and group names to groups. Can be used for caching the list of members of a group, or the list of groups that a group is a member of.
  • Method Summary

    Modifier and Type
    Method
    Description
    List<com.atlassian.crowd.model.group.InternalDirectoryGroup>
    getGroupsForGroup(long directoryId, String groupName)
    List<com.atlassian.crowd.model.group.InternalDirectoryGroup>
    getGroupsForGroup(long directoryId, String groupName, Supplier<List<com.atlassian.crowd.model.group.InternalDirectoryGroup>> groupLoader)
    Returns the list of groups which are cached for the given group name in the specified directory.
    void
    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.
  • Method Details

    • getGroupsForGroup

      @Deprecated 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. or null if there is no cached list.
    • getGroupsForGroup

      List<com.atlassian.crowd.model.group.InternalDirectoryGroup> getGroupsForGroup(long directoryId, String groupName, Supplier<List<com.atlassian.crowd.model.group.InternalDirectoryGroup>> groupLoader)
      Returns the list of groups which are cached for the given group name in the specified directory. If not in the cache, the given spplier will be called to provide a new list.
      Since:
      7.5
    • removeGroupGroupMemberships

      void removeGroupGroupMemberships(long directoryId, String groupName)
      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.
    • removeAllGroupMemberships

      void removeAllGroupMemberships(com.atlassian.crowd.model.group.Group group)
      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.

    • removeAllDirectoryMemberships

      void removeAllDirectoryMemberships(long directoryId)
      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.