|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.novell.ldap.connectionpool.PoolManager
Manages connections to an LDAP Server.
PoolManager
manages connections to a single LDAP server.
The pool consists of a finite number of physical connections to the LDAP
server (parameter maxConns
) and a finite number of
LDAPConnection objects sharing a physical connection
(parameter maxSharedConns
),
see the PoolManager
constructor.
A physical connection, and its shared LDAPConnection objects are associated
with an LDAP DN and password (DN/PW).
getBoundConnection
searches for a physical connection associated with a given DN/PW
and returns an available LDAPConnection object associated with
that DN/PW.
If none are available it searches for
an unused physical connection, binds using the given DN/PW,
and returns an LDAPConnection object.
If no physical connection is available then it waits.
Once an LDAPConnection object is no longer needed the
makeConnectionAvailable
function must be called to make the LDAPConnection available to other threads.
Constructor Summary | |
PoolManager(java.lang.String host,
int port,
int maxConns,
int maxSharedConns,
LDAPSocketFactory factory)
Initialize the connection pool. |
Method Summary | |
protected void |
finalize()
Free connections. |
LDAPConnection |
getBoundConnection(java.lang.String DN,
byte[] PW)
Get a bound connection. |
void |
makeConnectionAvailable(LDAPConnection conn)
Make this connection available. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PoolManager(java.lang.String host, int port, int maxConns, int maxSharedConns, LDAPSocketFactory factory) throws LDAPException
host
- - Host name associated with this connection pool
(see LDAPConnection.connect()
).port
- - Port number for the host associated with this connection
pool.
(see LDAPConnection.connect()
).maxConns
- - Maximum number of physical connections allowed for
this host.maxSharedConns
- - Maximum number of shared connections per physical
connection.factory
- - A socket factory used to set an encrypted connection,
or null if none. If the factory is an instance of
LDAPTLSSocketFactory
then a startTLS is
performed after the connection to the server is established.
LDAPTLSSocketFactory
(see LDAPConnection.setSocketFactory()
).Method Detail |
public LDAPConnection getBoundConnection(java.lang.String DN, byte[] PW) throws LDAPException, java.lang.InterruptedException
This returns a bound (bind) connection for the desired DN and password.
DN
- Authentication DN used for bind and key.PW
- Authentication password used for bind and key.
LDAPException
- if an LDAPConnection could not be bound.
java.lang.InterruptedException
public void makeConnectionAvailable(LDAPConnection conn)
conn
- LDAPConnection to be made available.protected void finalize() throws java.lang.Throwable
Tell all waiting threads that we are shutting down. Clean up the in use and available connections.
java.lang.Throwable
- when disconnect fails.
|
LDAP Classes Implements Java LDAP |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |