public class SearchOperationBasis extends AbstractOperation implements PreParseSearchOperation, PostResponseSearchOperation, SearchEntrySearchOperation, SearchReferenceSearchOperation, SearchOperation
cancelRequest, cancelResult, clientConnection, messageID, NO_RESPONSE_CONTROLS, operationIDLOCALBACKENDOPERATIONS| Constructor and Description |
|---|
SearchOperationBasis(ClientConnection clientConnection,
long operationID,
int messageID,
List<Control> requestControls,
org.forgerock.opendj.ldap.ByteString rawBaseDN,
org.forgerock.opendj.ldap.SearchScope scope,
org.forgerock.opendj.ldap.DereferenceAliasesPolicy derefPolicy,
int sizeLimit,
int timeLimit,
boolean typesOnly,
RawFilter rawFilter,
Set<String> attributes)
Creates a new search operation with the provided information.
|
SearchOperationBasis(ClientConnection clientConnection,
long operationID,
int messageID,
List<Control> requestControls,
DN baseDN,
org.forgerock.opendj.ldap.SearchScope scope,
org.forgerock.opendj.ldap.DereferenceAliasesPolicy derefPolicy,
int sizeLimit,
int timeLimit,
boolean typesOnly,
SearchFilter filter,
Set<String> attributes)
Creates a new search operation with the provided information.
|
| Modifier and Type | Method and Description |
|---|---|
void |
abort(CancelRequest cancelRequest)
Attempts to abort this operation before processing has
completed.
|
void |
addResponseControl(Control control)
Adds the provided control to the set of controls to include in
the response to the client.
|
Set<String> |
getAttributes()
Retrieves the set of requested attributes for this search
operation.
|
DN |
getBaseDN()
Retrieves the base DN for this search operation.
|
org.forgerock.opendj.ldap.DereferenceAliasesPolicy |
getDerefPolicy()
Retrieves the alias dereferencing policy for this search
operation.
|
int |
getEntriesSent()
Retrieves the number of entries sent to the client for this
search operation.
|
SearchFilter |
getFilter()
Retrieves the filter for this search operation.
|
MatchedValuesControl |
getMatchedValuesControl()
The matched values control associated with this search operation.
|
OperationType |
getOperationType()
Retrieves the operation type for this operation.
|
DN |
getProxiedAuthorizationDN()
Retrieves the proxied authorization DN for this operation if proxied
authorization has been requested.
|
org.forgerock.opendj.ldap.ByteString |
getRawBaseDN()
Retrieves the raw, unprocessed base DN as included in the request
from the client.
|
RawFilter |
getRawFilter()
Retrieves the raw, unprocessed search filter as included in the
request from the client.
|
int |
getReferencesSent()
Retrieves the number of search references sent to the client for
this search operation.
|
List<Control> |
getResponseControls()
Retrieves the set of controls to include in the response to the
client.
|
org.forgerock.opendj.ldap.SearchScope |
getScope()
Retrieves the scope for this search operation.
|
int |
getSizeLimit()
Retrieves the size limit for this search operation.
|
int |
getTimeLimit()
Retrieves the time limit for this search operation.
|
long |
getTimeLimitExpiration()
Get the time after which the search time limit has expired.
|
boolean |
getTypesOnly()
Retrieves the typesOnly flag for this search operation.
|
boolean |
isClientAcceptsReferrals()
Indicates whether the client is able to handle referrals.
|
boolean |
isIncludeUsableControl()
Indicates whether to include the account usable response control with
search result entries or not.
|
boolean |
isRealAttributesOnly()
Returns true if only real attributes should be returned.
|
boolean |
isReturnSubentriesOnly()
Indicates whether LDAP subentries should be returned or not.
|
boolean |
isSendResponse()
Indicates whether the search result done message has to be sent
to the client, or not.
|
boolean |
isVirtualAttributesOnly()
Returns true if only virtual attributes should be returned.
|
void |
removeResponseControl(Control control)
Removes the provided control from the set of controls to include
in the response to the client.
|
boolean |
returnEntry(Entry entry,
List<Control> controls)
Returns the provided entry to the client.
|
boolean |
returnEntry(Entry entry,
List<Control> controls,
boolean evaluateAci)
Used as a callback for backends to indicate that the provided entry matches
the search criteria and that additional processing should be performed to
potentially send it back to the client.
|
boolean |
returnReference(DN dn,
SearchResultReference reference)
Returns the provided search result reference to the client.
|
boolean |
returnReference(DN dn,
SearchResultReference reference,
boolean evaluateAci)
Used as a callback for backends to indicate that the provided search
reference was encountered during processing and that additional processing
should be performed to potentially send it back to the client.
|
void |
run()
Performs the work of actually processing this operation.
|
void |
sendSearchEntry(SearchResultEntry searchEntry)
Sends the provided search result entry to the client.
|
boolean |
sendSearchReference(SearchResultReference searchReference)
Sends the provided search result reference to the client.
|
void |
sendSearchResultDone()
Sends the search result done message to the client.
|
void |
setAttributes(Set<String> attributes)
Specifies the set of requested attributes for this search
operation.
|
void |
setBaseDN(DN baseDN)
Specifies the base DN for this search operation.
|
void |
setClientAcceptsReferrals(boolean clientAcceptReferrals)
Specify whether the client is able to handle referrals.
|
void |
setDerefPolicy(org.forgerock.opendj.ldap.DereferenceAliasesPolicy derefPolicy)
Specifies the alias dereferencing policy for this search
operation.
|
void |
setIncludeUsableControl(boolean includeUsableControl)
Specify whether to include the account usable response control within the
search result entries.
|
void |
setMatchedValuesControl(MatchedValuesControl controls)
Set the match values control.
|
void |
setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
Set the proxied authorization DN for this operation if proxied
authorization has been requested.
|
void |
setRawBaseDN(org.forgerock.opendj.ldap.ByteString rawBaseDN)
Specifies the raw, unprocessed base DN for this search operation.
|
void |
setRawFilter(RawFilter rawFilter)
Specifies the raw, unprocessed search filter as included in the
request from the client.
|
void |
setRealAttributesOnly(boolean realAttributesOnly)
Specify whether to only return real attributes.
|
void |
setReturnSubentriesOnly(boolean returnLDAPSubentries)
Set the flag indicating whether the LDAP subentries should be returned.
|
void |
setScope(org.forgerock.opendj.ldap.SearchScope scope)
Specifies the scope for this search operation.
|
void |
setSendResponse(boolean sendResponse)
Specify whether the search result done message has to be sent
to the client, or not.
|
void |
setSizeLimit(int sizeLimit)
Specifies the size limit for this search operation.
|
void |
setTimeLimit(int timeLimit)
Specifies the time limit for this search operation.
|
void |
setTimeLimitExpiration(long timeLimitExpiration)
Set the time after which the search time limit has expired.
|
void |
setTypesOnly(boolean typesOnly)
Specifies the typesOnly flag for this search operation.
|
void |
setVirtualAttributesOnly(boolean virtualAttributesOnly)
Specify whether to only return virtual attributes.
|
void |
toString(StringBuilder buffer)
Appends a string representation of this operation to the provided
buffer.
|
void |
updateOperationErrMsgAndResCode()
Updates the error message and the result code of the operation.
|
addAdditionalLogItem, addRequestControl, appendErrorMessage, appendMaskedErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, equals, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getConnectionID, getErrorMessage, getMaskedErrorMessage, getMaskedResultCode, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControl, getRequestControls, getResultCode, hashCode, invokePostResponseCallbacks, isInnerOperation, isInternalOperation, isSynchronizationOperation, operationCompleted, processOperationResult, processOperationResult, registerPostResponseCallback, removeAttachment, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInnerOperation, setInternalOperation, setMaskedErrorMessage, setMaskedResultCode, setMatchedDN, setProcessingStartTime, setProcessingStopTime, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddAdditionalLogItem, addRequestControl, appendErrorMessage, getAdditionalLogItems, getErrorMessage, setErrorMessagegetAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getProcessingStopTime, getProcessingTime, getReferralURLs, getResultCodeaddAdditionalLogItem, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getReferralURLs, getResultCode, setErrorMessage, setMatchedDN, setReferralURLs, setResponseData, setResultCodecheckIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getProcessingStartTime, getRequestControl, getRequestControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toStringaddAdditionalLogItem, addRequestControl, appendErrorMessage, appendMaskedErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getConnectionID, getErrorMessage, getMaskedErrorMessage, getMaskedResultCode, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControl, getRequestControls, getResultCode, isInnerOperation, isInternalOperation, isSynchronizationOperation, operationCompleted, registerPostResponseCallback, removeAttachment, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInnerOperation, setInternalOperation, setMaskedErrorMessage, setMaskedResultCode, setMatchedDN, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toStringpublic SearchOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, org.forgerock.opendj.ldap.ByteString rawBaseDN, org.forgerock.opendj.ldap.SearchScope scope, org.forgerock.opendj.ldap.DereferenceAliasesPolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, RawFilter rawFilter, Set<String> attributes)
clientConnection - The client connection with which this operation
is associated.operationID - The operation ID for this operation.messageID - The message ID of the request with which this
operation is associated.requestControls - The set of controls included in the request.rawBaseDN - The raw, unprocessed base DN as included in the
request from the client.scope - The scope for this search operation.derefPolicy - The alias dereferencing policy for this search
operation.sizeLimit - The size limit for this search operation.timeLimit - The time limit for this search operation.typesOnly - The typesOnly flag for this search operation.rawFilter - the raw, unprocessed filter as included in the
request from the client.attributes - The requested attributes for this search
operation.public SearchOperationBasis(ClientConnection clientConnection, long operationID, int messageID, List<Control> requestControls, DN baseDN, org.forgerock.opendj.ldap.SearchScope scope, org.forgerock.opendj.ldap.DereferenceAliasesPolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, SearchFilter filter, Set<String> attributes)
clientConnection - The client connection with which this operation
is associated.operationID - The operation ID for this operation.messageID - The message ID of the request with which this
operation is associated.requestControls - The set of controls included in the request.baseDN - The base DN for this search operation.scope - The scope for this search operation.derefPolicy - The alias dereferencing policy for this search
operation.sizeLimit - The size limit for this search operation.timeLimit - The time limit for this search operation.typesOnly - The typesOnly flag for this search operation.filter - The filter for this search operation.attributes - The attributes for this search operation.public final org.forgerock.opendj.ldap.ByteString getRawBaseDN()
PreParseSearchOperationgetRawBaseDN in interface SearchOperationgetRawBaseDN in interface PostResponseSearchOperationgetRawBaseDN in interface PreParseSearchOperationgetRawBaseDN in interface SearchEntrySearchOperationgetRawBaseDN in interface SearchReferenceSearchOperationpublic final void setRawBaseDN(org.forgerock.opendj.ldap.ByteString rawBaseDN)
PreParseSearchOperationsetRawBaseDN in interface SearchOperationsetRawBaseDN in interface PreParseSearchOperationrawBaseDN - The raw, unprocessed base DN for this search
operation.public final DN getBaseDN()
PostResponseSearchOperationgetBaseDN in interface SearchOperationgetBaseDN in interface PostResponseSearchOperationgetBaseDN in interface SearchEntrySearchOperationgetBaseDN in interface SearchReferenceSearchOperationpublic final void setBaseDN(DN baseDN)
SearchOperationsetBaseDN in interface SearchOperationbaseDN - The base DN for this search operation.public final org.forgerock.opendj.ldap.SearchScope getScope()
PreParseSearchOperationgetScope in interface SearchOperationgetScope in interface PostResponseSearchOperationgetScope in interface PreParseSearchOperationgetScope in interface SearchEntrySearchOperationgetScope in interface SearchReferenceSearchOperationpublic final void setScope(org.forgerock.opendj.ldap.SearchScope scope)
PreParseSearchOperationsetScope in interface SearchOperationsetScope in interface PreParseSearchOperationscope - The scope for this search operation.public final org.forgerock.opendj.ldap.DereferenceAliasesPolicy getDerefPolicy()
PreParseSearchOperationgetDerefPolicy in interface SearchOperationgetDerefPolicy in interface PostResponseSearchOperationgetDerefPolicy in interface PreParseSearchOperationgetDerefPolicy in interface SearchEntrySearchOperationgetDerefPolicy in interface SearchReferenceSearchOperationpublic final void setDerefPolicy(org.forgerock.opendj.ldap.DereferenceAliasesPolicy derefPolicy)
PreParseSearchOperationsetDerefPolicy in interface SearchOperationsetDerefPolicy in interface PreParseSearchOperationderefPolicy - The alias dereferencing policy for this
search operation.public final int getSizeLimit()
PreParseSearchOperationgetSizeLimit in interface SearchOperationgetSizeLimit in interface PostResponseSearchOperationgetSizeLimit in interface PreParseSearchOperationgetSizeLimit in interface SearchEntrySearchOperationgetSizeLimit in interface SearchReferenceSearchOperationpublic final void setSizeLimit(int sizeLimit)
PreParseSearchOperationsetSizeLimit in interface SearchOperationsetSizeLimit in interface PreParseSearchOperationsizeLimit - The size limit for this search operation.public final int getTimeLimit()
PreParseSearchOperationgetTimeLimit in interface SearchOperationgetTimeLimit in interface PostResponseSearchOperationgetTimeLimit in interface PreParseSearchOperationgetTimeLimit in interface SearchEntrySearchOperationgetTimeLimit in interface SearchReferenceSearchOperationpublic final void setTimeLimit(int timeLimit)
PreParseSearchOperationsetTimeLimit in interface SearchOperationsetTimeLimit in interface PreParseSearchOperationtimeLimit - The time limit for this search operation.public final boolean getTypesOnly()
PreParseSearchOperationgetTypesOnly in interface SearchOperationgetTypesOnly in interface PostResponseSearchOperationgetTypesOnly in interface PreParseSearchOperationgetTypesOnly in interface SearchEntrySearchOperationgetTypesOnly in interface SearchReferenceSearchOperationpublic final void setTypesOnly(boolean typesOnly)
PreParseSearchOperationsetTypesOnly in interface SearchOperationsetTypesOnly in interface PreParseSearchOperationtypesOnly - The typesOnly flag for this search operation.public final RawFilter getRawFilter()
PreParseSearchOperationgetRawFilter in interface SearchOperationgetRawFilter in interface PostResponseSearchOperationgetRawFilter in interface PreParseSearchOperationgetRawFilter in interface SearchEntrySearchOperationgetRawFilter in interface SearchReferenceSearchOperationpublic final void setRawFilter(RawFilter rawFilter)
PreParseSearchOperationsetRawFilter in interface SearchOperationsetRawFilter in interface PreParseSearchOperationrawFilter - The raw, unprocessed search filter.public final SearchFilter getFilter()
PostResponseSearchOperationgetFilter in interface SearchOperationgetFilter in interface PostResponseSearchOperationgetFilter in interface SearchEntrySearchOperationgetFilter in interface SearchReferenceSearchOperationpublic final Set<String> getAttributes()
PreParseSearchOperationgetAttributes in interface SearchOperationgetAttributes in interface PostResponseSearchOperationgetAttributes in interface PreParseSearchOperationgetAttributes in interface SearchEntrySearchOperationgetAttributes in interface SearchReferenceSearchOperationpublic final void setAttributes(Set<String> attributes)
PreParseSearchOperationsetAttributes in interface SearchOperationsetAttributes in interface PreParseSearchOperationattributes - The set of requested attributes for this
search operation.public final int getEntriesSent()
PostResponseSearchOperationgetEntriesSent in interface SearchOperationgetEntriesSent in interface PostResponseSearchOperationpublic final int getReferencesSent()
PostResponseSearchOperationgetReferencesSent in interface SearchOperationgetReferencesSent in interface PostResponseSearchOperationpublic final boolean returnEntry(Entry entry, List<Control> controls)
PreParseSearchOperationreturnEntry in interface SearchOperationreturnEntry in interface PreParseSearchOperationentry - The entry that should be returned.controls - The set of controls to include with the entry
(may be null if no controls should be
included with the entry).true if the caller should continue processing
the search request and sending additional entries and
references, or false if not for some reason
(e.g., the size limit has been reached or the search has
been abandoned).public final boolean returnEntry(Entry entry, List<Control> controls, boolean evaluateAci)
SearchOperationreturnEntry in interface SearchOperationentry - The entry that matches the search criteria and should
be sent to the client.controls - The set of controls to include with the entry (may be
null if none are needed).evaluateAci - Indicates whether the access rights to the entry
should be evaluated.true if the caller should continue processing the
search request and sending additional entries and references, or
false if not for some reason (e.g., the size limit
has been reached or the search has been abandoned).public final boolean returnReference(DN dn, SearchResultReference reference)
PreParseSearchOperationreturnReference in interface SearchOperationreturnReference in interface PreParseSearchOperationdn - A DN related to the specified search reference.reference - The search reference that should be returned.true if the caller should continue processing
the search request and sending additional entries and
references, or false if not for some reason
(e.g., the size limit has been reached or the search has
been abandoned).public final boolean returnReference(DN dn, SearchResultReference reference, boolean evaluateAci)
SearchOperationreturnReference in interface SearchOperationdn - The DN related to the specified search reference.reference - The search reference to send to the client.evaluateAci - Indicates whether the access rights to the entry
should be evaluated.true if the caller should continue processing the
search request and sending additional entries and references , or
false if not for some reason (e.g., the size limit
has been reached or the search has been abandoned).public final void sendSearchResultDone()
SearchOperationsendSearchResultDone in interface SearchOperationpublic final OperationType getOperationType()
PluginOperationgetOperationType in interface OperationgetOperationType in interface PluginOperationpublic DN getProxiedAuthorizationDN()
SearchOperationgetProxiedAuthorizationDN in interface SearchOperationgetProxiedAuthorizationDN in interface Operationnull if proxied
authorization has not been requested.public final List<Control> getResponseControls()
PluginOperationgetResponseControls in interface OperationgetResponseControls in interface PluginOperationpublic final void addResponseControl(Control control)
PreParseOperationaddResponseControl in interface OperationaddResponseControl in interface InProgressOperationaddResponseControl in interface PreParseOperationcontrol - The control to add to the set of controls to
include in the response to the client.public final void removeResponseControl(Control control)
PreParseOperationremoveResponseControl in interface OperationremoveResponseControl in interface InProgressOperationremoveResponseControl in interface PreParseOperationcontrol - The control to remove from the set of controls
to include in the response to the client.public void abort(CancelRequest cancelRequest)
Operationabort in interface Operationabort in class AbstractOperationcancelRequest - Information about the way in which the
operation should be canceled.public final void toString(StringBuilder buffer)
PluginOperationtoString in interface OperationtoString in interface PluginOperationbuffer - The buffer into which a string representation of
this operation should be appended.public void setTimeLimitExpiration(long timeLimitExpiration)
SearchOperationsetTimeLimitExpiration in interface SearchOperationtimeLimitExpiration - - Time after which the search has expiredpublic boolean isReturnSubentriesOnly()
SearchOperationisReturnSubentriesOnly in interface SearchOperationpublic void setReturnSubentriesOnly(boolean returnLDAPSubentries)
SearchOperationsetReturnSubentriesOnly in interface SearchOperationreturnLDAPSubentries - - Boolean indicating whether the LDAP
subentries should be returned or notpublic MatchedValuesControl getMatchedValuesControl()
SearchOperationgetMatchedValuesControl in interface SearchOperationpublic void setMatchedValuesControl(MatchedValuesControl controls)
SearchOperationsetMatchedValuesControl in interface SearchOperationcontrols - - The matched values controlpublic boolean isIncludeUsableControl()
SearchOperationisIncludeUsableControl in interface SearchOperationpublic void setIncludeUsableControl(boolean includeUsableControl)
SearchOperationsetIncludeUsableControl in interface SearchOperationincludeUsableControl - - True if the account usable response control
has to be included within the search result
entries, false otherwisepublic long getTimeLimitExpiration()
SearchOperationgetTimeLimitExpiration in interface SearchOperationpublic boolean isClientAcceptsReferrals()
SearchOperationisClientAcceptsReferrals in interface SearchOperationpublic void setClientAcceptsReferrals(boolean clientAcceptReferrals)
SearchOperationsetClientAcceptsReferrals in interface SearchOperationclientAcceptReferrals - - Boolean set to true if the client
can handle referralspublic boolean isSendResponse()
SearchOperationisSendResponse in interface SearchOperationpublic void setSendResponse(boolean sendResponse)
SearchOperationsetSendResponse in interface SearchOperationsendResponse - - boolean indicating whether the search result done
message is to send to the clientpublic boolean isRealAttributesOnly()
SearchOperationisRealAttributesOnly in interface SearchOperationpublic boolean isVirtualAttributesOnly()
SearchOperationisVirtualAttributesOnly in interface SearchOperationpublic void setRealAttributesOnly(boolean realAttributesOnly)
SearchOperationsetRealAttributesOnly in interface SearchOperationrealAttributesOnly - - boolean setup to true, if only the real
attributes should be returnedpublic void setVirtualAttributesOnly(boolean virtualAttributesOnly)
SearchOperationsetVirtualAttributesOnly in interface SearchOperationvirtualAttributesOnly - - boolean setup to true, if only the virtual
attributes should be returnedpublic void sendSearchEntry(SearchResultEntry searchEntry) throws DirectoryException
SearchOperationsendSearchEntry in interface SearchOperationsearchEntry - 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(SearchResultReference searchReference) throws DirectoryException
SearchOperationsendSearchReference in interface SearchOperationsearchReference - 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.public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
SearchOperationsetProxiedAuthorizationDN in interface SearchOperationsetProxiedAuthorizationDN in interface OperationproxiedAuthorizationDN - The proxied authorization DN for this operation if proxied
authorization has been requested, or null if proxied
authorization has not been requested.public final void run()
Operationpublic void updateOperationErrMsgAndResCode()
AbstractOperationupdateOperationErrMsgAndResCode in class AbstractOperationCopyright © 2010-2015 ForgeRock AS. All Rights Reserved.