public interface ConnectionFactory extends Closeable
Modifier and Type | Method and Description |
---|---|
void |
close()
Releases any resources associated with this connection factory.
|
Connection |
getConnection()
Returns a connection to the Directory Server associated with this
connection factory.
|
Promise<Connection,LdapException> |
getConnectionAsync()
Asynchronously obtains a connection to the Directory Server associated
with this connection factory.
|
void close()
close
on a connection factory which is already closed has
no effect.
Applications should avoid closing connection factories while there are remaining active connections in use or connection attempts in progress.
close
in interface AutoCloseable
close
in interface Closeable
Connections.uncloseable(ConnectionFactory)
Promise<Connection,LdapException> getConnectionAsync()
Promise
can be used to
retrieve the completed connection.Connection getConnection() throws LdapException
If the calling thread is interrupted while waiting for the connection
attempt to complete then the calling thread unblock and throw a
CancelledResultException
whose cause is the underlying
InterruptedException
.
LdapException
- If the connection request failed for some reason.Copyright 2010-2022 ForgeRock AS.