Package org.ldaptive
Class PooledConnectionFactory
- java.lang.Object
-
- org.ldaptive.pool.AbstractConnectionPool
-
- org.ldaptive.pool.BlockingConnectionPool
-
- org.ldaptive.PooledConnectionFactory
-
- All Implemented Interfaces:
AutoCloseable
,ConnectionFactory
,ConnectionPool
public class PooledConnectionFactory extends BlockingConnectionPool implements ConnectionFactory
Creates connections for performing ldap operations.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PooledConnectionFactory.Builder
-
Nested classes/interfaces inherited from class org.ldaptive.pool.AbstractConnectionPool
AbstractConnectionPool.DefaultPooledConnectionProxy
-
-
Field Summary
-
Fields inherited from class org.ldaptive.pool.AbstractConnectionPool
active, available, checkOutLock, DEFAULT_MAX_POOL_SIZE, DEFAULT_MIN_POOL_SIZE, logger, poolLock, poolNotEmpty
-
-
Constructor Summary
Constructors Constructor Description PooledConnectionFactory()
Default constructor.PooledConnectionFactory(String ldapUrl)
Creates a new pooled connection factory.PooledConnectionFactory(ConnectionConfig cc)
Creates a new pooled connection factory.PooledConnectionFactory(ConnectionConfig cc, Transport t)
Creates a new pooled connection factory.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static PooledConnectionFactory.Builder
builder()
Creates a builder for this class.void
close()
Empty this pool, freeing any resources.ConnectionConfig
getConnectionConfig()
Returns the connection configuration used to create connections.Transport
getTransport()
Returns the ldap transport.void
setConnectionConfig(ConnectionConfig cc)
Sets the connection config.-
Methods inherited from class org.ldaptive.pool.BlockingConnectionPool
blockAvailableConnection, getBlockWaitTime, getConnection, putConnection, retrieveAvailableConnection, setBlockWaitTime
-
Methods inherited from class org.ldaptive.pool.AbstractConnectionPool
activateAndValidateConnection, activeCount, availableCount, createActiveConnection, createAvailableConnection, createConnection, createConnectionProxy, getActivator, getConnectOnCreate, getDefaultConnectionFactory, getFailFastInitialize, getMaxPoolSize, getMinPoolSize, getName, getPassivator, getPooledConnectionStatistics, getPruneStrategy, getQueueType, getValidator, grow, grow, initialize, isInitialized, isValidateOnCheckIn, isValidateOnCheckOut, isValidatePeriodically, prune, removeActiveConnection, removeAvailableAndActiveConnection, removeAvailableConnection, retrieveConnectionProxy, setActivator, setConnectOnCreate, setDefaultConnectionFactory, setFailFastInitialize, setMaxPoolSize, setMinPoolSize, setName, setPassivator, setPruneStrategy, setQueueType, setValidateOnCheckIn, setValidateOnCheckOut, setValidatePeriodically, setValidator, throwIfNotInitialized, toString, validate, validateAndPassivateConnection
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.ldaptive.ConnectionFactory
getConnection
-
-
-
-
Constructor Detail
-
PooledConnectionFactory
public PooledConnectionFactory()
Default constructor.
-
PooledConnectionFactory
public PooledConnectionFactory(String ldapUrl)
Creates a new pooled connection factory.- Parameters:
ldapUrl
- to connect to
-
PooledConnectionFactory
public PooledConnectionFactory(ConnectionConfig cc)
Creates a new pooled connection factory.- Parameters:
cc
- connection configuration
-
PooledConnectionFactory
public PooledConnectionFactory(ConnectionConfig cc, Transport t)
Creates a new pooled connection factory.- Parameters:
cc
- connection configurationt
- transport
-
-
Method Detail
-
getConnectionConfig
public ConnectionConfig getConnectionConfig()
Description copied from interface:ConnectionFactory
Returns the connection configuration used to create connections.- Specified by:
getConnectionConfig
in interfaceConnectionFactory
- Returns:
- connection config
-
setConnectionConfig
public void setConnectionConfig(ConnectionConfig cc)
Sets the connection config. Once invoked the supplied connection config is made immutable. SeeAbstractConfig.makeImmutable()
.- Parameters:
cc
- connection config
-
getTransport
public Transport getTransport()
Returns the ldap transport.- Returns:
- ldap transport
-
close
public void close()
Description copied from class:AbstractConnectionPool
Empty this pool, freeing any resources.- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceConnectionFactory
- Specified by:
close
in interfaceConnectionPool
- Overrides:
close
in classAbstractConnectionPool
-
builder
public static PooledConnectionFactory.Builder builder()
Creates a builder for this class.- Returns:
- new builder
-
-