protected static class DefaultConnectionFactory.DefaultConnection extends java.lang.Object implements Connection
| Modifier and Type | Field and Description |
|---|---|
private ConnectionConfig |
config
Connection configuration.
|
protected org.slf4j.Logger |
logger
Logger for this class.
|
private ProviderConnection |
providerConnection
Provider connection.
|
private ProviderConnectionFactory<?> |
providerConnectionFactory
Connection factory.
|
| Constructor and Description |
|---|
DefaultConnection(ConnectionConfig cc,
ProviderConnectionFactory<?> cf)
Creates a new default connection.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
This will close the connection to the LDAP.
|
void |
close(RequestControl[] controls)
This will close the connection to the LDAP using the supplied controls.
|
protected void |
finalize() |
ConnectionConfig |
getConnectionConfig()
Returns the connection config for this connection.
|
ProviderConnection |
getProviderConnection()
Returns the provider specific connection.
|
boolean |
isOpen()
Returns whether the underlying provider connection is not null.
|
Response<java.lang.Void> |
open()
This will establish a connection if one does not already exist.
|
Response<java.lang.Void> |
open(BindRequest request)
This will establish a connection if one does not already exist and bind to the LDAP using the supplied bind
request.
|
Response<java.lang.Void> |
reopen()
This will close an existing connection to the LDAP and establish a new connection to the LDAP.
|
Response<java.lang.Void> |
reopen(BindRequest request)
This will close an existing connection to the LDAP and establish a new connection to the LDAP using the supplied
bind request.
|
java.lang.String |
toString() |
protected final org.slf4j.Logger logger
private final ConnectionConfig config
private final ProviderConnectionFactory<?> providerConnectionFactory
private ProviderConnection providerConnection
public DefaultConnection(ConnectionConfig cc, ProviderConnectionFactory<?> cf)
cc - connection configurationcf - provider connection factorypublic ConnectionConfig getConnectionConfig()
ConnectiongetConnectionConfig in interface Connectionpublic ProviderConnection getProviderConnection()
open().getProviderConnection in interface Connectionjava.lang.IllegalStateException - if the connection is not openpublic Response<java.lang.Void> open() throws LdapException
close().open in interface ConnectionConnectionInitializer or an empty response if no connection
initializer was configuredjava.lang.IllegalStateException - if the connection is already openLdapException - if the LDAP cannot be reachedpublic Response<java.lang.Void> open(BindRequest request) throws LdapException
close().open in interface Connectionrequest - bind requestjava.lang.IllegalStateException - if the connection is already openLdapException - if the LDAP cannot be reachedpublic boolean isOpen()
isOpen in interface Connectionpublic void close()
Connectionclose in interface java.lang.AutoCloseableclose in interface Connectionpublic void close(RequestControl[] controls)
Connectionclose in interface Connectioncontrols - request controlspublic Response<java.lang.Void> reopen() throws LdapException
Connectionreopen in interface ConnectionConnectionInitializer or an empty response if no connection
initializer was configuredLdapException - if the LDAP cannot be reachedpublic Response<java.lang.Void> reopen(BindRequest request) throws LdapException
Connectionreopen in interface Connectionrequest - containing bind informationLdapException - if the LDAP cannot be reachedpublic java.lang.String toString()
toString in class java.lang.Objectprotected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwable