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

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

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

LDAPConnection.setSocketFactory介绍

[英]Specifies the socket factory to use to create the socket for subsequent connection attempts. This will not impact any established connection.
[中]指定用于为后续连接尝试创建套接字的套接字工厂。这不会影响任何已建立的连接。

代码示例

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

/**
 * Sets the socket factory for this LDAP connection.
 *
 * @param  socketFactory  The socket factory for this LDAP connection.
 */
public void setSocketFactory(final LDAPSocketFactory socketFactory)
{
 this.socketFactory = socketFactory;
 if (socketFactory == null)
 {
  conn.setSocketFactory(null);
 }
 else
 {
  conn.setSocketFactory(new LDAPToJavaSocketFactory(socketFactory));
 }
}

代码示例来源:origin: apiman/apiman

private static LDAPConnection getConnection(Map<LdapConfigBean, LDAPConnectionPool> map,
    SSLSocketFactory socketFactory, LdapConfigBean config) throws LDAPException {
  if (!map.containsKey(config)) {
    LDAPConnection template = new LDAPConnection(config.getHost(), config.getPort());
    if (socketFactory != null)
      template.setSocketFactory(socketFactory);
    map.put(config, new LDAPConnectionPool(template, MAX_CONNECTIONS_PER_POOL));
  }
  return map.get(config).getConnection();
}

代码示例来源:origin: io.apiman/apiman-gateway-engine-core

private static LDAPConnection getConnection(Map<LdapConfigBean, LDAPConnectionPool> map,
    SSLSocketFactory socketFactory, LdapConfigBean config) throws LDAPException {
  if (!map.containsKey(config)) {
    LDAPConnection template = new LDAPConnection(config.getHost(), config.getPort());
    if (socketFactory != null)
      template.setSocketFactory(socketFactory);
    map.put(config, new LDAPConnectionPool(template, MAX_CONNECTIONS_PER_POOL));
  }
  return map.get(config).getConnection();
}

相关文章

LDAPConnection类方法