Package com.google.enterprise.connector.sharepoint.ldap.UserGroupsService

Examples of com.google.enterprise.connector.sharepoint.ldap.UserGroupsService.LdapConnection


   */
  @VisibleForTesting
  public UserGroupsService(LdapConnectionSettings ldapConnectionSettings,
      int cacheSize, long refreshInterval, boolean enableLUGCache) {
    this.ldapConnectionSettings = ldapConnectionSettings;
    ldapConnection = new LdapConnection(ldapConnectionSettings);
    this.sharepointClientContext = null;
    if (enableLUGCache) {
      this.lugCacheStore = new UserGroupsCache<Object,
          ConcurrentHashMap<String, Set<Principal>>>(
              refreshInterval, cacheSize);
View Full Code Here


  private UserGroupsService(LdapConnectionSettings ldapConnectionSettings,
      SharepointClientContext inSharepointClientContext) {
    if (!Strings.isNullOrEmpty(ldapConnectionSettings.getHostname())) {
      this.ldapConnectionSettings = ldapConnectionSettings;
      ldapConnection = new LdapConnection(ldapConnectionSettings);
    } else {
      LOGGER.warning("Not attempting to create LDAP context, because LDAP host name is empty or null.");
    }

    this.sharepointClientContext = inSharepointClientContext;
View Full Code Here

   *          {@link LdapConnection}
   */
  public void setLdapConnectionSettings(
      LdapConnectionSettings ldapConnectionSettings) {
    this.ldapConnectionSettings = ldapConnectionSettings;
    ldapConnection = new LdapConnection(ldapConnectionSettings);
  }
View Full Code Here

    Set<String> ldapGroups = new HashSet<String>();
    LOGGER.info("Querying LDAP directory server to fetch all direct groups "
        + "for the search user: " + userName);
    // fix me by creating a LDAP connection poll instead of creating context
    // object on demand.
    LdapContext context = new LdapConnection(
        sharepointClientContext.getLdapConnectionSettings()).createContext();
    Set<String> directGroups =
        getDirectGroupsForTheSearchUser(userName, context);
    for (String groupName : directGroups) {
      getAllParentGroups(groupName, ldapGroups, context);
View Full Code Here

              this.searchBase, authType, this.username, this.password,
              this.domain);
          LOGGER
          .config("Created LDAP connection settings object to obtain LDAP context "
              + ldapConnectionSettings);
          LdapConnection ldapConnection = new LdapConnection(settings);
          if (ldapConnection.getLdapContext() == null) {
            Map<LdapConnectionError, String> errors = ldapConnection
                .getErrors();
            Iterator<Entry<LdapConnectionError, String>> iterator = errors
                .entrySet().iterator();
            StringBuffer errorMessage = new StringBuffer();
            errorMessage.append(rb
                .getString(SPConstants.LDAP_CONNECTVITY_ERROR));
            while (iterator.hasNext()) {
              Map.Entry<LdapConnectionError, String> entry = iterator.next();
              errorMessage.append(SPConstants.SPACE + entry.getValue());
            }
            ed.set(SPConstants.LDAP_SERVER_HOST_ADDRESS,
                errorMessage.toString());
            return false;
          }

          if (ldapConnection.getLdapContext() == null) {
            LOGGER
            .log(Level.WARNING,
                "Couldn't obtain context object to query LDAP (AD) directory server.");
            ed.set(SPConstants.LDAP_SERVER_HOST_ADDRESS,
                rb.getString(SPConstants.LDAP_CONNECTVITY_ERROR));
            return false;
          }

          if (!checkForSearchBase(ldapConnection.getLdapContext(), searchBase,
              ed)) {
            return false;
          }
          LOGGER
          .log(Level.CONFIG,
View Full Code Here

   * @throws java.lang.Exception
   */
  @Before
  public void setUp() throws Exception {
    this.ldapConnectionSettings = TestConfiguration.getLdapConnetionSettings();
    ldapConnection = new LdapConnection(ldapConnectionSettings);
    sharepointClientContext = new SharepointClientContext(
        clientFactory, TestConfiguration.sharepointUrl, TestConfiguration.domain,
        TestConfiguration.kdcserver, TestConfiguration.username,
        TestConfiguration.password, TestConfiguration.googleConnectorWorkDir,
        TestConfiguration.googleGlobalNamespace,
View Full Code Here

        AuthType.SIMPLE,
        TestConfiguration.username,
        TestConfiguration.password + "invalidatepassword",
        TestConfiguration.ldapDomainName);
    // we are testing if NPE is thrown, no asserts needed
    LdapConnection l = new LdapConnection(lcs);
  }
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.sharepoint.ldap.UserGroupsService.LdapConnection

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.