protected static class DefaultConnectionFactory.DefaultConnection extends Object implements Connection
| Modifier and Type | Field and Description |
|---|---|
private ConnectionConfig |
config
Connection configuration.
|
protected 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<Void> |
open()
This will establish a connection if one does not already exist.
|
Response<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<Void> |
reopen()
This will close an existing connection to the LDAP and establish a new connection to the LDAP.
|
Response<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.
|
String |
toString() |
protected final 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 ConnectionIllegalStateException - if the connection is not openpublic Response<Void> open() throws LdapException
close().open in interface ConnectionConnectionInitializer or an empty response if no connection
initializer was configuredIllegalStateException - if the connection is already openLdapException - if the LDAP cannot be reachedpublic Response<Void> open(BindRequest request) throws LdapException
close().open in interface Connectionrequest - bind requestIllegalStateException - if the connection is already openLdapException - if the LDAP cannot be reachedpublic boolean isOpen()
isOpen in interface Connectionpublic void close()
Connectionclose in interface AutoCloseableclose in interface Connectionpublic void close(RequestControl[] controls)
Connectionclose in interface Connectioncontrols - request controlspublic Response<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<Void> reopen(BindRequest request) throws LdapException
Connectionreopen in interface Connectionrequest - containing bind informationLdapException - if the LDAP cannot be reachedCopyright © 2003-2019 Virginia Tech. All Rights Reserved.