Пример #1
0
  public void reconnect() throws LDAPException {
    final String host = getHost();
    final int port = getPort();
    final String dn = authDN;
    final String pw = authPW;

    conn.close();

    if ((dn == null) || (pw == null)) {
      connect(host, port);
    } else {
      connect(host, port, dn, pw);
    }
  }
Пример #2
0
  public void connect(
      final int version,
      final String host,
      final int port,
      final String dn,
      final String password,
      final LDAPConstraints constraints)
      throws LDAPException {
    connect(host, port);

    try {
      if ((dn != null) && (password != null)) {
        bind(version, dn, password, constraints);
      }
    } catch (LDAPException le) {
      conn.close();
      throw le;
    }
  }
Пример #3
0
  @Override()
  protected void finalize() throws Throwable {
    conn.close();

    super.finalize();
  }
Пример #4
0
 public void disconnect() throws LDAPException {
   conn.close();
   authDN = null;
   authPW = null;
 }