@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public class InternalClientConnection extends ClientConnection
Modifier and Type | Class and Description |
---|---|
static class |
InternalClientConnection.SearchResultCollector
Search result handler that collects entries and references returned by a search.
|
static class |
InternalClientConnection.SearchResultCounter
Search result handler that collects entries returned by a search.
|
authenticationInfo, bindInProgress, DEFAULT_WRITE_TIME_LIMIT_MS, saslBindInProgress, startTLSInProgress
Constructor and Description |
---|
InternalClientConnection(AuthenticationInfo authInfo)
Creates a new internal client connection that will be
authenticated as the specified user.
|
InternalClientConnection(org.forgerock.opendj.ldap.Dn userDN)
Creates a new internal client connection that will be
authenticated as the specified user.
|
Modifier and Type | Method and Description |
---|---|
org.forgerock.opendj.ldap.messages.Result |
add(org.forgerock.opendj.ldap.messages.AddRequest request)
Processes an internal add operation based on the provided request.
|
org.forgerock.opendj.ldap.messages.BindResult |
bind(org.forgerock.opendj.ldap.messages.BindRequest request)
Processes the provided bind request.
|
void |
cancelAllOperations(CancelRequest cancelRequest)
Attempts to cancel all operations in progress on this connection.
|
void |
cancelAllOperationsExcept(CancelRequest cancelRequest,
int messageID)
Attempts to cancel all operations in progress on this connection
except the operation with the specified message ID.
|
CancelResult |
cancelOperation(int messageID,
CancelRequest cancelRequest)
Attempts to cancel the specified operation.
|
org.forgerock.opendj.ldap.messages.CompareResult |
compare(org.forgerock.opendj.ldap.messages.CompareRequest request)
Processes the provided compare request.
|
org.forgerock.opendj.ldap.messages.Result |
delete(org.forgerock.opendj.ldap.messages.DeleteRequest request)
Processes the provided delete request.
|
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.
|
<R extends org.forgerock.opendj.ldap.messages.ExtendedResult> |
extendedRequest(org.forgerock.opendj.ldap.messages.ExtendedRequest<R> request)
Processes an internal extended operation with the provided
information.
|
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.
|
Collection<Operation> |
getOperationsInProgress()
Retrieves the set of operations in progress for this client
connection.
|
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. |
static InternalClientConnection |
getRootConnection()
Retrieves a shared internal client connection that is
authenticated as a root user.
|
static org.forgerock.opendj.ldap.Connection |
getSdkRootConnection()
Retrieves a shared internal client connection that is authenticated as a root user.
|
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.
|
io.reactivex.Flowable<org.forgerock.opendj.ldap.messages.Response> |
handle(org.forgerock.services.context.Context context,
org.forgerock.opendj.ldap.messages.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.
|
org.forgerock.opendj.ldap.messages.Result |
modify(org.forgerock.opendj.ldap.messages.ModifyRequest request)
Processes an internal modify operation with the provided information.
|
org.forgerock.opendj.ldap.messages.Result |
modifyDn(org.forgerock.opendj.ldap.messages.ModifyDnRequest request)
Processes an internal modify DN operation with the provided information.
|
static int |
nextMessageID()
Retrieves the message ID that should be used for the next
internal operation.
|
static long |
nextOperationID()
Retrieves the operation ID that should be used for the next
internal operation.
|
org.forgerock.opendj.ldap.messages.Result |
processAdd(org.forgerock.opendj.ldap.messages.AddRequest request)
Processes an internal add operation based on the provided request.
|
org.forgerock.opendj.ldap.messages.BindResult |
processBind(org.forgerock.opendj.ldap.messages.BindRequest bindRequest)
Processes an internal bind operation based on the provided request.
|
org.forgerock.opendj.ldap.messages.Result |
processDelete(org.forgerock.opendj.ldap.messages.DeleteRequest deleteRequest)
Processes the provided delete request.
|
org.forgerock.opendj.ldap.messages.Result |
processModify(org.forgerock.opendj.ldap.messages.ModifyRequest modifyRequest)
Processes an internal modify operation with the provided information.
|
org.forgerock.opendj.ldap.messages.Result |
processModifyDn(org.forgerock.opendj.ldap.messages.ModifyDnRequest modifyDnRequest)
Processes an internal modify DN operation with the provided information.
|
org.forgerock.opendj.ldap.messages.Result |
processSearch(org.forgerock.opendj.ldap.messages.SearchRequest request)
Processes a search request.
|
org.forgerock.opendj.ldap.messages.Result |
processSearch(org.forgerock.opendj.ldap.messages.SearchRequest searchRequest,
Collection<org.forgerock.opendj.ldap.messages.SearchResultEntry> entries)
Processes an internal search operation based on the provided request.
|
org.forgerock.opendj.ldap.messages.Result |
processSearch(org.forgerock.opendj.ldap.messages.SearchRequest searchRequest,
org.forgerock.opendj.ldap.SearchResultHandler handler)
Processes an internal search operation based on the provided request.
|
boolean |
removeOperationInProgress(int messageID)
Removes the provided operation from the set of operations in
progress for this client connection.
|
void |
requestTerminated(int requestMessageId)
Notifies that the request has been fully processed (successfully or not)
and that the responses have been sent (if applicable).
|
org.forgerock.opendj.ldap.messages.Result |
search(org.forgerock.opendj.ldap.messages.SearchRequest request,
org.forgerock.opendj.ldap.SearchResultHandler handler)
Processes an internal search operation with the provided information.
|
org.forgerock.opendj.ldap.messages.SearchResultEntry |
searchSingleEntry(org.forgerock.opendj.ldap.messages.SearchRequest request)
Searches the Directory Server for a single entry using the provided search request.
|
protected boolean |
sendIntermediateResponseMessage(IntermediateResponse intermediateResponse)
Sends the provided intermediate response message to the client.
|
void |
sendResponse(Operation operation)
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 |
setAuthenticationInfo(AuthenticationInfo authenticationInfo)
This method has no effect, as the authentication info for
internal client connections is set when the connection is created
and cannot be changed after the fact.
|
void |
setIdleTimeLimit(long idleTimeLimit)
Specifies the maximum length of time in milliseconds that this
client connection will be allowed to remain idle before it should
be disconnected.
|
void |
setLookthroughLimit(int lookthroughLimit)
Specifies the default maximum number of entries that should
be checked for matches during a search.
|
void |
setSizeLimit(int sizeLimit)
Specifies the size limit that will be enforced for searches
performed using this client connection.
|
void |
setTimeLimit(int timeLimit)
Specifies the time limit that will be enforced for searches
performed using this client connection.
|
void |
setUnauthenticated()
This method has no effect, as the authentication info for
internal client connections is set when the connection is created
and cannot be changed after the fact.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this client connection to the
provided buffer.
|
deregisterPersistentSearch, finalizeConnectionInternal, finishBind, finishSaslBind, finishStartTLS, getAuthenticationInfo, getCertificateAlias, getChannel, getClientHostPort, getConnectTime, getConnectTimeString, getGroups, getIdleTime, getIdleTimeLimit, getKeyManagerProviderDN, getLookthroughLimit, getMaxBlockedWriteTimeLimit, getPersistentSearches, getSASLAuthStateInfo, getServerHostPort, getSizeLimit, getSocketChannel, getTimeLimit, getTrustManagerProviderDN, getWriteSelector, hasAllPrivileges, hasPrivilege, hasPrivilege, isInnerConnection, isMemberOf, mustChangePassword, registerPersistentSearch, sendIntermediateResponse, setMustChangePassword, setSASLAuthStateInfo, toString, updateAuthenticationInfo, updatePrivileges
public InternalClientConnection(AuthenticationInfo authInfo)
authInfo
- The authentication information to use for the
connection.public InternalClientConnection(org.forgerock.opendj.ldap.Dn userDN) throws DirectoryException
userDN
- The DN of the entry to use as the
authentication and authorization identity.DirectoryException
- If a problem occurs while trying to
get the entry for the provided user
DN.public io.reactivex.Flowable<org.forgerock.opendj.ldap.messages.Response> handle(org.forgerock.services.context.Context context, org.forgerock.opendj.ldap.messages.Request request)
context
- The context to process the request, which is expected to contain
a RequestDJContext
request
- The request to process.public static InternalClientConnection getRootConnection()
public static org.forgerock.opendj.ldap.Connection getSdkRootConnection()
public static long nextOperationID()
public static int nextMessageID()
public long getConnectionID()
getConnectionID
in class ClientConnection
@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) 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 void setSizeLimit(int sizeLimit)
setSizeLimit
in class ClientConnection
sizeLimit
- The size limit that will be enforced for
searches performed using this client
connection.public void setLookthroughLimit(int lookthroughLimit)
setLookthroughLimit
in class ClientConnection
lookthroughLimit
- The default maximum number of
entries that should be check for
matches during a search.public void setIdleTimeLimit(long idleTimeLimit)
setIdleTimeLimit
in class ClientConnection
idleTimeLimit
- The maximum length of time in milliseconds
that this client connection will be
allowed to remain idle before it should be
disconnected.public void setTimeLimit(int timeLimit)
setTimeLimit
in class ClientConnection
timeLimit
- The time limit that will be enforced for
searches performed using this client
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.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void sendResponse(Operation operation)
sendResponse
in class ClientConnection
operation
- The operation for which to send the response.public void requestTerminated(int requestMessageId)
ClientConnection
requestTerminated
in class ClientConnection
requestMessageId
- The id of the request message.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void setAuthenticationInfo(AuthenticationInfo authenticationInfo)
setAuthenticationInfo
in class ClientConnection
authenticationInfo
- Information about the authentication
that has been performed for this
connection. It should not be
null
.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void setUnauthenticated()
setUnauthenticated
in class ClientConnection
public org.forgerock.opendj.ldap.messages.Result add(org.forgerock.opendj.ldap.messages.AddRequest request) throws org.forgerock.opendj.ldap.LdapException
request
- The add request to be processed.org.forgerock.opendj.ldap.LdapException
- if result is not successpublic org.forgerock.opendj.ldap.messages.Result processAdd(org.forgerock.opendj.ldap.messages.AddRequest request)
request
- The add request to be processed.public org.forgerock.opendj.ldap.messages.BindResult processBind(org.forgerock.opendj.ldap.messages.BindRequest bindRequest)
bindRequest
- The bind request to be processed.public org.forgerock.opendj.ldap.messages.BindResult bind(org.forgerock.opendj.ldap.messages.BindRequest request) throws org.forgerock.opendj.ldap.LdapException
request
- The bind request to be processed.org.forgerock.opendj.ldap.LdapException
- if result is not successpublic org.forgerock.opendj.ldap.messages.CompareResult compare(org.forgerock.opendj.ldap.messages.CompareRequest request) throws org.forgerock.opendj.ldap.LdapException
request
- The compare request to be processed.org.forgerock.opendj.ldap.LdapException
- if result is not successConnection.compare(CompareRequest)
public org.forgerock.opendj.ldap.messages.Result processDelete(org.forgerock.opendj.ldap.messages.DeleteRequest deleteRequest)
deleteRequest
- The delete request to be processed.public org.forgerock.opendj.ldap.messages.Result delete(org.forgerock.opendj.ldap.messages.DeleteRequest request) throws org.forgerock.opendj.ldap.LdapException
request
- The delete request to be processed.org.forgerock.opendj.ldap.LdapException
- if result is not successConnection.delete(DeleteRequest)
public <R extends org.forgerock.opendj.ldap.messages.ExtendedResult> R extendedRequest(org.forgerock.opendj.ldap.messages.ExtendedRequest<R> request) throws org.forgerock.opendj.ldap.LdapException
R
- the type of the requestsrequest
- the extended request to be processed.org.forgerock.opendj.ldap.LdapException
- if result is not successConnection.extendedRequest(org.forgerock.opendj.ldap.messages.ExtendedRequest<R>)
public org.forgerock.opendj.ldap.messages.Result modify(org.forgerock.opendj.ldap.messages.ModifyRequest request) throws org.forgerock.opendj.ldap.LdapException
request
- The modify request with information about the changes to perform.org.forgerock.opendj.ldap.LdapException
- if result is not successpublic org.forgerock.opendj.ldap.messages.Result processModify(org.forgerock.opendj.ldap.messages.ModifyRequest modifyRequest)
modifyRequest
- The modify request with information about the changes to perform.public org.forgerock.opendj.ldap.messages.Result modifyDn(org.forgerock.opendj.ldap.messages.ModifyDnRequest request) throws org.forgerock.opendj.ldap.LdapException
request
- The modify DN requests with information about the processing to perform.org.forgerock.opendj.ldap.LdapException
- if result is not successpublic org.forgerock.opendj.ldap.messages.Result processModifyDn(org.forgerock.opendj.ldap.messages.ModifyDnRequest modifyDnRequest)
modifyDnRequest
- The modify DN requests with information about the processing to perform.public org.forgerock.opendj.ldap.messages.Result processSearch(org.forgerock.opendj.ldap.messages.SearchRequest request)
request
- The search request.public org.forgerock.opendj.ldap.messages.Result processSearch(org.forgerock.opendj.ldap.messages.SearchRequest searchRequest, org.forgerock.opendj.ldap.SearchResultHandler handler)
searchRequest
- The search request to be processed.handler
- The search result handler that should be used
to handle the matching entries and references.public org.forgerock.opendj.ldap.messages.Result processSearch(org.forgerock.opendj.ldap.messages.SearchRequest searchRequest, Collection<org.forgerock.opendj.ldap.messages.SearchResultEntry> entries)
searchRequest
- The search request.entries
- The collection to which matching entries should be added.public org.forgerock.opendj.ldap.messages.SearchResultEntry searchSingleEntry(org.forgerock.opendj.ldap.messages.SearchRequest request) throws org.forgerock.opendj.ldap.LdapException
If the requested entry is not returned by the Directory Server then the request will fail with
an EntryNotFoundException
. More specifically, this method will never return
null
. If multiple matching entries are returned by the Directory Server then the
request will fail with an MultipleEntriesFoundException
.
request
- The search request.org.forgerock.opendj.ldap.LdapException
- If the result code indicates that the request failed for some reason.UnsupportedOperationException
- If this connection does not support search operations.IllegalStateException
- If this connection has already been closed, i.e. if isClosed() == true
.NullPointerException
- If the request
was null
.public org.forgerock.opendj.ldap.messages.Result search(org.forgerock.opendj.ldap.messages.SearchRequest request, org.forgerock.opendj.ldap.SearchResultHandler handler) throws org.forgerock.opendj.ldap.LdapException
request
- The search request.handler
- The search result handler that should be used to handle the matching entries and
references.org.forgerock.opendj.ldap.LdapException
- if result is not success@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public 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 processing
the entry and the search should be
terminated.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) 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 processing
the entry and the search should be
terminated.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) 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.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) 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.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public Collection<Operation> getOperationsInProgress()
getOperationsInProgress
in class ClientConnection
@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) 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.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public boolean removeOperationInProgress(int messageID)
removeOperationInProgress
in class ClientConnection
messageID
- The message ID of the operation to remove from
the set of operations in progress.true
if the operation was found and removed
from the set of operations in progress, or
false
if not.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public CancelResult cancelOperation(int messageID, CancelRequest cancelRequest)
cancelOperation
in class ClientConnection
messageID
- The message ID of the operation to cancel.cancelRequest
- An object providing additional information
about how the cancel should be processed.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void cancelAllOperations(CancelRequest cancelRequest)
cancelAllOperations
in class ClientConnection
cancelRequest
- An object providing additional information
about how the cancel should be processed.@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void cancelAllOperationsExcept(CancelRequest cancelRequest, int messageID)
cancelAllOperationsExcept
in class ClientConnection
cancelRequest
- An object providing additional information
about how the cancel should be processed.messageID
- The message ID of the operation that
should not be canceled.public String getMonitorSummary()
getMonitorSummary
in class ClientConnection
public void toString(StringBuilder buffer)
toString
in class ClientConnection
buffer
- The buffer to which the information should be
appended.public long getNumberOfOperations()
getNumberOfOperations
in class ClientConnection
public int getSSF()
ClientConnection
getSSF
in class ClientConnection
Copyright © 2010-2017 ForgeRock AS. All Rights Reserved.