Package org.ldaptive
Class DefaultConnectionFactory
java.lang.Object
org.ldaptive.DefaultConnectionFactory
- All Implemented Interfaces:
ConnectionFactory
- Direct Known Subclasses:
SingleConnectionFactory
Creates connections for performing ldap operations.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ConnectionConfig
Connection configuration used by this factory.protected final org.slf4j.Logger
Logger for this class.private Transport
Transport used by this factory. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.DefaultConnectionFactory
(String ldapUrl) Creates a new default connection factory.DefaultConnectionFactory
(String ldapUrl, Transport t) Creates a new default connection factory.Creates a new default connection factory.Creates a new default connection factory.Creates a new default connection factory. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder for this class.Creates a builder for this class.void
close()
Free any resources associated with this factory.Creates a new connection.Returns the connection configuration used to create connections.Returns the ldap transport.void
Sets the connection config.toString()
-
Field Details
-
logger
protected final org.slf4j.Logger loggerLogger for this class. -
transport
Transport used by this factory. -
config
Connection configuration used by this factory.
-
-
Constructor Details
-
DefaultConnectionFactory
public DefaultConnectionFactory()Default constructor. -
DefaultConnectionFactory
Creates a new default connection factory. Be sure to invokeclose()
if the supplied transport has resources to cleanup.- Parameters:
t
- transport
-
DefaultConnectionFactory
Creates a new default connection factory.- Parameters:
ldapUrl
- to connect to
-
DefaultConnectionFactory
Creates a new default connection factory. Be sure to invokeclose()
if the supplied transport has resources to cleanup.- Parameters:
ldapUrl
- to connect tot
- transport
-
DefaultConnectionFactory
Creates a new default connection factory.- Parameters:
cc
- connection configuration
-
DefaultConnectionFactory
Creates a new default connection factory. Be sure to invokeclose()
if the supplied transport has resources to cleanup.- Parameters:
cc
- connection configurationt
- transport
-
-
Method Details
-
getConnectionConfig
Description copied from interface:ConnectionFactory
Returns the connection configuration used to create connections.- Specified by:
getConnectionConfig
in interfaceConnectionFactory
- Returns:
- connection config
-
setConnectionConfig
Sets the connection config. Once invoked the supplied connection config is made immutable. SeeAbstractConfig.makeImmutable()
.- Parameters:
cc
- connection config
-
getTransport
Returns the ldap transport.- Returns:
- ldap transport
-
getConnection
Creates a new connection. Connections returned from this method must be opened before they can perform ldap operations.- Specified by:
getConnection
in interfaceConnectionFactory
- Returns:
- connection
-
close
public void close()Description copied from interface:ConnectionFactory
Free any resources associated with this factory.- Specified by:
close
in interfaceConnectionFactory
-
toString
-
builder
Creates a builder for this class.- Returns:
- new builder
-
builder
Creates a builder for this class.- Parameters:
t
- transport- Returns:
- new builder
-