com.atlassian.crowd.service.cache
Interface BasicCache

All Known Implementing Classes:
CacheImpl

public interface BasicCache

Non-domain-specific methods


Method Summary
 void addGroupToUser(java.lang.String userName, java.lang.String groupName)
           
 void addIsUserOrGroup(java.lang.String name, java.lang.Boolean isValidUserOrGroup)
           
 void addOrReplaceAllGroupNames(java.util.List groupNames)
          Adds, or if it already exists, replaces the list of all group names.
 void addOrReplaceAllMembers(java.lang.String groupName, java.util.List userNames)
          Cache a list of all users in this group.
 void addOrReplaceAllMemberships(java.lang.String userName, java.util.List groupNames)
          Cache a list of all groups this user belongs to.
 void addOrReplaceAllUserNames(java.util.List userNames)
          Adds a list of all users, or if one already exists, replaces it.
 void addOrReplaceGroup(SOAPGroup group)
          Adds a group, or if it exists, replaces the old SOAPGroup instance.
 void addOrReplaceUser(SOAPPrincipal user)
          Adds, or if they exist, replaces an existing user.
 void addOrReplaceUserWithAttributes(SOAPPrincipal user)
           
 void addParentForGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Makes the underlying cache aware of the fact that childGroup is a member of parentGroup
 void addToAllGroupNamesCache(java.lang.String groupName)
          If we have a list of all groups, when we add one we should update the list.
 void addToAllUsers(java.lang.String userName)
          Adds userName to the list of all users in the system.
 void addUserToGroup(java.lang.String userName, java.lang.String groupName)
           
 boolean containsGroupRelationships()
          Returns true if the cache contains enough information to reliably compute parent group relationships.
 void flush()
          Clears the underlying cache.
 java.util.List getAllGroupNames()
          Returns a List of Strings containing all group names, or null if the list is not cached.
 java.util.List getAllMembers(java.lang.String groupName)
          Returns a list of users that belong to groupName belongs to, or null if there aren't any.
 java.util.List getAllMemberships(java.lang.String userName)
          Returns a list of groups that userName belongs to, or null if they don't belong to any.
 java.util.List getAllUserNames()
          Returns a List with all user names, or null if none are cached.
 SOAPGroup getGroup(java.lang.String groupName)
          Returns the group, or null if it's not in the cache.
 java.lang.String getGroupName(java.lang.String groupname)
          Returns the groupname in correct case if it exists in the cache, null otherwise.
 java.util.List getParentGroups(java.lang.String childGroup)
          Returns the list of groups that are registered as parents for this group.
 SOAPPrincipal getUser(java.lang.String userName)
          Returns the SOAPPrincipal representing userName, or null if it's not in the cache.
 java.lang.String getUserName(java.lang.String username)
          Returns the username in correct case if it exists in the cache, null otherwise.
 SOAPPrincipal getUserWithAttributes(java.lang.String userName)
          Returns the SOAPPrincipal with Attributes representing userName, or null if it's not in the cache.
 java.lang.Boolean isMember(java.lang.String userName, java.lang.String groupName)
          Maintains a list of true/false for "is this user a member of this group".
 java.lang.Boolean isMemberInGroupCache(java.lang.String userName, java.lang.String groupName)
          Checks the group->user cache to see if the user is a member.
 java.lang.Boolean isUserOrGroup(java.lang.String name)
          Will return true is the string represents a user or group
 void removeAllMembers(java.lang.String groupName)
          Removes the list of users in the group.
 void removeAllMemberships(java.lang.String userName)
          Called by CachingUserManager.removeUser(String) to ensure the users details are removed from any and all user->groups and (user+group)->[yes,no] caches.
 void removeAllMembershipsFromUserMembershipsCache(java.lang.String userName)
          Removes the list of groups the user belongs to.
 void removeCachedGroupMembership(java.lang.String userName, java.lang.String groupName)
          Removes all the membership details for this specific userName, groupName pair, when a group is being removed.
 void removeCachedGroupMemberships(java.lang.String groupName)
          Called by CachingGroupManager.removeGroup(String) to ensure the group details are removed from any and all user->groups and (user+group)->[yes,no] caches.
 void removeCachedUser(java.lang.String userName, java.lang.String groupName)
           
 void removeFromAllGroupNamesCache(java.lang.String groupName)
          When we remove a group, if we have already cached the list of all available groups, we need to remove this group.
 void removeFromAllUsers(java.lang.String userName)
           
 void removeGroup(java.lang.String groupName)
          Removes the group, if it exists
 void removeGroupFromUser(java.lang.String userName, java.lang.String groupName)
           
 void removeMembership(java.lang.String userName, java.lang.String groupName)
          Remove any stored [yes,no] membership relationship for a userName & groupName combination.
 boolean removeUser(java.lang.String userName)
          Removes the user from the cache.
 void removeUserFromGroup(java.lang.String userName, java.lang.String groupName)
           
 java.util.List setMembers(java.lang.String groupName, java.lang.String[] userNameArray)
          Caches the member list for a group called groupName.
 void setMembership(java.lang.String userName, java.lang.String groupName, java.lang.Boolean isMember)
          Adds or replaces a membership relationship between the user and the group.
 

