public class DefaultLdapConnectionFactory extends Object implements LdapConnectionFactory
LdapApiService as well as the standard
LdapConnectionConfig.| Constructor and Description |
|---|
DefaultLdapConnectionFactory(LdapConnectionConfig config)
Creates a new instance of DefaultLdapConnectionFactory.
|
| Modifier and Type | Method and Description |
|---|---|
LdapConnection |
bindConnection(LdapConnection connection)
Issues a bind request on the supplied connection using the name and
credentials from the LdapConnectionConfg supplied to the constructor.
|
LdapConnection |
configureConnection(LdapConnection connection)
Applies the following configuration settings from the
LdapConnectionConfig to the supplied connection:
timeOut
binaryAttributeDetector
This method is called by newLdapConnection, so there is no need to call
this on a newly created connection.
|
org.apache.directory.api.ldap.codec.api.LdapApiService |
getLdapApiService()
Returns the LdapApiService instance used by this factory.
|
LdapConnection |
newLdapConnection()
Returns a newly created, configured, and authenticated connection.
|
LdapConnection |
newUnboundLdapConnection()
Returns a newly created connection, that has not been bound (bind) that
otherwise respects LdapConnectionConfig supplied to the constructor.
|
void |
setLdapApiService(org.apache.directory.api.ldap.codec.api.LdapApiService apiService)
Sets the LdapApiService (codec) to be used by the connections created
by this factory.
|
void |
setTimeOut(long timeout)
Sets the timeout that will be used by all connections created by this
factory.
|
public DefaultLdapConnectionFactory(LdapConnectionConfig config)
config - The connection config.public LdapConnection bindConnection(LdapConnection connection) throws org.apache.directory.api.ldap.model.exception.LdapException
LdapConnectionFactorybindConnection in interface LdapConnectionFactoryconnection - The connection to bind with the configuration credentials.org.apache.directory.api.ldap.model.exception.LdapException - If the bind fails.public LdapConnection configureConnection(LdapConnection connection)
LdapConnectionFactoryconfigureConnection in interface LdapConnectionFactoryconnection - The connection to configurepublic org.apache.directory.api.ldap.codec.api.LdapApiService getLdapApiService()
LdapConnectionFactorygetLdapApiService in interface LdapConnectionFactorypublic LdapConnection newLdapConnection() throws org.apache.directory.api.ldap.model.exception.LdapException
LdapConnectionFactorynewLdapConnection in interface LdapConnectionFactoryorg.apache.directory.api.ldap.model.exception.LdapExceptionpublic LdapConnection newUnboundLdapConnection()
LdapConnectionFactorynewUnboundLdapConnection in interface LdapConnectionFactorypublic void setLdapApiService(org.apache.directory.api.ldap.codec.api.LdapApiService apiService)
apiService - The codec to used by connections created by this
factorypublic void setTimeOut(long timeout)
timeout - The timeout in millis.LdapConnection.setTimeOut(long)Copyright © 2009–2016 The Apache Software Foundation. All rights reserved.