public class SearchOperationBasis extends AbstractOperation implements SearchOperation, PreOperationSearchOperation, PreParseSearchOperation, PostOperationSearchOperation, PostResponseSearchOperation, SearchEntrySearchOperation, SearchReferenceSearchOperation
NO_RESPONSE_CONTROLS, requestContext
Constructor and Description |
---|
SearchOperationBasis(org.forgerock.services.context.Context context,
SearchRequest request)
Creates a new search operation with the provided information.
|
Modifier and Type | Method and Description |
---|---|
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.
|
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.
|
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.
|
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)
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 |
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)
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.
|
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(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(ByteString rawBaseDN)
Specifies the raw, unprocessed base DN as included in the request from the client.
|
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(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, addPostReadResponse, addPreReadResponse, addRequestControl, appendErrorMessage, appendMaskedErrorMessage, checkAttributeConformsToSyntax, checkIfBackendIsWritable, checkIfCanceled, disconnectClient, dontSynchronize, equals, evaluateProxyAuthControls, filterNonDisclosableMatchedDN, findMatchedDN, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getClientConnection, getConnectionID, getContext, getErrorMessage, getLocalBackend, getMaskedErrorMessage, getMaskedResultCode, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControl, getRequestControls, getResultCode, hashCode, invokePostResponseCallbacks, isHumanReadable, isInnerOperation, isInternalOperation, isProxyAuthzControl, isSynchronizationOperation, mustCheckSchema, newDirectoryException, operationCompleted, processOperationResult, processOperationResult, registerPostResponseCallback, removeAllDisallowedControls, removeAttachment, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInnerOperation, setInternalOperation, setMaskedErrorMessage, setMaskedResultCode, setMatchedDN, setProcessingStartTime, setProcessingStopTime, setReferralURLs, setResponseData, setResult, setResultCode, setResultCodeAndMessageNoInfoDisclosure, setSynchronizationOperation, toString
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
addAdditionalLogItem, addRequestControl, appendErrorMessage, appendMaskedErrorMessage, disconnectClient, dontSynchronize, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getClientConnection, getConnectionID, getContext, 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, setResult, setResultCode, setSynchronizationOperation, toString
addAdditionalLogItem, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, setErrorMessage
addAdditionalLogItem, addRequestControl, appendErrorMessage, getAdditionalLogItems, getErrorMessage, setErrorMessage
addAdditionalLogItem, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getReferralURLs, getResultCode, setErrorMessage, setMatchedDN, setReferralURLs, setResponseData, setResultCode
getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getProcessingStopTime, getProcessingTime, getReferralURLs, getResultCode
addAdditionalLogItem, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getReferralURLs, getResultCode, setErrorMessage, setMatchedDN, setReferralURLs, setResponseData, setResultCode
checkIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getProcessingStartTime, getRequestControl, getRequestControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toString
public SearchOperationBasis(org.forgerock.services.context.Context context, SearchRequest request)
context
- The request context with which this operation is associated.request
- The search request.public final ByteString getRawBaseDN()
SearchOperation
getRawBaseDN
in interface SearchOperation
getRawBaseDN
in interface PostOperationSearchOperation
getRawBaseDN
in interface PostResponseSearchOperation
getRawBaseDN
in interface PreOperationSearchOperation
getRawBaseDN
in interface PreParseSearchOperation
getRawBaseDN
in interface SearchEntrySearchOperation
getRawBaseDN
in interface SearchReferenceSearchOperation
public final void setRawBaseDN(ByteString rawBaseDN)
SearchOperation
setRawBaseDN
in interface SearchOperation
setRawBaseDN
in interface PreParseSearchOperation
rawBaseDN
- The raw, unprocessed base DN as included in the request from the client.public final Dn getBaseDN()
SearchOperation
getRawBaseDN
method.getBaseDN
in interface SearchOperation
getBaseDN
in interface PostOperationSearchOperation
getBaseDN
in interface PostResponseSearchOperation
getBaseDN
in interface PreOperationSearchOperation
getBaseDN
in interface SearchEntrySearchOperation
getBaseDN
in interface SearchReferenceSearchOperation
null
if the raw base DN has not yet been
processed.public final void setBaseDN(Dn baseDN)
SearchOperation
setBaseDN
in interface SearchOperation
baseDN
- The base DN for this search operation.public final SearchScope getScope()
SearchOperation
getScope
in interface SearchOperation
getScope
in interface PostOperationSearchOperation
getScope
in interface PostResponseSearchOperation
getScope
in interface PreOperationSearchOperation
getScope
in interface PreParseSearchOperation
getScope
in interface SearchEntrySearchOperation
getScope
in interface SearchReferenceSearchOperation
public final void setScope(SearchScope scope)
SearchOperation
setScope
in interface SearchOperation
setScope
in interface PreParseSearchOperation
scope
- The scope for this search operation.public final DereferenceAliasesPolicy getDerefPolicy()
SearchOperation
getDerefPolicy
in interface SearchOperation
getDerefPolicy
in interface PostOperationSearchOperation
getDerefPolicy
in interface PostResponseSearchOperation
getDerefPolicy
in interface PreOperationSearchOperation
getDerefPolicy
in interface PreParseSearchOperation
getDerefPolicy
in interface SearchEntrySearchOperation
getDerefPolicy
in interface SearchReferenceSearchOperation
public final void setDerefPolicy(DereferenceAliasesPolicy derefPolicy)
SearchOperation
setDerefPolicy
in interface SearchOperation
setDerefPolicy
in interface PreParseSearchOperation
derefPolicy
- The alias dereferencing policy for this search operation.public final int getSizeLimit()
SearchOperation
getSizeLimit
in interface SearchOperation
getSizeLimit
in interface PostOperationSearchOperation
getSizeLimit
in interface PostResponseSearchOperation
getSizeLimit
in interface PreOperationSearchOperation
getSizeLimit
in interface PreParseSearchOperation
getSizeLimit
in interface SearchEntrySearchOperation
getSizeLimit
in interface SearchReferenceSearchOperation
public final void setSizeLimit(int sizeLimit)
SearchOperation
setSizeLimit
in interface SearchOperation
setSizeLimit
in interface PreParseSearchOperation
sizeLimit
- The size limit for this search operation.public final int getTimeLimit()
SearchOperation
getTimeLimit
in interface SearchOperation
getTimeLimit
in interface PostOperationSearchOperation
getTimeLimit
in interface PostResponseSearchOperation
getTimeLimit
in interface PreOperationSearchOperation
getTimeLimit
in interface PreParseSearchOperation
getTimeLimit
in interface SearchEntrySearchOperation
getTimeLimit
in interface SearchReferenceSearchOperation
public final void setTimeLimit(int timeLimit)
SearchOperation
setTimeLimit
in interface SearchOperation
setTimeLimit
in interface PreParseSearchOperation
timeLimit
- The time limit for this search operation.public final boolean getTypesOnly()
SearchOperation
getTypesOnly
in interface SearchOperation
getTypesOnly
in interface PostOperationSearchOperation
getTypesOnly
in interface PostResponseSearchOperation
getTypesOnly
in interface PreOperationSearchOperation
getTypesOnly
in interface PreParseSearchOperation
getTypesOnly
in interface SearchEntrySearchOperation
getTypesOnly
in interface SearchReferenceSearchOperation
public final void setTypesOnly(boolean typesOnly)
SearchOperation
setTypesOnly
in interface SearchOperation
setTypesOnly
in interface PreParseSearchOperation
typesOnly
- The typesOnly flag for this search operation.public final RawFilter getRawFilter()
SearchOperation
getRawFilter
in interface SearchOperation
getRawFilter
in interface PostOperationSearchOperation
getRawFilter
in interface PostResponseSearchOperation
getRawFilter
in interface PreOperationSearchOperation
getRawFilter
in interface PreParseSearchOperation
getRawFilter
in interface SearchEntrySearchOperation
getRawFilter
in interface SearchReferenceSearchOperation
public final void setRawFilter(RawFilter rawFilter)
SearchOperation
setRawFilter
in interface SearchOperation
setRawFilter
in interface PreParseSearchOperation
rawFilter
- The raw, unprocessed search filter as included in the request from the client.public final SearchFilter getFilter()
SearchOperation
getFilter
in interface SearchOperation
getFilter
in interface PostOperationSearchOperation
getFilter
in interface PostResponseSearchOperation
getFilter
in interface PreOperationSearchOperation
getFilter
in interface SearchEntrySearchOperation
getFilter
in interface SearchReferenceSearchOperation
null
if the raw filter has not yet been processed.public final Set<String> getAttributes()
SearchOperation
getAttributes
in interface SearchOperation
getAttributes
in interface PostOperationSearchOperation
getAttributes
in interface PostResponseSearchOperation
getAttributes
in interface PreOperationSearchOperation
getAttributes
in interface PreParseSearchOperation
getAttributes
in interface SearchEntrySearchOperation
getAttributes
in interface SearchReferenceSearchOperation
public final void setAttributes(Set<String> attributes)
SearchOperation
setAttributes
in interface SearchOperation
setAttributes
in interface PreParseSearchOperation
attributes
- The set of requested attributes for this search operation.public final int getEntriesSent()
SearchOperation
getEntriesSent
in interface SearchOperation
getEntriesSent
in interface PostOperationSearchOperation
getEntriesSent
in interface PostResponseSearchOperation
public final int getReferencesSent()
SearchOperation
getReferencesSent
in interface SearchOperation
getReferencesSent
in interface PostOperationSearchOperation
getReferencesSent
in interface PostResponseSearchOperation
public final boolean returnEntry(Entry entry, List<Control> controls)
SearchOperation
returnEntry
in interface SearchOperation
returnEntry
in interface PreOperationSearchOperation
returnEntry
in interface PreParseSearchOperation
entry
- 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).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)
SearchOperation
returnEntry
in interface SearchOperation
entry
- 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)
SearchOperation
returnReference
in interface SearchOperation
returnReference
in interface PreOperationSearchOperation
returnReference
in interface PreParseSearchOperation
dn
- The DN related to the specified search reference.reference
- The search reference to send to the client.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)
SearchOperation
returnReference
in interface SearchOperation
dn
- 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()
SearchOperation
sendSearchResultDone
in interface SearchOperation
public final OperationType getOperationType()
Operation
getOperationType
in interface Operation
getOperationType
in interface PluginOperation
public Dn getProxiedAuthorizationDN()
SearchOperation
getProxiedAuthorizationDN
in interface SearchOperation
getProxiedAuthorizationDN
in interface Operation
null
if proxied authorization has not been requested.public final List<Control> getResponseControls()
Operation
getResponseControls
in interface Operation
getResponseControls
in interface PluginOperation
public final void addResponseControl(Control control)
Operation
addResponseControl
in interface Operation
addResponseControl
in interface InProgressOperation
addResponseControl
in interface PostOperationOperation
addResponseControl
in interface PreOperationOperation
addResponseControl
in interface PreParseOperation
control
- The control to add to the set of controls to include in the response to the client.public final void removeResponseControl(Control control)
Operation
removeResponseControl
in interface Operation
removeResponseControl
in interface InProgressOperation
removeResponseControl
in interface PostOperationOperation
removeResponseControl
in interface PreOperationOperation
removeResponseControl
in interface PreParseOperation
control
- The control to remove from the set of controls to include in the response to the client.public final void toString(StringBuilder buffer)
Operation
toString
in interface Operation
toString
in interface PluginOperation
buffer
- The buffer into which a string representation of this operation should be appended.public void setTimeLimitExpiration(long timeLimitExpiration)
SearchOperation
setTimeLimitExpiration
in interface SearchOperation
timeLimitExpiration
- - Time after which the search has expiredpublic boolean isReturnSubentriesOnly()
SearchOperation
isReturnSubentriesOnly
in interface SearchOperation
public void setReturnSubentriesOnly(boolean returnLDAPSubentries)
SearchOperation
setReturnSubentriesOnly
in interface SearchOperation
returnLDAPSubentries
- - Boolean indicating whether the LDAP subentries should be returned or notpublic MatchedValuesControl getMatchedValuesControl()
SearchOperation
getMatchedValuesControl
in interface SearchOperation
public void setMatchedValuesControl(MatchedValuesControl controls)
SearchOperation
setMatchedValuesControl
in interface SearchOperation
controls
- - The matched values controlpublic boolean isIncludeUsableControl()
SearchOperation
isIncludeUsableControl
in interface SearchOperation
public void setIncludeUsableControl(boolean includeUsableControl)
SearchOperation
setIncludeUsableControl
in interface SearchOperation
includeUsableControl
- - True if the account usable response control has to be included within the search result entries,
false otherwisepublic long getTimeLimitExpiration()
SearchOperation
getTimeLimitExpiration
in interface SearchOperation
public boolean isClientAcceptsReferrals()
SearchOperation
isClientAcceptsReferrals
in interface SearchOperation
public void setClientAcceptsReferrals(boolean clientAcceptReferrals)
SearchOperation
setClientAcceptsReferrals
in interface SearchOperation
clientAcceptReferrals
- - Boolean set to true if the client can handle referralspublic boolean isSendResponse()
SearchOperation
isSendResponse
in interface SearchOperation
public void setSendResponse(boolean sendResponse)
SearchOperation
setSendResponse
in interface SearchOperation
sendResponse
- - boolean indicating whether the search result done message is to send to the clientpublic boolean isRealAttributesOnly()
SearchOperation
isRealAttributesOnly
in interface SearchOperation
public boolean isVirtualAttributesOnly()
SearchOperation
isVirtualAttributesOnly
in interface SearchOperation
public void setRealAttributesOnly(boolean realAttributesOnly)
SearchOperation
setRealAttributesOnly
in interface SearchOperation
realAttributesOnly
- - boolean setup to true, if only the real attributes should be returnedpublic void setVirtualAttributesOnly(boolean virtualAttributesOnly)
SearchOperation
setVirtualAttributesOnly
in interface SearchOperation
virtualAttributesOnly
- - boolean setup to true, if only the virtual attributes should be returnedpublic void sendSearchEntry(SearchResultEntry searchEntry) throws DirectoryException
SearchOperation
sendSearchEntry
in interface SearchOperation
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(SearchResultReference searchReference) throws DirectoryException
SearchOperation
sendSearchReference
in interface SearchOperation
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.public void setProxiedAuthorizationDN(Dn proxiedAuthorizationDN)
SearchOperation
setProxiedAuthorizationDN
in interface SearchOperation
setProxiedAuthorizationDN
in interface Operation
proxiedAuthorizationDN
- 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()
Operation
public void updateOperationErrMsgAndResCode()
AbstractOperation
updateOperationErrMsgAndResCode
in class AbstractOperation
Copyright 2010-2020 ForgeRock AS.