Method Detail

flush

void flush()
Clears the underlying cache. May clear more than just one cache - assume that all state in all caches is lost when you call this.


getGroup

SOAPGroup getGroup(java.lang.String groupName)
Returns the group, or null if it's not in the cache.

Parameters:
groupName -
Returns:

addOrReplaceGroup

void addOrReplaceGroup(SOAPGroup group)
Adds a group, or if it exists, replaces the old SOAPGroup instance.

Parameters:
group -

removeGroup

void removeGroup(java.lang.String groupName)
Removes the group, if it exists

Parameters:
groupName -

getAllGroupNames

java.util.List getAllGroupNames()
Returns a List of Strings containing all group names, or null if the list is not cached.

Returns:

addOrReplaceAllGroupNames

void addOrReplaceAllGroupNames(java.util.List groupNames)
Adds, or if it already exists, replaces the list of all group names.

Parameters:
groupNames -

addParentForGroup

void addParentForGroup(java.lang.String childGroup,
                       java.lang.String parentGroup)
Makes the underlying cache aware of the fact that childGroup is a member of parentGroup

Parameters:
parentGroup -
childGroup -

getParentGroups

java.util.List getParentGroups(java.lang.String childGroup)
Returns the list of groups that are registered as parents for this group.

Parameters:
childGroup -
Returns:

containsGroupRelationships

boolean containsGroupRelationships()
Returns true if the cache contains enough information to reliably compute parent group relationships. If not, returns false.

Returns:

setMembership

void setMembership(java.lang.String userName,
                   java.lang.String groupName,
                   java.lang.Boolean isMember)
Adds or replaces a membership relationship between the user and the group. Updates the list of memberships returned by getAllMemberships() to keep them in sync.

Parameters:
userName -
groupName -
isMember - true if the user is a member, false if not.

removeMembership

void removeMembership(java.lang.String userName,
                      java.lang.String groupName)
Remove any stored [yes,no] membership relationship for a userName & groupName combination.

Parameters:
userName -
groupName -

isMember

java.lang.Boolean isMember(java.lang.String userName,
                           java.lang.String groupName)
Maintains a list of true/false for "is this user a member of this group". Returns null if no information is cached.

Parameters:
userName -
groupName -
Returns:

getAllMemberships

java.util.List getAllMemberships(java.lang.String userName)
Returns a list of groups that userName belongs to, or null if they don't belong to any.

Parameters:
userName -
Returns:

addOrReplaceAllMemberships

void addOrReplaceAllMemberships(java.lang.String userName,
                                java.util.List groupNames)
Cache a list of all groups this user belongs to.

Parameters:
userName -
groupNames -

removeAllMembershipsFromUserMembershipsCache

void removeAllMembershipsFromUserMembershipsCache(java.lang.String userName)
Removes the list of groups the user belongs to. Used when the user is being deleted.

Parameters:
userName -

getAllMembers

java.util.List getAllMembers(java.lang.String groupName)
Returns a list of users that belong to groupName belongs to, or null if there aren't any.

Parameters:
groupName -
Returns:

addOrReplaceAllMembers

void addOrReplaceAllMembers(java.lang.String groupName,
                            java.util.List userNames)
Cache a list of all users in this group.

Parameters:
groupName -
userNames -

removeAllMembers

void removeAllMembers(java.lang.String groupName)
Removes the list of users in the group. Used when the group is being deleted.

