com.atlassian.crowd.util
Class NestingHelper

java.lang.Object
  extended by com.atlassian.crowd.util.NestingHelper

public class NestingHelper
extends 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.


Constructor Summary
NestingHelper()
           
 
Method Summary
static List<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 List<String> getAllGroupsForUser(List<String> directGroups, Map<String,Set<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
 

Constructor Detail

NestingHelper

public NestingHelper()
Method Detail

cacheGroupRelationships

public static List<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 List<String> getAllGroupsForUser(List<String> directGroups,
                                               Map<String,Set<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 of
ancestorsByGroup - map of ancestor group names by group name
Returns:
unsorted list of groups that the user is a member of


Copyright © 2013 Atlassian. All Rights Reserved.