public class JmxClientConnection extends ClientConnection implements NotificationListener
Modifier and Type | Field and Description |
---|---|
protected String |
jmxConnectionID
The JMX connection ID for this client connection.
|
authenticationInfo, bindInProgress, DEFAULT_WRITE_TIME_LIMIT_MS, saslBindInProgress, startTLSInProgress
Constructor and Description |
---|
JmxClientConnection(JmxConnectionHandler jmxConnectionHandler,
AuthenticationInfo authInfo)
Creates a new Jmx client connection that will be authenticated as as the specified user.
|
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.
|
void |
disconnectWithoutUnbind(DisconnectReason disconnectReason,
LocalizableMessage message)
Closes the connection to the client, optionally sending it a message indicating the reason for the closure.
|
protected void |
finalize()
Called by the Gc when the object is garbage collected Release the cursor in case the iterator was badly used and
releaseCursor was never called.
|
String |
getClientAddress()
Retrieves a string representation of the address of the client.
|
int |
getClientPort()
Retrieves the port number for this connection on the client system.
|
ConnectionHandler<?> |
getConnectionHandler()
Retrieves the connection handler that accepted this client connection.
|
long |
getConnectionID()
Retrieves the unique identifier that has been assigned to this connection.
|
InetAddress |
getLocalAddress()
Retrieves the
java.net.InetAddress for the Directory Server system to which the client has
established the connection. |
String |
getMonitorSummary()
Retrieves a one-line summary of this client connection in a form that is suitable for including in the monitor
entry for the associated connection handler.
|
long |
getNumberOfOperations()
To be implemented.
|
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
java.net.InetAddress associated with the remote client system. |
String |
getSecurityMechanism()
Retrieves the human-readable name of the security mechanism that is used to protect communication with this
client.
|
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, which should be either a
BindRequest or a
SearchRequest . |
void |
handleNotification(Notification notif,
Object handback) |
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.
|
int |
nextMessageID()
Retrieves the message ID that should be used for the next Jmx operation.
|
long |
nextOperationID()
Retrieves the operation ID that should be used for the next Jmx operation.
|
BindResult |
processBind(BindRequest request)
Processes a bind request.
|
Result |
processSearch(SearchRequest request)
Processes an JMX search operation with the provided information.
|
void |
removeOperationInProgress(int messageID)
Removes the provided operation from the set of operations in progress for this client connection.
|
protected boolean |
sendIntermediateResponseMessage(IntermediateResponse intermediateResponse)
Sends the provided intermediate response message to the client.
|
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, getCertificateAlias, getClientHostPort, getConnectTime, getConnectTimeString, getIdleTime, getIdleTimeLimit, getKeyManagerProviderDN, getLookthroughLimit, getMaxBlockedWriteTimeLimit, getPersistentSearches, getSASLAuthStateInfo, getServerHostPort, getSizeLimit, getTimeLimit, getTrustManagerProviderDN, hasAllPrivileges, hasPrivilege, hasPrivilege, isInnerConnection, mustChangePassword, registerPersistentSearch, sendIntermediateResponse, sendResponse, setAuthenticationInfo, setIdleTimeLimit, setLookthroughLimit, setMustChangePassword, setSASLAuthStateInfo, setSizeLimit, setTimeLimit, setUnauthenticated, toString, updateAuthenticationInfo, updatePrivileges
protected String jmxConnectionID
public JmxClientConnection(JmxConnectionHandler jmxConnectionHandler, AuthenticationInfo authInfo)
jmxConnectionHandler
- The connection handler on which we should be registeredauthInfo
- the User authentication infopublic Flowable<Response> handle(org.forgerock.services.context.Context context, Request request)
BindRequest
or a
SearchRequest
.handle
in interface RequestHandler
context
- The context to process the request, which is expected to contain a RequestDJContext
request
- The request to process. Only BindRequest
and SearchRequest
are handled, other requests
will return a LdapException
public void handleNotification(Notification notif, Object handback)
handleNotification
in interface NotificationListener
public long nextOperationID()
public int nextMessageID()
public long getConnectionID()
getConnectionID
in class ClientConnection
public ConnectionHandler<?> getConnectionHandler()
getConnectionHandler
in class ClientConnection
public String getProtocol()
getProtocol
in class ClientConnection
public String getClientAddress()
getClientAddress
in class ClientConnection
public int getClientPort()
getClientPort
in class ClientConnection
public String getServerAddress()
getServerAddress
in class ClientConnection
public int getServerPort()
getServerPort
in class ClientConnection
public InetAddress getRemoteAddress()
java.net.InetAddress
associated with the remote client system.getRemoteAddress
in class ClientConnection
java.net.InetAddress
associated with the remote client system. It may be
null
if the client is not connected over an IP-based connection.public InetAddress getLocalAddress()
java.net.InetAddress
for the Directory Server system to which the client has
established the connection.getLocalAddress
in class ClientConnection
java.net.InetAddress
for the Directory Server system to which the client has established
the connection. 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()
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 String getSecurityMechanism()
null
if no security is in place.public Result processSearch(SearchRequest request)
request
- The search request.public BindResult processBind(BindRequest request) throws LdapException
request
- The bind request.LdapException
- If result is not SUCCESS or an error occurspublic void sendSearchEntry(SearchOperation searchOperation, SearchResultEntry searchEntry) throws DirectoryException
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.DirectoryException
- If a problem occurs while attempting to send the entry to the client and the search should be
terminated.public boolean sendSearchReference(SearchOperation searchOperation, SearchResultReference searchReference) throws DirectoryException
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.DirectoryException
- If a problem occurs while attempting to send the reference to the client and the search should be
terminated.protected boolean sendIntermediateResponseMessage(IntermediateResponse intermediateResponse)
sendIntermediateResponseMessage
in class ClientConnection
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)
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 void disconnectWithoutUnbind(DisconnectReason disconnectReason, LocalizableMessage message)
Contrary to disconnect(DisconnectReason, boolean, LocalizableMessage)
this method does not attempt to
perform an UNBIND operation on the connection.
disconnectReason
- The disconnect reason that provides the generic cause for the disconnect.message
- The message to send to the client. It may be null
if no notification is to be sent.public Operation getOperationInProgress(int messageID)
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)
removeOperationInProgress
in class ClientConnection
messageID
- The message ID of the operation to remove from the set of operations in progress.public String getMonitorSummary()
ClientConnection
getMonitorSummary
in class ClientConnection
public void toString(StringBuilder buffer)
toString
in class ClientConnection
buffer
- The buffer to which the information should be appended.protected void finalize()
public long getNumberOfOperations()
getNumberOfOperations
in class ClientConnection
public int getSSF()
ClientConnection
getSSF
in class ClientConnection
Copyright 2010-2020 ForgeRock AS.