com.unboundid.ldap.sdk.LDAPConnection.isConnected()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(4.9k)|赞(0)|评价(0)|浏览(127)

本文整理了Java中com.unboundid.ldap.sdk.LDAPConnection.isConnected()方法的一些代码示例,展示了LDAPConnection.isConnected()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LDAPConnection.isConnected()方法的具体详情如下:
包路径:com.unboundid.ldap.sdk.LDAPConnection
类名称:LDAPConnection
方法名:isConnected

LDAPConnection.isConnected介绍

[英]Indicates whether this connection is currently established.
[中]指示当前是否已建立此连接。

代码示例

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

/**
 * Indicates whether this connection is currently established.
 *
 * @return  {@code true} if this connection is currently established, or
 *          {@code false} if not.
 */
public boolean isConnected()
{
 return conn.isConnected();
}

代码示例来源:origin: tmobile/pacbot

/**
 * fall back to connect using IP itself
 * @return
 */
private LDAPConnection tryGettingConnectionWithDirectIP() throws LDAPException {
  LDAPConnection ldapConnection = new LDAPConnection();
  try{
  hostIps.forEach(
        ip->{
          try{
              ldapConnection.connect(ip, ntPort,connectTimeout);
              throw new BreakLoopException();
          }catch(LDAPException exception){
            log.debug("unable to connect using" + ip + ", trying next ip");
          }
        }
      );
  }catch(BreakLoopException br){
    log.info("got connected using IP");
  }
  if(ldapConnection.isConnected())
    return ldapConnection;
  else{
    throw new LDAPException(ResultCode.CONNECT_ERROR,"unable to connect using IP");
  }
}

代码示例来源:origin: com.redhat.lightblue.rest/lightblue-rest-auth

@Override
  public RolesProviderHealth checkHealth() {
    boolean isHealthy = true;
    Map<String, Object> details = new LinkedHashMap<>();
    try {
      LDAPConnection ldapConnection = connectionPool.getConnection();
      if (!ldapConnection.isConnected()) {
        isHealthy = false;
      }
      connectionPool.getHealthCheck().ensureConnectionValidForContinuedUse(ldapConnection);
    } catch (LDAPException e) {
      details.put("exception", e);
      isHealthy = false;
    }

    details.put("bindDn", ldapConfiguration.getBindDn());
    details.put("connectionTimeoutMS", ldapConfiguration.getConnectionTimeoutMS());
    details.put("poolMaxConnectionAgeMS", ldapConfiguration.getPoolMaxConnectionAgeMS());
    details.put("ppolSize", ldapConfiguration.getPoolSize());
    details.put("port", ldapConfiguration.getPort());
    details.put("responseTimeInMS", ldapConfiguration.getResponseTimeoutMS());
    details.put("server", ldapConfiguration.getServer());
    details.put("trustStore", ldapConfiguration.getTrustStore());
    details.put("useSSL", ldapConfiguration.getUseSSL());

    return new RolesProviderHealth(isHealthy, details);
  }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

if (! conn.isConnected())

代码示例来源:origin: gsvigruha/cosyan

public AuthToken auth(String username, String password, String token) throws AuthException {
  String ldapHost = config.get(Config.LDAP_HOST);
  try {
   LDAPConnection connection = new LDAPConnection(
     ldapHost,
     Integer.valueOf(config.get(Config.LDAP_PORT)),
     username + "@" + ldapHost,
     password);

   if (connection.isConnected()) {
    return new LDAPToken(connection, username, token);
   } else {
    connection.close();
    throw new AuthException("Connection not connected.");
   }
  } catch (LDAPException e) {
   throw new AuthException(e.getExceptionMessage());
  }
 }
}

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

if ((conn == null) || (! conn.isConnected()))

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

startTLSRequest = null;
if (isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

(! connectionOptions.useSynchronousMode()) && isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

Collections.unmodifiableSet(EnumSet.noneOf(OperationType.class)));
if (! connection.isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

(! connectionOptions.useSynchronousMode()) && isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

startTLSRequest = null;
if (isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

new LinkedBlockingQueue<LDAPConnection>(numConnections);
if (! connection.isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

new LinkedBlockingQueue<LDAPConnection>(numConnections);
if (! connection.isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

if (conn != null)
 if (conn.isConnected())
  else if (conn.isConnected())

代码示例来源:origin: org.esbtools.auth/cert-ldap-login-module-common

BindResult bindResult = null;
if (!ldapConnection.isConnected()) {
  ldapConnection.connect(
    ldapConfiguration.getServer(), ldapConfiguration.getPort());

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

if (conn != null)
 if (conn.isConnected())
  else if (conn.isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

if (! conn.isConnected())

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

if (isConnected() && (! unbindRequestSent))

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-minimal-edition

if (isConnected() && (! unbindRequestSent))

代码示例来源:origin: com.unboundid/unboundid-ldapsdk-commercial-edition

if (! conn.isConnected())

相关文章

LDAPConnection类方法