private LdapBatchDto syncLdap(LdapSyncEventEntity event) throws AmbariException {
    LdapSyncRequest userRequest  = null;
    LdapSyncRequest groupRequest = null;

    for (LdapSyncSpecEntity spec : event.getSpecs()) {
      switch (spec.getPrincipalType()) {
        case USERS:
          userRequest = getLdapRequest(userRequest, spec);
          break;
        case GROUPS:
          groupRequest = getLdapRequest(groupRequest, spec);
          break;
      }
    }
    return getManagementController().synchronizeLdapUsersAndGroups(userRequest, groupRequest);
  }
Sync the users and groups specified in the given sync event with ldap.

@param event  the sync event

@return the results of the sync

@throws AmbariException if the sync could not be completed
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/LdapSyncEventResourceProvider.java