public interface LDAPClientContext
ServerConnectionFactory
. An
LDAP client context can be used to query information about the client's
connection such as their network address, as well as managing the state of
the connection.Modifier and Type | Method and Description |
---|---|
void |
disconnect()
Disconnects the client without sending a disconnect notification.
|
void |
disconnect(ResultCode resultCode,
String message)
Disconnects the client and sends a disconnect notification, if possible,
containing the provided result code and diagnostic message.
|
void |
enableConnectionSecurityLayer(ConnectionSecurityLayer layer)
Installs the provided connection security layer to the underlying
connection.
|
void |
enableTLS(SSLContext sslContext,
String[] protocols,
String[] suites,
boolean wantClientAuth,
boolean needClientAuth)
Installs the TLS/SSL security layer on the underlying connection.
|
InetSocketAddress |
getLocalAddress()
Returns the
InetSocketAddress associated with the local system. |
InetSocketAddress |
getPeerAddress()
Returns the
InetSocketAddress associated with the remote system. |
int |
getSecurityStrengthFactor()
Returns the cipher strength, in bits, currently in use by the underlying
connection.
|
SSLSession |
getSSLSession()
Returns the SSL session currently in use by the underlying connection, or
null if SSL/TLS is not enabled. |
boolean |
isClosed()
Returns
true if the underlying connection has been closed as a
result of a client disconnect, a fatal connection error, or a server-side
disconnect() . |
void |
sendUnsolicitedNotification(ExtendedResult notification)
Sends an unsolicited notification to the client.
|
void disconnect()
Server connections: invoking this method causes
handleConnectionDisconnected
to be called before this method returns.
void disconnect(ResultCode resultCode, String message)
Server connections: invoking this method causes
handleConnectionDisconnected
to be called before this method returns.
resultCode
- The result code which should be included with the disconnect
notification.message
- The diagnostic message, which may be empty or null
indicating that none was provided.InetSocketAddress getLocalAddress()
InetSocketAddress
associated with the local system.InetSocketAddress
associated with the local system.InetSocketAddress getPeerAddress()
InetSocketAddress
associated with the remote system.InetSocketAddress
associated with the remote system.int getSecurityStrengthFactor()
javax.servlet.request.key_size
property defined in the Servlet
specification (section 3.8 "SSL Attributes"). It provides no indication
of the relative strength of different cipher algorithms, their known
weaknesses, nor the strength of other cryptographic information used
during SSL/TLS negotiation.SSLSession getSSLSession()
null
if SSL/TLS is not enabled.null
if SSL/TLS is not enabled.boolean isClosed()
true
if the underlying connection has been closed as a
result of a client disconnect, a fatal connection error, or a server-side
disconnect()
.
This method provides a polling mechanism which can be used by synchronous request handler implementations to detect connection termination.
Server connections: this method will always return true
when called from within handleConnectionClosed
,
handleConnectionDisconnected
, or
handleConnectionError
.
true
if the underlying connection has been closed.void sendUnsolicitedNotification(ExtendedResult notification)
notification
- The notification to send.void enableConnectionSecurityLayer(ConnectionSecurityLayer layer)
layer
- The negotiated bind context that can be used to encode and
decode data on the connection.void enableTLS(SSLContext sslContext, String[] protocols, String[] suites, boolean wantClientAuth, boolean needClientAuth)
sslContext
- The SSLContext
which should be used to secure theprotocols
- Names of all the protocols to enable or null
to use
the default protocols.suites
- Names of all the suites to enable or null
to use the
default cipher suites.wantClientAuth
- Set to true
if client authentication is requested, or
false
if no client authentication is desired.needClientAuth
- Set to true
if client authentication is required, or
false
if no client authentication is desired.IllegalStateException
- If the TLS/SSL security layer has already been installed.Copyright 2010-2017 ForgeRock AS.