Package org.ldaptive.referral
Class PooledReferralConnectionFactory
- java.lang.Object
-
- org.ldaptive.referral.PooledReferralConnectionFactory
-
- All Implemented Interfaces:
ReferralConnectionFactory
public class PooledReferralConnectionFactory extends Object implements ReferralConnectionFactory
Pooled implementation of a referral connection factory. Stores a map of connection URLs toPooledConnectionFactory
. Note that this class is intended to hold references to multiple connection pools until it is closed.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
closed
Whether this connection factory has been closed.private Map<String,PooledConnectionFactory>
factories
Map of connection URL to connection factories.private PooledConnectionFactory
factory
Factory to copy properties from.
-
Constructor Summary
Constructors Constructor Description PooledReferralConnectionFactory(PooledConnectionFactory cf)
Creates a new pooled referral connection factory.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Closes all the connection pools for this referral connection factory.private PooledConnectionFactory
copy(PooledConnectionFactory cf, String url)
Creates a new instance of the supplied connection factory with the same settings.ConnectionFactory
getConnectionFactory(String url)
Returns a connection factory for use with a referral.String
toString()
-
-
-
Field Detail
-
factories
private final Map<String,PooledConnectionFactory> factories
Map of connection URL to connection factories.
-
factory
private final PooledConnectionFactory factory
Factory to copy properties from.
-
closed
private boolean closed
Whether this connection factory has been closed.
-
-
Constructor Detail
-
PooledReferralConnectionFactory
public PooledReferralConnectionFactory(PooledConnectionFactory cf)
Creates a new pooled referral connection factory.- Parameters:
cf
- pooled connection factory to copy properties from
-
-
Method Detail
-
copy
private PooledConnectionFactory copy(PooledConnectionFactory cf, String url)
Creates a new instance of the supplied connection factory with the same settings.- Parameters:
cf
- to copyurl
- to set in the connection configuration- Returns:
- new pooled connection factory
-
getConnectionFactory
public ConnectionFactory getConnectionFactory(String url)
Description copied from interface:ReferralConnectionFactory
Returns a connection factory for use with a referral.- Specified by:
getConnectionFactory
in interfaceReferralConnectionFactory
- Parameters:
url
- LDAP URL to the referral server- Returns:
- connection factory
-
close
public void close()
Closes all the connection pools for this referral connection factory.
-
-