Parameters:
groupName -

isUserOrGroup

java.lang.Boolean isUserOrGroup(java.lang.String name)
Will return true is the string represents a user or group


addIsUserOrGroup

void addIsUserOrGroup(java.lang.String name,
                      java.lang.Boolean isValidUserOrGroup)

addOrReplaceUser

void addOrReplaceUser(SOAPPrincipal user)
Adds, or if they exist, replaces an existing user.

Parameters:
user -

removeUser

boolean removeUser(java.lang.String userName)
Removes the user from the cache.

Parameters:
userName -
Returns:
true if the user was cached, false otherwise.

getUser

SOAPPrincipal getUser(java.lang.String userName)
Returns the SOAPPrincipal representing userName, or null if it's not in the cache.

Parameters:
userName -
Returns:

getUserWithAttributes

SOAPPrincipal getUserWithAttributes(java.lang.String userName)
Returns the SOAPPrincipal with Attributes representing userName, or null if it's not in the cache.

Parameters:
userName -
Returns:

getAllUserNames

java.util.List getAllUserNames()
Returns a List with all user names, or null if none are cached.

Returns:

addOrReplaceAllUserNames

void addOrReplaceAllUserNames(java.util.List userNames)
Adds a list of all users, or if one already exists, replaces it.

Parameters:
userNames -

isMemberInGroupCache

java.lang.Boolean isMemberInGroupCache(java.lang.String userName,
                                       java.lang.String groupName)
Checks the group->user cache to see if the user is a member.

Parameters:
userName -
groupName -
Returns:
Boolean.TRUE if the user is a member. Boolean.FALSE if not. null if we don't have enough information to tell.

addGroupToUser

void addGroupToUser(java.lang.String userName,
                    java.lang.String groupName)

addUserToGroup

void addUserToGroup(java.lang.String userName,
                    java.lang.String groupName)

removeGroupFromUser

void removeGroupFromUser(java.lang.String userName,
                         java.lang.String groupName)

removeUserFromGroup

void removeUserFromGroup(java.lang.String userName,
                         java.lang.String groupName)

setMembers

java.util.List setMembers(java.lang.String groupName,
                          java.lang.String[] userNameArray)
Caches the member list for a group called groupName. Since group member information arrives when the group is fetched from the Crowd server, this is also called from CachingGroupManager.getGroup(String).

Parameters:
groupName -
userNameArray -

removeCachedGroupMembership

void removeCachedGroupMembership(java.lang.String userName,
                                 java.lang.String groupName)
Removes all the membership details for this specific userName, groupName pair, when a group is being removed.

Parameters:
userName -
groupName -

removeCachedGroupMemberships

void removeCachedGroupMemberships(java.lang.String groupName)
Called by CachingGroupManager.removeGroup(String) to ensure the group details are removed from any and all user->groups and (user+group)->[yes,no] caches.

Parameters:
groupName -

removeFromAllGroupNamesCache

void removeFromAllGroupNamesCache(java.lang.String groupName)
When we remove a group, if we have already cached the list of all available groups, we need to remove this group.

Parameters:
groupName -

addToAllGroupNamesCache

void addToAllGroupNamesCache(java.lang.String groupName)
If we have a list of all groups, when we add one we should update the list.

Parameters:
groupName -

removeCachedUser

void removeCachedUser(java.lang.String userName,
                      java.lang.String groupName)

removeAllMemberships

void removeAllMemberships(java.lang.String userName)
Called by CachingUserManager.removeUser(String) to ensure the users details are removed from any and all user->groups and (user+group)->[yes,no] caches.

Parameters:
userName -

addToAllUsers

void addToAllUsers(java.lang.String userName)
Adds userName to the list of all users in the system.

Parameters:
userName -

removeFromAllUsers

void removeFromAllUsers(java.lang.String userName)

getUserName

java.lang.String getUserName(java.lang.String username)
Returns the username in correct case if it exists in the cache, null otherwise.

Parameters:
username -
Returns:

getGroupName

java.lang.String getGroupName(java.lang.String groupname)
Returns the groupname in correct case if it exists in the cache, null otherwise.

Parameters:
groupname -
Returns:

addOrReplaceUserWithAttributes

void addOrReplaceUserWithAttributes(SOAPPrincipal user)


Copyright © 2010 Atlassian. All Rights Reserved.