Package com.google.enterprise.connector.sharepoint.generated.userprofilechangeservice

Examples of com.google.enterprise.connector.sharepoint.generated.userprofilechangeservice.UserProfileChangeDataContainer


    changeQuery.setSingleValueProperty(true);
    changeQuery.setMultiValueProperty(true);
    changeQuery.setColleague(true);

    final String changeToken = checkpoint.getUserProfileChangeToken();
    final UserProfileChangeDataContainer changeContainer =
        Util.makeWSRequest(sharepointClientContext, changeWS,
            new Util.RequestExecutor<UserProfileChangeDataContainer>() {
          public UserProfileChangeDataContainer onRequest(final BaseWS ws)
              throws Throwable {
            return ((UserProfileChangeWS) ws).getChanges(changeToken,
                changeQuery);
          }

          public void onError(final Throwable e) {
            LOGGER.log(Level.WARNING, "Call to getChanges failed.", e);
          }
        });

    if (changeContainer != null) {
      UserProfileChangeData[] changes = changeContainer.getChanges();
      if (changes != null && changes.length > 0) {
        for(UserProfileChangeData change : changes) {
          String userAccountName = change.getUserAccountName();
          if (Strings.isNullOrEmpty(userAccountName)) {
            continue;
          }
          for(String changeType : change.getChangeType()) {
            LOGGER.log(Level.INFO,
                "User Profile Change Type Recevied = "+ changeType);
            if (SPConstants.DELETE.equalsIgnoreCase(changeType)) {
              LOGGER.log(Level.INFO,"User Profile Deleted for user = "
                  + change.getUserAccountName());
              updatedProfiles.put(userAccountName, ActionType.DELETE);
            } else {
              updatedProfiles.put(userAccountName, ActionType.ADD);
            }
          }
        }
      }
      LOGGER.log(Level.INFO, "User Profile Change Token Recevied = "
          + changeContainer.getChangeToken());
      if (changeContainer.isHasExceededCountLimit()) {
        checkpoint.setUserProfileChangeToken(
            changeContainer.getChangeToken());
      } else {
        try {
          checkpoint.setUserProfileChangeToken(getCurrentChangeToken());
        } catch (final Exception e) {
          LOGGER.log(Level.WARNING,
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.generated.userprofilechangeservice.UserProfileChangeDataContainer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.