本文整理了Java中com.unboundid.ldap.sdk.LDAPConnection.setSocketFactory()
方法的一些代码示例,展示了LDAPConnection.setSocketFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LDAPConnection.setSocketFactory()
方法的具体详情如下:
包路径:com.unboundid.ldap.sdk.LDAPConnection
类名称: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();
}
内容来源于网络,如有侵权,请联系作者删除!