Package org.ldaptive
Class DefaultConnectionFactory
- java.lang.Object
- 
- org.ldaptive.AbstractFreezable
- 
- org.ldaptive.DefaultConnectionFactory
 
 
- 
- All Implemented Interfaces:
- ConnectionFactory,- Freezable
 - Direct Known Subclasses:
- SingleConnectionFactory
 
 public class DefaultConnectionFactory extends AbstractFreezable implements ConnectionFactory Creates connections for performing ldap operations.
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classDefaultConnectionFactory.Builder
 - 
Constructor SummaryConstructors Constructor Description DefaultConnectionFactory()Default constructor.DefaultConnectionFactory(String ldapUrl)Creates a new default connection factory.DefaultConnectionFactory(String ldapUrl, Transport t)Creates a new default connection factory.DefaultConnectionFactory(ConnectionConfig cc)Creates a new default connection factory.DefaultConnectionFactory(ConnectionConfig cc, Transport t)Creates a new default connection factory.DefaultConnectionFactory(Transport t)Creates a new default connection factory.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultConnectionFactory.Builderbuilder()Creates a builder for this class.static DefaultConnectionFactory.Builderbuilder(Transport t)Creates a builder for this class.voidclose()Free any resources associated with this factory.voidfreeze()Freezes this object, making it immutable.ConnectiongetConnection()Creates a new connection.ConnectionConfiggetConnectionConfig()Returns the connection configuration used to create connections.TransportgetTransport()Returns the ldap transport.voidsetConnectionConfig(ConnectionConfig cc)Sets the connection config.StringtoString()- 
Methods inherited from class org.ldaptive.AbstractFreezableassertMutable, freeze, freeze, isFrozen
 
- 
 
- 
- 
- 
Field Detail- 
loggerprotected final Logger logger Logger for this class.
 - 
transportprivate final Transport transport Transport used by this factory.
 - 
configprivate ConnectionConfig config Connection configuration used by this factory.
 
- 
 - 
Constructor Detail- 
DefaultConnectionFactorypublic DefaultConnectionFactory() Default constructor.
 - 
DefaultConnectionFactorypublic DefaultConnectionFactory(Transport t) Creates a new default connection factory. Be sure to invokeclose()if the supplied transport has resources to cleanup.- Parameters:
- t- transport
 
 - 
DefaultConnectionFactorypublic DefaultConnectionFactory(String ldapUrl) Creates a new default connection factory.- Parameters:
- ldapUrl- to connect to
 
 - 
DefaultConnectionFactorypublic DefaultConnectionFactory(String ldapUrl, Transport t) Creates a new default connection factory. Be sure to invokeclose()if the supplied transport has resources to cleanup.- Parameters:
- ldapUrl- to connect to
- t- transport
 
 - 
DefaultConnectionFactorypublic DefaultConnectionFactory(ConnectionConfig cc) Creates a new default connection factory.- Parameters:
- cc- connection configuration
 
 - 
DefaultConnectionFactorypublic DefaultConnectionFactory(ConnectionConfig cc, Transport t) Creates a new default connection factory. Be sure to invokeclose()if the supplied transport has resources to cleanup.- Parameters:
- cc- connection configuration
- t- transport
 
 
- 
 - 
Method Detail- 
freezepublic void freeze() Description copied from interface:FreezableFreezes this object, making it immutable.- Specified by:
- freezein interface- Freezable
- Overrides:
- freezein class- AbstractFreezable
 
 - 
getConnectionConfigpublic ConnectionConfig getConnectionConfig() Description copied from interface:ConnectionFactoryReturns the connection configuration used to create connections.- Specified by:
- getConnectionConfigin interface- ConnectionFactory
- Returns:
- connection config
 
 - 
setConnectionConfigpublic void setConnectionConfig(ConnectionConfig cc) Sets the connection config. Once invoked the supplied connection config is made immutable. SeeConnectionConfig.freeze().- Parameters:
- cc- connection config
 
 - 
getTransportpublic Transport getTransport() Returns the ldap transport.- Returns:
- ldap transport
 
 - 
getConnectionpublic Connection getConnection() Creates a new connection. Connections returned from this method must be opened before they can perform ldap operations.- Specified by:
- getConnectionin interface- ConnectionFactory
- Returns:
- connection
 
 - 
closepublic void close() Description copied from interface:ConnectionFactoryFree any resources associated with this factory.- Specified by:
- closein interface- ConnectionFactory
 
 - 
builderpublic static DefaultConnectionFactory.Builder builder() Creates a builder for this class.- Returns:
- new builder
 
 - 
builderpublic static DefaultConnectionFactory.Builder builder(Transport t) Creates a builder for this class.- Parameters:
- t- transport
- Returns:
- new builder
 
 
- 
 
-