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

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

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

LDAPConnection.connect介绍

[英]Establishes an unauthenticated connection to the directory server using the provided information. If the connection is already established, then it will be closed and re-established.

If this method is invoked while any operations are in progress on this connection, then the directory server may or may not abort processing for those operations, depending on the type of operation and how far along the server has already gotten while processing that operation. It is recommended that all active operations be abandoned, canceled, or allowed to complete before attempting to re-establish an active connection.
[中]使用提供的信息建立到目录服务器的未经验证的连接。如果已建立连接,则将关闭并重新建立连接。
如果在此连接上正在进行任何操作时调用此方法,则目录服务器可能会也可能不会中止这些操作的处理,具体取决于操作类型以及服务器在处理该操作时已经走了多远。建议在尝试重新建立活动连接之前放弃、取消或允许完成所有活动操作。

代码示例

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

/**
 * Creates a new, unauthenticated LDAP connection that is established to the
 * specified server.
 *
 * @param  socketFactory      The socket factory to use when establishing
 *                            connections.  If it is {@code null}, then a
 *                            default socket factory will be used.
 * @param  connectionOptions  The set of connection options to use for this
 *                            connection.  If it is {@code null}, then a
 *                            default set of options will be used.
 * @param  host               The string representation of the address of the
 *                            server to which the connection should be
 *                            established.  It may be a resolvable name or an
 *                            IP address.  It must not be {@code null}.
 * @param  port               The port number of the server to which the
 *                            connection should be established.  It should be
 *                            a value between 1 and 65535, inclusive.
 *
 * @throws  LDAPException  If a problem occurs while attempting to connect to
 *                         the specified server.
 */
public LDAPConnection(final SocketFactory socketFactory,
           final LDAPConnectionOptions connectionOptions,
           final String host, final int port)
    throws LDAPException
{
 this(socketFactory, connectionOptions);
 connect(host, port);
}

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

/**
 * Creates a new, unauthenticated LDAP connection that is established to the
 * specified server.
 *
 * @param  socketFactory      The socket factory to use when establishing
 *                            connections.  If it is {@code null}, then a
 *                            default socket factory will be used.
 * @param  connectionOptions  The set of connection options to use for this
 *                            connection.  If it is {@code null}, then a
 *                            default set of options will be used.
 * @param  host               The string representation of the address of the
 *                            server to which the connection should be
 *                            established.  It may be a resolvable name or an
 *                            IP address.  It must not be {@code null}.
 * @param  port               The port number of the server to which the
 *                            connection should be established.  It should be
 *                            a value between 1 and 65535, inclusive.
 *
 * @throws  LDAPException  If a problem occurs while attempting to connect to
 *                         the specified server.
 */
public LDAPConnection(final SocketFactory socketFactory,
           final LDAPConnectionOptions connectionOptions,
           final String host, final int port)
    throws LDAPException
{
 this(socketFactory, connectionOptions);
 connect(host, port);
}

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

throws LDAPException
connect(inetAddress.getHostName(), inetAddress, port, timeout);

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

throws LDAPException
connect(inetAddress.getHostName(), inetAddress, port, timeout);

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

/**
 * Establishes an unauthenticated connection to the directory server using the
 * provided information.  If the connection is already established, then it
 * will be closed and re-established.
 * <BR><BR>
 * If this method is invoked while any operations are in progress on this
 * connection, then the directory server may or may not abort processing for
 * those operations, depending on the type of operation and how far along the
 * server has already gotten while processing that operation.  It is
 * recommended that all active operations be abandoned, canceled, or allowed
 * to complete before attempting to re-establish an active connection.
 *
 * @param  host  The string representation of the address of the server to
 *               which the connection should be established.  It may be a
 *               resolvable name or an IP address.  It must not be
 *               {@code null}.
 * @param  port  The port number of the server to which the connection should
 *               be established.  It should be a value between 1 and 65535,
 *               inclusive.
 *
 * @throws  LDAPException  If an error occurs while attempting to establish
 *                         the connection.
 */
public void connect(final String host, final int port)
    throws LDAPException
{
 connect(host, port, connectionOptions.getConnectTimeoutMillis());
}

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

connection.connect(address, port);

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

/**
 * Establishes an unauthenticated connection to the directory server using the
 * provided information.  If the connection is already established, then it
 * will be closed and re-established.
 * <BR><BR>
 * If this method is invoked while any operations are in progress on this
 * connection, then the directory server may or may not abort processing for
 * those operations, depending on the type of operation and how far along the
 * server has already gotten while processing that operation.  It is
 * recommended that all active operations be abandoned, canceled, or allowed
 * to complete before attempting to re-establish an active connection.
 *
 * @param  host  The string representation of the address of the server to
 *               which the connection should be established.  It may be a
 *               resolvable name or an IP address.  It must not be
 *               {@code null}.
 * @param  port  The port number of the server to which the connection should
 *               be established.  It should be a value between 1 and 65535,
 *               inclusive.
 *
 * @throws  LDAPException  If an error occurs while attempting to establish
 *                         the connection.
 */
@ThreadSafety(level=ThreadSafetyLevel.METHOD_NOT_THREADSAFE)
public void connect(final String host, final int port)
    throws LDAPException
{
 connect(host, port, connectionOptions.getConnectTimeoutMillis());
}

代码示例来源: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: tmobile/pacbot

log.debug(String.format("trial number -> %s" , numberOfTries));
    ldapConnection = new LDAPConnection(connectionOptions);
    ldapConnection.connect(ntDomain, ntPort,connectTimeout);
    break;
}catch(LDAPException exception) {

代码示例来源:origin: com.btmatthews.ldapunit/ldapunit

final long startTime = System.currentTimeMillis();
try {
  connection.connect(hostname, port, timeout);
  break;
} catch (final LDAPException e) {

代码示例来源:origin: com.gitblit.fathom/fathom-security-ldap

conn.connect(ldapHost, ldapPort);

代码示例来源:origin: gitblit/fathom

conn.connect(ldapHost, ldapPort);

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

connect(host, inetAddress, port, timeout);

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

connect(host, inetAddress, port, timeout);

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

try
 conn.connect(hostname, a, port,
    connectionOptions.getConnectTimeoutMillis());
 if (healthCheck != null)

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

connect(reconnectAddress, reconnectPort);

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

connect(reconnectAddress, reconnectPort);

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

ldapConnection.connect(
  ldapConfiguration.getServer(), ldapConfiguration.getPort());
bindResult = ldapConnection.bind(

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

conn.connect(hostname, port);

相关文章

LDAPConnection类方法