public final class DefaultMembershipCache extends Object implements MembershipCache
CachedCrowdMembershipCacheKey representing a user (or group) in a particular directory
to a Map<String, String> where each entry in the map represents a group that the user (or group)
is a member of.
The key of each Map entry is the lowercase name of the user or child group. The value is the case-preserved actual name of the entity.
| Constructor and Description |
|---|
DefaultMembershipCache(com.atlassian.cache.CacheFactory cacheFactory)
Deprecated.
since 7.5 use
DefaultMembershipCache(TransactionAwareCacheFactory) |
DefaultMembershipCache(TransactionAwareCacheFactory cacheFactory) |
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getGroupsForGroup(long directoryId,
String groupName)
Returns the list of groups names which the named group is a member of in the specified directory.
|
List<String> |
getGroupsForGroup(long directoryId,
String groupName,
Supplier<List<String>> valueSupplier)
Returns the list of groups names which the named group is a member of in the specified directory.
|
List<String> |
getGroupsForUser(long directoryId,
String userName)
Returns the list of groups names which the named user is a member of in the specified directory.
|
List<String> |
getGroupsForUser(long directoryId,
String userName,
Supplier<List<String>> valueSupplier)
Returns the list of groups names which the named user is a member of in the specified directory.
|
Boolean |
isGroupDirectMember(long directoryId,
String groupName,
String parentGroupName)
Returns
true if the parentGroupName is in the cached list of parents of the child group,
false if parentGroupName is not in the list, or null if there is no cached list for the child group. |
boolean |
isGroupDirectMember(long directoryId,
String childGroupName,
String parentGroupName,
Supplier<Iterable<String>> groupMembershipSupplier)
Returns
true if the parentGroupName is in the cached list of parents of the child group,
false if parentGroupName is not in the list,. |
Boolean |
isUserDirectMember(long directoryId,
String userName,
String groupName)
Returns
true if the groupName is in the cached list of parents of the user, false
if groupName is not in the list, or null if there is no cached list for the user. |
boolean |
isUserDirectMember(long directoryId,
String userName,
String groupName,
Supplier<Iterable<String>> groupMembershipSupplier)
Returns
true if the groupName is in the cached list of parents of the user, false
if groupName is not in the list. |
void |
removeAllDirectoryMemberships(long directoryId)
Removes any entries in the cache which relate to the specified directory.
|
void |
removeAllGroupMemberships(long directoryId,
String groupName)
Removes any entries in the cache which contain the groupName in the specified directory.
|
void |
removeAllUserMemberships(long directoryId,
String userName)
Removes any entries in the cache which contain the userName in the specified directory.
|
void |
removeGroupGroupMemberships(long directoryId,
String groupName)
Removes any cached list of group names which are members of the named group in the specified directory.
|
void |
removeUserGroupMemberships(long directoryId,
String userName)
Removes any cached list of user names which are members of the named group in the specified directory.
|
void |
setGroupsForGroup(long directoryId,
String groupName,
Iterable<String> parentGroupNames)
Caches the list of parent groupNames for each membership for the named group in the specified directory.
|
void |
setGroupsForUser(long directoryId,
String userName,
Iterable<String> groupNames)
Caches the list of parent groupNames for each membership for the named user in the specified directory.
|
public DefaultMembershipCache(TransactionAwareCacheFactory cacheFactory)
@Deprecated public DefaultMembershipCache(com.atlassian.cache.CacheFactory cacheFactory)
DefaultMembershipCache(TransactionAwareCacheFactory)public Boolean isUserDirectMember(long directoryId, String userName, String groupName)
MembershipCachetrue if the groupName is in the cached list of parents of the user, false
if groupName is not in the list, or null if there is no cached list for the user.isUserDirectMember in interface MembershipCachepublic boolean isUserDirectMember(long directoryId,
String userName,
String groupName,
Supplier<Iterable<String>> groupMembershipSupplier)
MembershipCachetrue if the groupName is in the cached list of parents of the user, false
if groupName is not in the list.isUserDirectMember in interface MembershipCachegroupMembershipSupplier - a Supplier of group names for the user, if not already present in the cachepublic Boolean isGroupDirectMember(long directoryId, String groupName, String parentGroupName)
MembershipCachetrue if the parentGroupName is in the cached list of parents of the child group,
false if parentGroupName is not in the list, or null if there is no cached list for the child group.isGroupDirectMember in interface MembershipCachepublic boolean isGroupDirectMember(long directoryId,
String childGroupName,
String parentGroupName,
Supplier<Iterable<String>> groupMembershipSupplier)
MembershipCachetrue if the parentGroupName is in the cached list of parents of the child group,
false if parentGroupName is not in the list,.isGroupDirectMember in interface MembershipCachegroupMembershipSupplier - a Supplier of parent group names for the group, if not already present in the cachepublic void setGroupsForUser(long directoryId,
String userName,
Iterable<String> groupNames)
MembershipCachesetGroupsForUser in interface MembershipCachepublic void setGroupsForGroup(long directoryId,
String groupName,
Iterable<String> parentGroupNames)
MembershipCachesetGroupsForGroup in interface MembershipCachepublic List<String> getGroupsForUser(long directoryId, String userName)
MembershipCachenull if there is no cached list.getGroupsForUser in interface MembershipCachepublic List<String> getGroupsForUser(long directoryId, String userName, Supplier<List<String>> valueSupplier)
MembershipCachegetGroupsForUser in interface MembershipCachevalueSupplier - a Supplier of group names for the user, if not already present in the cachepublic List<String> getGroupsForGroup(long directoryId, String groupName)
MembershipCachenull if there is no cached list.getGroupsForGroup in interface MembershipCachepublic List<String> getGroupsForGroup(long directoryId, String groupName, Supplier<List<String>> valueSupplier)
MembershipCachegetGroupsForGroup in interface MembershipCachevalueSupplier - a Supplier of the parent groups of the child group, if not already present in the cache.public void removeUserGroupMemberships(long directoryId,
String userName)
MembershipCacheremoveUserGroupMemberships in interface MembershipCachepublic void removeGroupGroupMemberships(long directoryId,
String groupName)
MembershipCacheremoveGroupGroupMemberships in interface MembershipCachepublic void removeAllUserMemberships(long directoryId,
String userName)
MembershipCacheThis 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 all parent groups of a user or group.
Removes any GROUPS_FOR_USER entry in this cache if it contains this group.
removeAllUserMemberships in interface MembershipCachepublic void removeAllGroupMemberships(long directoryId,
String groupName)
MembershipCacheThis 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 all parent groups of a user or group.
Removes any GROUPS_FOR_GROUP entry in this cache for the passed in group. Removes any GROUPS_FOR_USER entry in this cache if it contains this group.
removeAllGroupMemberships in interface MembershipCachepublic void removeAllDirectoryMemberships(long directoryId)
MembershipCacheThis 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 all parent groups of a user or group.
removeAllDirectoryMemberships in interface MembershipCacheCopyright © 2003–2021 Atlassian. All rights reserved.