com.atlassian.crowd.util
Class NestingHelper
java.lang.Object
com.atlassian.crowd.util.NestingHelper
public class NestingHelper
- extends java.lang.Object
Encapsulates nasty logic related to making sure that all membership information returned to client applications
is nesting-aware. The methods are named to match where they're called from in the GroupManager &
GroupMembershipsManager.
Takes care of getting information in & out of the caches.
|
Method Summary |
static java.util.List<java.lang.String> |
cacheGroupRelationships(SOAPNestableGroup[] allGroups,
BasicCache cache)
Takes a list of all groups, along with their direct children, and returns a list of group names. |
static java.util.List<java.lang.String> |
getAllGroupsForUser(java.util.List<java.lang.String> directGroups,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> ancestorsByGroup)
Returns an unsorted list of groups that the user is a member of, either directly or indirectly. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
NestingHelper
public NestingHelper()
cacheGroupRelationships
public static java.util.List<java.lang.String> cacheGroupRelationships(SOAPNestableGroup[] allGroups,
BasicCache cache)
- Takes a list of all groups, along with their direct children, and returns a list of group names. Also caches
group relationship data that's needed for other calls, such as
GroupMembershipManager.getMemberships(String).
- Parameters:
allGroups - The result of a call to SecurityServerClient.findAllGroupRelationships().cache - The GroupCache to add the name & relationship data to.
- Returns:
- list of all group names
getAllGroupsForUser
public static java.util.List<java.lang.String> getAllGroupsForUser(java.util.List<java.lang.String> directGroups,
java.util.Map<java.lang.String,java.util.Set<java.lang.String>> ancestorsByGroup)
- Returns an unsorted list of groups that the user is a member of, either directly or indirectly.
- Parameters:
directGroups - list of groups that the user is a direct member ofancestorsByGroup - map of ancestor group names by group name
- Returns:
- unsorted list of groups that the user is a member of
Copyright © 2010 Atlassian. All Rights Reserved.