Package org.sonatype.security.ldap.dao

Examples of org.sonatype.security.ldap.dao.LdapDAOException


    return this.backupLdapManagerConnector;
  }

  private LdapConnector getBackupConnector() throws LdapDAOException {
    if (this.backupLdapManagerConnector == null) {
      throw new LdapDAOException("Waiting for connection retry timeout.");
    }

    return this.backupLdapManagerConnector;
  }
View Full Code Here


      throws LdapDAOException
  {
    DefaultLdapContextFactory defaultLdapContextFactory = new DefaultLdapContextFactory();

    if (ldapServer == null) {
      throw new LdapDAOException("Ldap connection is not configured.");
    }

    CConnectionInfo connInfo = ldapServer.getConnectionInfo();

    String url;
    try {
      if (useBackupUrl) {
        url = new LdapURL(connInfo.getBackupMirrorProtocol(), connInfo.getBackupMirrorHost(), connInfo
            .getBackupMirrorPort(), connInfo.getSearchBase()).toString();
      }
      else {
        url = new LdapURL(connInfo.getProtocol(), connInfo.getHost(), connInfo.getPort(), connInfo
            .getSearchBase()).toString();
      }
    }
    catch (MalformedURLException e) {
      // log an error, because the user could still log in and fix the config.
      logger.error("LDAP Configuration is Invalid.");
      throw new LdapDAOException("Invalid LDAP URL: " + e.getMessage());
    }

    defaultLdapContextFactory.setUsePooling(true);
    defaultLdapContextFactory.setUrl(url);
    defaultLdapContextFactory.setSystemUsername(connInfo.getSystemUsername());
View Full Code Here

  }

  public LdapUser getUser(String userId)
      throws NoSuchLdapUserException, LdapDAOException
  {
    LdapDAOException serverError = null;

    for (LdapConnector connector : this.getLdapConnectors()) {
      try {
        return connector.getUser(userId);
      }
      catch (NoSuchLdapUserException e) {
        this.log.debug("Failed to find user: " + userId, e);
      }
      catch (LdapDAOException e) {
        this.log.debug("Failed to find user: " + userId, e);
        serverError = e;
      }
    }

    if (serverError == null) {
      // NXCM-4165: all configured servers are reachable, hard evidence the user does not exist.
      throw new NoSuchLdapUserException(userId);
    }
    else {
      // NXCM-4165: report 'upstream' when a server was down, we need to trigger UserNotFoundTransientException
      //            because we cannot be sure it did not have the user
      throw new LdapDAOException("Failed to find user: " + userId + ", we could not connect to all servers.",
          serverError);
    }
  }
View Full Code Here

      return this.getUserRoles(userId, context, this
          .getLdapAuthConfiguration());
    }
    catch (NamingException e) {
      String message = "Failed to retrieve ldap user roles for user" + userId;
      throw new LdapDAOException(message, e);
    }
    finally {
      this.closeContext(context);
    }
  }
View Full Code Here

      return users;
    }
    catch (NamingException e) {
      String message = "Failed to retrieve ldap information for users.";
      throw new LdapDAOException(message, e);
    }
    finally {
      this.closeContext(context);
    }
  }
View Full Code Here

      return ldapUser;
    }
    catch (NamingException e) {
      String message = "Failed to retrieve ldap information for users.";
      throw new LdapDAOException(message, e);
    }
    finally {
      this.closeContext(context);
    }
  }
View Full Code Here

      return users;
    }
    catch (NamingException e) {
      String message = "Failed to retrieve ldap information for users.";
      throw new LdapDAOException(message, e);
    }
    finally {
      this.closeContext(context);
    }
  }
View Full Code Here

      return results;
    }
    catch (NamingException e) {
      String message = "Failed to retrieve ldap information for users.";
      throw new LdapDAOException(message, e);
    }
    finally {
      this.closeContext(context);
    }
  }
View Full Code Here

      return this.ldapGroupManager.getGroupName(groupId, context, conf);
    }
    catch (NamingException e) {
      String message = "Failed to retrieve ldap information for users.";
      throw new LdapDAOException(message, e);
    }
    finally {
      this.closeContext(context);
    }
  }
View Full Code Here

  private void checkStatus()
      throws LdapDAOException
  {
    if (disabled) {
      throw new LdapDAOException("MockLdapConnector is disabled.");
    }
  }
View Full Code Here

TOP

Related Classes of org.sonatype.security.ldap.dao.LdapDAOException

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.