Package org.ldaptive
Class DefaultConnectionFactory
java.lang.Object
org.ldaptive.AbstractFreezable
org.ldaptive.DefaultConnectionFactory
- All Implemented Interfaces:
ConnectionFactory,Freezable
- Direct Known Subclasses:
SingleConnectionFactory
Creates connections for performing ldap operations.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
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.voidclose()Free any resources associated with this factory.voidfreeze()Freezes this object, making it immutable.Creates a new connection.Returns the connection configuration used to create connections.Returns the ldap transport.voidSets the connection config.toString()Methods inherited from class org.ldaptive.AbstractFreezable
assertMutable, freeze, freeze, isFrozen
-
Field Details
-
logger
Logger 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
-
freeze
public void freeze()Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
freezein interfaceFreezable- Overrides:
freezein classAbstractFreezable
-
getConnectionConfig
Description copied from interface:ConnectionFactoryReturns the connection configuration used to create connections.- Specified by:
getConnectionConfigin interfaceConnectionFactory- Returns:
- connection config
-
setConnectionConfig
Sets the connection config. Once invoked the supplied connection config is made immutable. SeeConnectionConfig.freeze().- 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:
getConnectionin interfaceConnectionFactory- Returns:
- connection
-
close
public void close()Description copied from interface:ConnectionFactoryFree any resources associated with this factory.- Specified by:
closein 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
-