public class LdapConnectionFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean<com.unboundid.ldap.sdk.LDAPConnection>, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.InitializingBean
LDAPConnection.| Constructor and Description |
|---|
LdapConnectionFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
com.unboundid.ldap.sdk.LDAPConnection |
getObject() |
Class<com.unboundid.ldap.sdk.LDAPConnection> |
getObjectType() |
boolean |
isSingleton() |
void |
setBindDN(String bindDN)
Note: When bindDN and password is not provided, then anonymous binding
will be used.
|
void |
setHost(String host) |
void |
setPassword(String password)
Note: When bindDN and password is not provided, then anonymous binding
will be used.
|
void |
setPort(int port) |
void |
setSsl(boolean ssl) |
void |
setSslTrustAll(boolean sslTrustAll)
This enables SSL trust manager which will blindly trust any
certificate that is presented to it.
|
void |
setSslTrustManager(TrustManager sslTrustManager) |
void |
setUrl(String url)
Specifies the LDAP server URL with scheme, host and optionally port.
|
public com.unboundid.ldap.sdk.LDAPConnection getObject()
throws GeneralSecurityException,
com.unboundid.ldap.sdk.LDAPException
getObject in interface org.springframework.beans.factory.FactoryBean<com.unboundid.ldap.sdk.LDAPConnection>GeneralSecurityExceptioncom.unboundid.ldap.sdk.LDAPExceptionpublic Class<com.unboundid.ldap.sdk.LDAPConnection> getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<com.unboundid.ldap.sdk.LDAPConnection>public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<com.unboundid.ldap.sdk.LDAPConnection>public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanpublic void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanpublic void setUrl(String url) throws com.unboundid.ldap.sdk.LDAPException
url - The URL of the LDAP server. It must not be null or empty.com.unboundid.ldap.sdk.LDAPException - If the provided URL string cannot be parsed as an
LDAP URL.public void setHost(String host)
host - The address of the server to which the connection should be
established. It must not be null or empty.public void setPort(int port)
port - The port number of the server to which the connection should
be established. It should be a value between 1 and 65535.
The default port is 389 or 636 for TLS/SSL.public void setSsl(boolean ssl)
ssl - Connect via TLS/SSL? Default is false.public void setBindDN(String bindDN)
bindDN - The DN to use to authenticate to the directory server.public void setPassword(String password)
password - The password to use to authenticate to the directory
server.public void setSslTrustAll(boolean sslTrustAll)
DO NOT USE USE THIS IN PRODUCTION!
sslTrustAll - Trust blindly any certificate?TrustAllTrustManagerpublic void setSslTrustManager(TrustManager sslTrustManager)
sslTrustManager - The trust manager to use to determine whether to
trust server certificates presented to the client.
It may be null if the default set of trust
managers should be used.Copyright © 2013. All rights reserved.