public Set<URI> checkForActiveUserMappingUsingGroup(String domain,String label){
  Set<URI> tenantsUsingUserGroup=null;
  Map<URI,List<UserMapping>> mappings=getAllUserMappingsForDomain(domain);
  if (CollectionUtils.isEmpty(mappings)) {
    _log.debug("Could not find any user mappings from domain {}",domain);
    return tenantsUsingUserGroup;
  }
  tenantsUsingUserGroup=new HashSet<URI>();
  for (  Map.Entry<URI,List<BasePermissionsHelper.UserMapping>> entry : mappings.entrySet()) {
    if (CollectionUtils.isEmpty(entry.getValue())) {
      continue;
    }
    for (    UserMapping userMapping : entry.getValue()) {
      if (userMapping == null || CollectionUtils.isEmpty(userMapping.getGroups())) {
        continue;
      }
      for (      String group : userMapping.getGroups()) {
        if (StringUtils.isNotBlank(group) && group.equalsIgnoreCase(label)) {
          tenantsUsingUserGroup.add(entry.getKey());
        }
      }
    }
  }
  return tenantsUsingUserGroup;
}

public Set < URI > checkForActiveUserMappingUsingGroup ( String domain , String label ) { Set < URI > tenantsUsingUserGroup = null ; Map < URI , List < UserMapping > > mappings = getAllUserMappingsForDomain ( domain ) ; if ( CollectionUtils . isEmpty ( mappings ) ) { _log . debug ( "Could not find any user mappings from domain {}" , domain ) ; return tenantsUsingUserGroup ; } tenantsUsingUserGroup = new HashSet < URI > ( ) ; for ( Map . Entry < URI , List < BasePermissionsHelper . UserMapping > > entry : mappings . entrySet ( ) ) { if ( CollectionUtils . isEmpty ( entry . getValue ( ) ) ) { continue ; } for ( UserMapping userMapping : entry . getValue ( ) ) { if ( userMapping == null || CollectionUtils . isEmpty ( userMapping . getGroups ( ) ) ) { continue ; } for ( String group : userMapping . getGroups ( ) ) { if ( StringUtils . isNotBlank ( group ) && group . equalsIgnoreCase ( label ) ) { tenantsUsingUserGroup . add ( entry . getKey ( ) ) ; } } } } return tenantsUsingUserGroup ; }
check if any active user mapping for the domain that uses the user group .
