Package org.forgerock.opendj.ldap
Interface LdapSession
-
public interface LdapSession
Server side representation of a connected LDAP client. An LDAP session 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addListener(LdapSessionCompletionListener listener)
Register a listener which will be notified when thisLdapSession
changes state.void
disconnect()
Disconnects the client without sending a disconnect notification.void
disconnect(ResultCode resultCode, CharSequence diagnosticMessage)
Disconnects the client and sends a disconnect notification, containing the provided result code and diagnostic message.InetSocketAddress
getLocalAddress()
Returns theInetSocketAddress
associated with the local system.InetSocketAddress
getPeerAddress()
Returns theInetSocketAddress
associated with the remote system.SaslServer
getSaslServer()
Returns theSaslServer
currently in use by the underlying connection, ornull
if SASL integrity and/or privacy protection is not enabled.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, ornull
if SSL/TLS is not enabled.boolean
isClosed()
Returnstrue
if the underlying connection has been closed as a result of a client disconnect, a fatal connection error, or a server-sidedisconnect()
.Completable
sendUnsolicitedNotification(ExtendedResult notification)
Sends an unsolicited notification to the client.
-
-
-
Method Detail
-
addListener
void addListener(LdapSessionCompletionListener listener)
Register a listener which will be notified when thisLdapSession
changes state.- Parameters:
listener
- TheLdapSessionCompletionListener
to register.
-
disconnect
void disconnect()
Disconnects the client without sending a disconnect notification. Invoking this method causesLdapSessionCompletionListener.handleConnectionDisconnected(LdapSession, ResultCode, String)
to be called before this method returns.
-
disconnect
void disconnect(ResultCode resultCode, CharSequence diagnosticMessage)
Disconnects the client and sends a disconnect notification, containing the provided result code and diagnostic message. Invoking this method causesLdapSessionCompletionListener.handleConnectionDisconnected(LdapSession, ResultCode, String)
to be called before this method returns.- Parameters:
resultCode
- The result code to include with the disconnect notificationdiagnosticMessage
- The diagnostic message to include with the disconnect notification
-
getLocalAddress
InetSocketAddress getLocalAddress()
Returns theInetSocketAddress
associated with the local system.- Returns:
- The
InetSocketAddress
associated with the local system.
-
getPeerAddress
InetSocketAddress getPeerAddress()
Returns theInetSocketAddress
associated with the remote system.- Returns:
- The
InetSocketAddress
associated with the remote system.
-
getSecurityStrengthFactor
int getSecurityStrengthFactor()
Returns the cipher strength, in bits, currently in use by the underlying connection. This value is analogous to thejavax.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.- Returns:
- The cipher strength, in bits, currently in use by the underlying connection.
-
getSslSession
SSLSession getSslSession()
Returns the SSL session currently in use by the underlying connection, ornull
if SSL/TLS is not enabled.- Returns:
- The SSL session currently in use by the underlying connection, or
null
if SSL/TLS is not enabled.
-
getSaslServer
SaslServer getSaslServer()
Returns theSaslServer
currently in use by the underlying connection, ornull
if SASL integrity and/or privacy protection is not enabled.- Returns:
- The
SaslServer
currently in use by the underlying connection, ornull
if SASL integrity and/or privacy protection is not enabled.
-
isClosed
boolean isClosed()
Returnstrue
if the underlying connection has been closed as a result of a client disconnect, a fatal connection error, or a server-sidedisconnect()
.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 withinhandleConnectionClosed()
,handleConnectionDisconnected()
, orhandleConnectionError()
.- Returns:
true
if the underlying connection has been closed.
-
sendUnsolicitedNotification
Completable sendUnsolicitedNotification(ExtendedResult notification)
Sends an unsolicited notification to the client.- Parameters:
notification
- The notification to send.- Returns:
- A
Completable
which will be completed once the notification has been sent.
-
-