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.
|
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(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 LdapException
bindConnection
in interface LdapConnectionFactory
connection
- The connection to bind with the configuration credentials.LdapException
- If the bind fails.public LdapConnection configureConnection(LdapConnection connection)
configureConnection
in interface LdapConnectionFactory
connection
- The connection to configurepublic LdapApiService getLdapApiService()
getLdapApiService
in interface LdapConnectionFactory
public LdapConnection newLdapConnection() throws LdapException
newLdapConnection
in interface LdapConnectionFactory
LdapException
- If the new connection couldn't be establishedpublic LdapConnection newUnboundLdapConnection()
newUnboundLdapConnection
in interface LdapConnectionFactory
public void setLdapApiService(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 © 2003–2020 The Apache Software Foundation. All rights reserved.