Class MembershipCache

  extended bycom.atlassian.user.impl.cache.MembershipCache

public class MembershipCache
extends java.lang.Object

The membership check cache is a cache where the key is the String returned by getMembershipKey(String, Group) for a given user and group, and the value is a Boolean indicating whether the user is a member of that group.

Both true and false membership checks are cached.

Constructor Summary
MembershipCache(com.atlassian.cache.CacheFactory cacheFactory, java.lang.String cacheName)
Method Summary
 java.lang.Boolean get(User user, Group group)
protected  java.lang.String getMembershipKey(java.lang.String username, Group group)
 void put(User user, Group group, boolean isMember)
 void remove(java.util.List usernames, Group group)
          Remove all cached values for a list of users and an associated group.
 void remove(User user, Group group)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail


public MembershipCache(com.atlassian.cache.CacheFactory cacheFactory,
                       java.lang.String cacheName)
Method Detail


protected java.lang.String getMembershipKey(java.lang.String username,
                                            Group group)


public void put(User user,
                Group group,
                boolean isMember)


public java.lang.Boolean get(User user,
                             Group group)
Boolean.TRUE if the user is a member of the group, Boolean.FALSE if the user is not a member of the group, or null if the result is not in the cache.


public void remove(User user,
                   Group group)


public void remove(java.util.List usernames,
                   Group group)
Remove all cached values for a list of users and an associated group. Typically called to remove all membership information when a group is removed.

usernames - a List of username Strings.
group - the group of which the users are members.

Copyright © 2005-2008 Atlassian Software Systems Pty Ltd. All Rights Reserved.