class AmbariLdapDataPopulator {

  public LdapBatchDto synchronizeAllLdapGroups(LdapBatchDto batchInfo) throws AmbariException {
    LOG.trace("Synchronize All LDAP groups...");
    Set<LdapGroupDto> externalLdapGroupInfo = getExternalLdapGroupInfo();

    final Map<String, Group> internalGroupsMap = getInternalGroups();
    final Map<String, User> internalUsersMap = getInternalUsers();

    for (LdapGroupDto groupDto : externalLdapGroupInfo) {
      addLdapGroup(batchInfo, internalGroupsMap, groupDto);
      refreshGroupMembers(batchInfo, groupDto, internalUsersMap, internalGroupsMap, null, false);
    }
    for (Entry<String, Group> internalGroup : internalGroupsMap.entrySet()) {
      if (internalGroup.getValue().isLdapGroup()) {
        LdapGroupDto groupDto = new LdapGroupDto();
        groupDto.setGroupName(internalGroup.getValue().getGroupName());
        batchInfo.getGroupsToBeRemoved().add(groupDto);
      }
    }

    return batchInfo;
  }

  @Inject public  AmbariLdapDataPopulator(Provider<AmbariLdapConfiguration> configurationProvider, Users users);

}