public final class LdapClientConnection extends ClientConnection implements TLSCapableConnection
authenticationInfo, bindInProgress, saslBindInProgress, startTLSInProgress
Modifier and Type | Method and Description |
---|---|
void |
disconnect(DisconnectReason disconnectReason,
boolean sendNotification,
LocalizableMessage message)
Closes the connection to the client, optionally sending it a message indicating the reason for the closure.
|
String |
getClientAddress()
Retrieves a string representation of the address of the client.
|
Certificate[] |
getClientCertificateChain()
Return the certificate chain array associated with a connection.
|
int |
getClientPort()
Retrieves the port number for this connection on the client system if available.
|
ConnectionHandler<?> |
getConnectionHandler()
Retrieves the connection handler that accepted this client connection.
|
long |
getConnectionID()
Retrieves the unique identifier that has been assigned to this connection.
|
long |
getIdleTime()
Retrieves the length of time in milliseconds that this client connection has been idle.
|
long |
getMaxBlockedWriteTimeLimit()
Retrieves the maximum length of time in milliseconds that attempts to write data to the client should be allowed
to block.
|
JsonValue |
getMonitorSummary()
Returns a summary of this client connection in JSON (format that is both human readable and machine parseable).
|
Operation |
getOperationInProgress(int messageID)
Retrieves the operation in progress with the specified message ID.
|
String |
getProtocol()
Retrieves the protocol that the client is using to communicate with the Directory Server.
|
InetAddress |
getRemoteAddress()
Retrieves the
InetAddress associated with the remote client system. |
String |
getServerAddress()
Retrieves a string representation of the address on the server to which the client connected.
|
int |
getServerPort()
Retrieves the port number for this connection on the server system if available.
|
int |
getSSF()
Return the Security Strength Factor of a client connection.
|
Flowable<Response> |
handle(org.forgerock.services.context.Context context,
Request request)
Processes the provided request in a reactive way.
|
boolean |
isConnectionValid()
Returns whether the Directory Server believes this connection to be valid and available for communication.
|
boolean |
isSecure()
Indicates whether this client connection is currently using a secure mechanism to communicate with the server.
|
boolean |
prepareTLS(LocalizableMessageBuilder unavailableReason)
Prepares this connection for using TLS and returns whether TLS protection is actually available for the
underlying client connection.
|
void |
removeOperationInProgress(int messageID)
Removes the provided operation from the set of operations in progress for this client connection.
|
protected boolean |
sendIntermediateResponseMessage(Operation operation,
IntermediateResponse intermediateResponse)
Sends the provided intermediate response message to the client.
|
void |
sendResponse(Operation operation)
Removes the provided operation from the set of operations in progress of this client connection and sends
a response to the client based on the information in the provided operation.
|
void |
sendSearchEntry(SearchOperation searchOperation,
SearchResultEntry searchEntry)
Sends the provided search result entry to the client.
|
boolean |
sendSearchReference(SearchOperation searchOperation,
SearchResultReference searchReference)
Sends the provided search result reference to the client.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this client connection to the provided buffer.
|
deregisterPersistentSearch, finalizeConnectionInternal, finishBind, finishSaslBind, finishStartTLS, getAuthenticationInfo, getClientHostPort, getConnectTimeString, getCursorEntryLimit, getIdleTimeLimit, getKeyManagerProviderDN, getLookthroughLimit, getPersistentSearches, getSASLAuthStateInfo, getServerHostPort, getSizeLimit, getTimeLimit, getTrustManagerProviderDN, hasAllPrivileges, hasPrivilege, hasPrivilege, isInnerConnection, mustChangePassword, registerPersistentSearch, setAuthenticationInfo, setCursorEntryLimit, setIdleTimeLimit, setLookthroughLimit, setMustChangePassword, setResourceLimits, setSASLAuthStateInfo, setSizeLimit, setTimeLimit, setUnauthenticated, toString, updateAuthenticationInfo, updatePrivileges, writeTimeLimitExceeded
public long getConnectionID()
ClientConnection
getConnectionID
in class ClientConnection
public ConnectionHandler<?> getConnectionHandler()
ClientConnection
getConnectionHandler
in class ClientConnection
public String getProtocol()
ClientConnection
getProtocol
in class ClientConnection
public String getClientAddress()
ClientConnection
getClientAddress
in class ClientConnection
public int getClientPort()
ClientConnection
getClientPort
in class ClientConnection
public String getServerAddress()
ClientConnection
getServerAddress
in class ClientConnection
public int getServerPort()
ClientConnection
getServerPort
in class ClientConnection
public InetAddress getRemoteAddress()
ClientConnection
InetAddress
associated with the remote client system.getRemoteAddress
in class ClientConnection
InetAddress
associated with the remote client system. It may be null
if the client is
not connected over an IP-based connection.public boolean isConnectionValid()
ClientConnection
isConnectionValid
in class ClientConnection
public boolean isSecure()
ClientConnection
false
to true
if the client uses the StartTLS extended operation).isSecure
in class ClientConnection
true
if the client connection is currently using a secure mechanism to communicate with the
server, or false
if not.public void sendResponse(Operation operation)
Note that this does not make any attempt to cancel any processing that may already be in progress for the operation.
This method overrides ClientConnection.sendResponse(Operation)
in order to allow LDAPv2 usage and to
pass the StartTLS options associated to this LDAP client connection.
sendResponse
in class ClientConnection
operation
- The operation for which to send the responsepublic void sendSearchEntry(SearchOperation searchOperation, SearchResultEntry searchEntry)
ClientConnection
sendSearchEntry
in class ClientConnection
searchOperation
- The search operation with which the entry is associated.searchEntry
- The search result entry to be sent to the client.public boolean sendSearchReference(SearchOperation searchOperation, SearchResultReference searchReference)
ClientConnection
sendSearchReference
in class ClientConnection
searchOperation
- The search operation with which the reference is associated.searchReference
- The search result reference to be sent to the client.true
if the client is able to accept referrals, or false
if the client cannot handle
referrals and no more attempts should be made to send them for the associated search operation.protected boolean sendIntermediateResponseMessage(Operation operation, IntermediateResponse intermediateResponse)
ClientConnection
sendIntermediateResponseMessage
in class ClientConnection
operation
- The operation with which the intermediate response is associated.intermediateResponse
- The intermediate response message to be sent.true
if processing on the associated operation should continue, or false
if not.public void disconnect(DisconnectReason disconnectReason, boolean sendNotification, LocalizableMessage message)
ClientConnection
disconnectClient
method within that operation should be
called rather than invoking this method directly.
All subclasses must invoke the finalizeConnectionInternal
method during the course of processing this
method.
disconnect
in class ClientConnection
disconnectReason
- The disconnect reason that provides the generic cause for the disconnect.sendNotification
- Indicates whether to try to provide notification to the client that the connection will be closed.message
- The message to send to the client. It may be null
if no notification is to be sent.public Operation getOperationInProgress(int messageID)
ClientConnection
getOperationInProgress
in class ClientConnection
messageID
- The message ID of the operation to retrieve.null
if no such operation could be
found.public void removeOperationInProgress(int messageID)
ClientConnection
removeOperationInProgress
in class ClientConnection
messageID
- The message ID of the operation to remove from the set of operations in progress.public long getMaxBlockedWriteTimeLimit()
ClientConnection
getMaxBlockedWriteTimeLimit
in class ClientConnection
public Flowable<Response> handle(org.forgerock.services.context.Context context, Request request)
For most requests, this will include placing the operation in the work queue. Certain requests (in particular, abandons and unbinds) will be processed directly.
handle
in interface RequestHandler
context
- The context to process the request, which is expected to contain a RequestContext
request
- The request to process.public JsonValue getMonitorSummary()
ClientConnection
getMonitorSummary
in class ClientConnection
public void toString(StringBuilder buffer)
ClientConnection
toString
in class ClientConnection
buffer
- The buffer to which the information should be appended.public boolean prepareTLS(LocalizableMessageBuilder unavailableReason)
TLSCapableConnection
prepareTLS
in interface TLSCapableConnection
unavailableReason
- The buffer used to hold the reason that TLS is not available on the underlying client connection.true
if TLS is available on the underlying client connection, or false
if it is
not.public long getIdleTime()
ClientConnection
Note that the default implementation will always return zero. Subclasses associated with connection handlers should override this method if they wish to provided idle time limit functionality.
getIdleTime
in class ClientConnection
public Certificate[] getClientCertificateChain()
public int getSSF()
ClientConnection
getSSF
in class ClientConnection
Copyright 2010-2022 ForgeRock AS.