public class ConnectionContext extends AbstractContext
Constructor and Description |
---|
ConnectionContext(ClientConnection clientConnection,
org.forgerock.services.context.Context parent)
Creates a new client context with a parent context.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addPendingRequest(RequestContext requestContext)
Adds the request context to the set of request context associated to requests which are in progress for this
connection.
|
io.reactivex.Completable |
cancelAllRequests(boolean notifyClient,
LocalizableMessage reason)
Returns a
Completable that, once it is subscribed, will attempt to cancel all active requests on this
connection. |
io.reactivex.Completable |
cancelAllRequestsExcept(int msgId,
boolean notifyClient,
LocalizableMessage reason)
Returns a
Completable that, once it is subscribed, will attempt to cancel all active requests on this
connection that do not have the specified message ID. |
io.reactivex.Single<org.forgerock.opendj.ldap.messages.Result> |
cancelRequest(int msgId,
boolean notifyClient,
LocalizableMessage reason)
Returns a
Single that, once it is subscribed, will attempt to cancel the specified request. |
AuthenticationInfo |
getAuthenticationInfo()
Returns the authentication info to use for this connection context.
|
ClientConnection |
getClientConnection()
Returns the client connection.
|
long |
getConnectionId()
Returns the unique identifier that has been assigned to this connection.
|
long |
getMaxBlockedWriteTimeLimit()
Retrieves the maximum length of time in milliseconds that attempts to write data to the client should be allowed
to block.
|
String |
getProtocol()
Returns the protocol that the client is using to communicate with the Directory Server.
|
InetAddress |
getRemoteAddress()
Returns the
java.net.InetAddress associated with the remote client system. |
int |
getServerPort()
Returns the port number for this connection on the server system if available.
|
int |
getSsf()
Returns the cipher strength, in bits, currently in use by the underlying connection.
|
boolean |
removePendingRequest(int messageId)
Removes the request context from the set of in-progress request contexts.
|
void |
setAuthenticationInfo(AuthenticationInfo authenticationInfo)
Sets the authentication info to use for this connection context.
|
asContext, containsContext, containsContext, getContext, getContextName, getId, getParent, isRootContext, toJsonValue, toString
public ConnectionContext(ClientConnection clientConnection, org.forgerock.services.context.Context parent)
clientConnection
- The client connection.parent
- The parent context.public ClientConnection getClientConnection()
public AuthenticationInfo getAuthenticationInfo()
null
public String getProtocol()
public InetAddress getRemoteAddress()
java.net.InetAddress
associated with the remote client system.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 int getServerPort()
public int getSsf()
public void setAuthenticationInfo(AuthenticationInfo authenticationInfo)
authenticationInfo
- the authentication info. If null
, then an authentication info suitable for anonymous users
will be created.public long getConnectionId()
public long getMaxBlockedWriteTimeLimit()
public io.reactivex.Single<org.forgerock.opendj.ldap.messages.Result> cancelRequest(int msgId, boolean notifyClient, LocalizableMessage reason)
Single
that, once it is subscribed, will attempt to cancel the specified request.msgId
- The message ID of the request to be cancelled.notifyClient
- true
if the client should receive a response if the request was successfully cancelled.reason
- A message explaining the reason for the cancellation.Single
that, once it is subscribed, will attempt to cancel the specified request.public io.reactivex.Completable cancelAllRequests(boolean notifyClient, LocalizableMessage reason)
Completable
that, once it is subscribed, will attempt to cancel all active requests on this
connection.notifyClient
- true
if the client should receive a response for requests that were successfully cancelled.reason
- A message explaining the reason for the cancellation.Completable
that, once it is subscribed, will attempt to cancel all active requests on this
connection.public io.reactivex.Completable cancelAllRequestsExcept(int msgId, boolean notifyClient, LocalizableMessage reason)
Completable
that, once it is subscribed, will attempt to cancel all active requests on this
connection that do not have the specified message ID.msgId
- The message ID of the request that should not be cancelled.notifyClient
- true
if the client should receive a response for requests that were successfully cancelled.reason
- A message explaining the reason for the cancellation.Completable
that, once it is subscribed, will attempt to cancel all active requests on this
connection that do not have the specified message ID.public boolean addPendingRequest(RequestContext requestContext)
requestContext
- The request context to addtrue
If the request context has been added or false
if a request context with the same
message ID has already been registered.public boolean removePendingRequest(int messageId)
messageId
- The message ID identifying the request context to remove.true
if the message ID identified a registered request context, false
otherwise.Copyright © 2010–2017 ForgeRock AS. All rights reserved.