|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.service.cache.CacheImpl
public class CacheImpl
Constructor Summary | |
---|---|
CacheImpl(net.sf.ehcache.CacheManager ehCacheManager)
|
|
CacheImpl(java.net.URL configLocation)
|
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 caches |
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 list of all members in lower-case. |
java.util.List |
getAllMemberships(java.lang.String userName)
Returns list of all memberships in lower-case. |
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. |
protected java.lang.String |
getKey(java.lang.String name)
Return a version of the name appropriate for use as a cache key. |
protected java.util.List<java.lang.String> |
getKeys(java.util.List<java.lang.String> names)
Applies getKey over a collection. |
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. |
protected boolean |
isUserDirty(SOAPPrincipal latestSoapPrincipal,
SOAPPrincipal cachedSoapPrincipal)
|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CacheImpl(java.net.URL configLocation)
public CacheImpl(net.sf.ehcache.CacheManager ehCacheManager)
Method Detail |
---|
protected java.lang.String getKey(java.lang.String name)
name
- key.
protected java.util.List<java.lang.String> getKeys(java.util.List<java.lang.String> names)
names
- set of names.
public void flush()
flush
in interface BasicCache
public void addOrReplaceUser(SOAPPrincipal user)
BasicCache
addOrReplaceUser
in interface BasicCache
protected boolean isUserDirty(SOAPPrincipal latestSoapPrincipal, SOAPPrincipal cachedSoapPrincipal)
public void addOrReplaceUserWithAttributes(SOAPPrincipal user)
addOrReplaceUserWithAttributes
in interface BasicCache
public boolean removeUser(java.lang.String userName)
BasicCache
removeUser
in interface BasicCache
public SOAPPrincipal getUser(java.lang.String userName)
BasicCache
SOAPPrincipal
representing userName
, or null
if it's not in the
cache.
getUser
in interface BasicCache
public SOAPPrincipal getUserWithAttributes(java.lang.String userName)
BasicCache
SOAPPrincipal
with Attributes representing userName
, or null
if it's not in the
cache.
getUserWithAttributes
in interface BasicCache
public java.util.List getAllUserNames()
BasicCache
getAllUserNames
in interface BasicCache
public void addOrReplaceAllUserNames(java.util.List userNames)
BasicCache
addOrReplaceAllUserNames
in interface BasicCache
public SOAPGroup getGroup(java.lang.String groupName)
BasicCache
getGroup
in interface BasicCache
public void addOrReplaceGroup(SOAPGroup group)
BasicCache
SOAPGroup
instance.
addOrReplaceGroup
in interface BasicCache
public void removeGroup(java.lang.String groupName)
BasicCache
removeGroup
in interface BasicCache
public java.util.List getAllGroupNames()
BasicCache
getAllGroupNames
in interface BasicCache
public void addOrReplaceAllGroupNames(java.util.List groupNames)
BasicCache
addOrReplaceAllGroupNames
in interface BasicCache
public void addParentForGroup(java.lang.String childGroup, java.lang.String parentGroup)
BasicCache
childGroup
is a member of parentGroup
addParentForGroup
in interface BasicCache
public java.util.List getParentGroups(java.lang.String childGroup)
BasicCache
getParentGroups
in interface BasicCache
public boolean containsGroupRelationships()
containsGroupRelationships
in interface BasicCache
public java.lang.Boolean isMemberInGroupCache(java.lang.String userName, java.lang.String groupName)
isMemberInGroupCache
in interface BasicCache
userName
- groupName
-
Boolean.TRUE
if the user is a member. Boolean.FALSE
if not. null if we don't
have enough information to tell.public void addGroupToUser(java.lang.String userName, java.lang.String groupName)
addGroupToUser
in interface BasicCache
public void addUserToGroup(java.lang.String userName, java.lang.String groupName)
addUserToGroup
in interface BasicCache
public void removeGroupFromUser(java.lang.String userName, java.lang.String groupName)
removeGroupFromUser
in interface BasicCache
public void removeUserFromGroup(java.lang.String userName, java.lang.String groupName)
removeUserFromGroup
in interface BasicCache
public java.util.List setMembers(java.lang.String groupName, java.lang.String[] userNameArray)
groupName
. Since group member information arrives when
the group is fetched from the Crowd server, this is also called from CachingGroupManager.getGroup(String)
.
setMembers
in interface BasicCache
groupName
- userNameArray
- public void removeCachedGroupMembership(java.lang.String userName, java.lang.String groupName)
removeCachedGroupMembership
in interface BasicCache
userName
- groupName
- public void removeCachedGroupMemberships(java.lang.String groupName)
CachingGroupManager.removeGroup(String)
to ensure the group details are removed from any and
all user->groups and (user+group)->[yes,no] caches.
removeCachedGroupMemberships
in interface BasicCache
groupName
- public void removeFromAllGroupNamesCache(java.lang.String groupName)
removeFromAllGroupNamesCache
in interface BasicCache
groupName
- public void addToAllGroupNamesCache(java.lang.String groupName)
addToAllGroupNamesCache
in interface BasicCache
groupName
- public void removeCachedUser(java.lang.String userName, java.lang.String groupName)
removeCachedUser
in interface BasicCache
public void removeAllMemberships(java.lang.String userName)
CachingUserManager.removeUser(String)
to ensure the users details are removed from any and
all user->groups and (user+group)->[yes,no] caches.
removeAllMemberships
in interface BasicCache
userName
- public void setMembership(java.lang.String userName, java.lang.String groupName, java.lang.Boolean isMember)
BasicCache
getAllMemberships()
to keep them in sync.
setMembership
in interface BasicCache
isMember
- true if the user is a member, false if not.public void removeMembership(java.lang.String userName, java.lang.String groupName)
BasicCache
removeMembership
in interface BasicCache
public java.lang.Boolean isMember(java.lang.String userName, java.lang.String groupName)
BasicCache
isMember
in interface BasicCache
public java.util.List getAllMemberships(java.lang.String userName)
getAllMemberships
in interface BasicCache
userName
-
public void addOrReplaceAllMemberships(java.lang.String userName, java.util.List groupNames)
BasicCache
addOrReplaceAllMemberships
in interface BasicCache
public void removeAllMembershipsFromUserMembershipsCache(java.lang.String userName)
BasicCache
removeAllMembershipsFromUserMembershipsCache
in interface BasicCache
public java.util.List getAllMembers(java.lang.String groupName)
getAllMembers
in interface BasicCache
groupName
-
public void addOrReplaceAllMembers(java.lang.String groupName, java.util.List userNames)
BasicCache
addOrReplaceAllMembers
in interface BasicCache
public void removeAllMembers(java.lang.String groupName)
BasicCache
removeAllMembers
in interface BasicCache
public java.lang.Boolean isUserOrGroup(java.lang.String name)
BasicCache
isUserOrGroup
in interface BasicCache
public void addIsUserOrGroup(java.lang.String name, java.lang.Boolean isValidUserOrGroup)
addIsUserOrGroup
in interface BasicCache
public void addToAllUsers(java.lang.String userName)
userName
to the list of all users in the system.
Username MUST be in the case returned by the underlying system (ie. not forced
to lower-case).
addToAllUsers
in interface BasicCache
userName
- public void removeFromAllUsers(java.lang.String userName)
removeFromAllUsers
in interface BasicCache
userName
- can be in a case different to that stored in the underlying system.public java.lang.String getUserName(java.lang.String username)
BasicCache
getUserName
in interface BasicCache
public java.lang.String getGroupName(java.lang.String groupname)
BasicCache
getGroupName
in interface BasicCache
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |