Package org.opends.server.core
Interface SearchOperation
-
- All Known Implementing Classes:
InternalSearchOperation,LocalBackendSearchOperation,SearchOperationBasis,SearchOperationWrapper
public interface SearchOperation extends Operation
This interface defines an operation used to search for entries in the Directory Server.
-
-
Field Summary
-
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidendSearchPhase()Indicates that the search phase is over and that any further entry comes from a persistent search.Set<String>getAttributes()Retrieves the set of requested attributes for this search operation.DNgetBaseDN()Retrieves the base DN for this search operation.DereferenceAliasesPolicygetDerefPolicy()Retrieves the alias dereferencing policy for this search operation.intgetEntriesSent()Retrieves the number of entries sent to the client for this search operation.SearchFiltergetFilter()Retrieves the filter for this search operation.MatchedValuesControlgetMatchedValuesControl()The matched values control associated with this search operation.DNgetProxiedAuthorizationDN()Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.ByteStringgetRawBaseDN()Retrieves the raw, unprocessed base DN as included in the request from the client.RawFiltergetRawFilter()Retrieves the raw, unprocessed search filter as included in the request from the client.intgetReferencesSent()Retrieves the number of search references sent to the client for this search operation.SearchScopegetScope()Retrieves the scope for this search operation.intgetSizeLimit()Retrieves the size limit for this search operation.intgetTimeLimit()Retrieves the time limit for this search operation.longgetTimeLimitExpiration()Get the time after which the search time limit has expired.booleangetTypesOnly()Retrieves the typesOnly flag for this search operation.booleanisClientAcceptsReferrals()Indicates whether the client is able to handle referrals.booleanisIncludeUsableControl()Indicates whether to include the account usable response control with search result entries or not.booleanisRealAttributesOnly()Returns true if only real attributes should be returned.booleanisReturnSubentriesOnly()Indicates whether LDAP subentries should be returned or not.booleanisSendResponse()Indicates whether the search result done message has to be sent to the client, or not.booleanisVirtualAttributesOnly()Returns true if only virtual attributes should be returned.booleanreturnEntry(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.booleanreturnEntry(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.booleanreturnPersistentSearchEntry(Entry entry, List<Control> controls)Used as a callback for persistent searches to send an entry which has just changed to the client.booleanreturnReference(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.booleanreturnReference(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.voidsendSearchEntry(SearchResultEntry entry)Sends the provided search result entry to the client.booleansendSearchReference(SearchResultReference reference)Sends the provided search result reference to the client.voidsendSearchResultDone()Sends the search result done message to the client.voidsetAttributes(Set<String> attributes)Specifies the set of requested attributes for this search operation.voidsetBaseDN(DN baseDN)Specifies the base DN for this search operation.voidsetClientAcceptsReferrals(boolean clientAcceptReferrals)Specify whether the client is able to handle referrals.voidsetDerefPolicy(DereferenceAliasesPolicy derefPolicy)Specifies the alias dereferencing policy for this search operation.voidsetIncludeUsableControl(boolean includeUsableControl)Specify whether to include the account usable response control within the search result entries.voidsetMatchedValuesControl(MatchedValuesControl controls)Set the match values control.voidsetProxiedAuthorizationDN(DN proxiedAuthorizationDN)Set the proxied authorization DN for this operation if proxied authorization has been requested.voidsetRawBaseDN(ByteString rawBaseDN)Specifies the raw, unprocessed base DN as included in the request from the client.voidsetRawFilter(RawFilter rawFilter)Specifies the raw, unprocessed search filter as included in the request from the client.voidsetRealAttributesOnly(boolean realAttributesOnly)Specify whether to only return real attributes.voidsetReturnSubentriesOnly(boolean returnLDAPSubentries)Set the flag indicating whether the LDAP subentries should be returned.voidsetScope(SearchScope scope)Specifies the scope for this search operation.voidsetSendResponse(boolean sendResponse)Specify whether the search result done message has to be sent to the client, or not.voidsetSizeLimit(int sizeLimit)Specifies the size limit for this search operation.voidsetTimeLimit(int timeLimit)Specifies the time limit for this search operation.voidsetTimeLimitExpiration(long timeLimitExpiration)Set the time after which the search time limit has expired.voidsetTypesOnly(boolean typesOnly)Specifies the typesOnly flag for this search operation.voidsetVirtualAttributesOnly(boolean virtualAttributesOnly)Specify whether to only return virtual attributes.-
Methods inherited from interface org.opends.server.types.Operation
abort, addAdditionalLogItem, addRequestControl, addResponseControl, appendErrorMessage, appendMaskedErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogItems, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getConnectionID, getErrorMessage, getMaskedErrorMessage, getMaskedResultCode, getMatchedDN, getMessageID, getOperationID, getOperationType, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControl, getRequestControls, getResponseControls, getResultCode, isInnerOperation, isInternalOperation, isSynchronizationOperation, operationCompleted, registerPostResponseCallback, removeAttachment, removeResponseControl, run, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInnerOperation, setInternalOperation, setMaskedErrorMessage, setMaskedResultCode, setMatchedDN, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString, toString
-
-
-
-
Method Detail
-
getRawBaseDN
ByteString getRawBaseDN()
Retrieves the raw, unprocessed base DN as included in the request from the client. This may or may not contain a valid DN, as no validation will have been performed.- Returns:
- The raw, unprocessed base DN as included in the request from the client.
-
setRawBaseDN
void setRawBaseDN(ByteString rawBaseDN)
Specifies the raw, unprocessed base DN as included in the request from the client. This method should only be called by pre-parse plugins.- Parameters:
rawBaseDN- The raw, unprocessed base DN as included in the request from the client.
-
getBaseDN
DN getBaseDN()
Retrieves the base DN for this search operation. This should not be called by pre-parse plugins, as the raw base DN will not yet have been processed. Instead, they should use thegetRawBaseDNmethod.- Returns:
- The base DN for this search operation, or
nullif the raw base DN has not yet been processed.
-
setBaseDN
void setBaseDN(DN baseDN)
Specifies the base DN for this search operation. This method is only intended for internal use.- Parameters:
baseDN- The base DN for this search operation.
-
getScope
SearchScope getScope()
Retrieves the scope for this search operation.- Returns:
- The scope for this search operation.
-
setScope
void setScope(SearchScope scope)
Specifies the scope for this search operation. This should only be called by pre-parse plugins.- Parameters:
scope- The scope for this search operation.
-
getDerefPolicy
DereferenceAliasesPolicy getDerefPolicy()
Retrieves the alias dereferencing policy for this search operation.- Returns:
- The alias dereferencing policy for this search operation.
-
setDerefPolicy
void setDerefPolicy(DereferenceAliasesPolicy derefPolicy)
Specifies the alias dereferencing policy for this search operation. This should only be called by pre-parse plugins.- Parameters:
derefPolicy- The alias dereferencing policy for this search operation.
-
getSizeLimit
int getSizeLimit()
Retrieves the size limit for this search operation.- Returns:
- The size limit for this search operation.
-
setSizeLimit
void setSizeLimit(int sizeLimit)
Specifies the size limit for this search operation. This should only be called by pre-parse plugins.- Parameters:
sizeLimit- The size limit for this search operation.
-
getTimeLimit
int getTimeLimit()
Retrieves the time limit for this search operation.- Returns:
- The time limit for this search operation.
-
getTimeLimitExpiration
long getTimeLimitExpiration()
Get the time after which the search time limit has expired.- Returns:
- the timeLimitExpiration
-
setTimeLimit
void setTimeLimit(int timeLimit)
Specifies the time limit for this search operation. This should only be called by pre-parse plugins.- Parameters:
timeLimit- The time limit for this search operation.
-
getTypesOnly
boolean getTypesOnly()
Retrieves the typesOnly flag for this search operation.- Returns:
- The typesOnly flag for this search operation.
-
setTypesOnly
void setTypesOnly(boolean typesOnly)
Specifies the typesOnly flag for this search operation. This should only be called by pre-parse plugins.- Parameters:
typesOnly- The typesOnly flag for this search operation.
-
getRawFilter
RawFilter getRawFilter()
Retrieves the raw, unprocessed search filter as included in the request from the client. It may or may not contain a valid filter (e.g., unsupported attribute types or values with an invalid syntax) because no validation will have been performed on it.- Returns:
- The raw, unprocessed search filter as included in the request from the client.
-
setRawFilter
void setRawFilter(RawFilter rawFilter)
Specifies the raw, unprocessed search filter as included in the request from the client. This method should only be called by pre-parse plugins.- Parameters:
rawFilter- The raw, unprocessed search filter as included in the request from the client.
-
getFilter
SearchFilter getFilter()
Retrieves the filter for this search operation. This should not be called by pre-parse plugins, because the raw filter will not yet have been processed.- Returns:
- The filter for this search operation, or
nullif the raw filter has not yet been processed.
-
getAttributes
Set<String> getAttributes()
Retrieves the set of requested attributes for this search operation. Its contents should not be altered.- Returns:
- The set of requested attributes for this search operation.
-
setAttributes
void setAttributes(Set<String> attributes)
Specifies the set of requested attributes for this search operation. It should only be called by pre-parse plugins.- Parameters:
attributes- The set of requested attributes for this search operation.
-
getEntriesSent
int getEntriesSent()
Retrieves the number of entries sent to the client for this search operation.- Returns:
- The number of entries sent to the client for this search operation.
-
getReferencesSent
int getReferencesSent()
Retrieves the number of search references sent to the client for this search operation.- Returns:
- The number of search references sent to the client for this search operation.
-
returnEntry
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.- Parameters:
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 benullif none are needed).- Returns:
trueif the caller should continue processing the search request and sending additional entries and references, orfalseif not for some reason (e.g., the size limit has been reached or the search has been abandoned).
-
returnEntry
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.- Parameters:
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 benullif none are needed).evaluateAci- Indicates whether the access rights to the entry should be evaluated.- Returns:
trueif the caller should continue processing the search request and sending additional entries and references, orfalseif not for some reason (e.g., the size limit has been reached or the search has been abandoned).
-
returnPersistentSearchEntry
boolean returnPersistentSearchEntry(Entry entry, List<Control> controls)
Used as a callback for persistent searches to send an entry which has just changed to the client. Contrary toreturnEntry(Entry, List), the entry is not matched against the state kept to dereference aliases during the search phase, and neither the size limit nor the time limit of the search applies to it: a persistent search must report every change it is notified of, for as long as it is alive, whether or not the entry was returned before.- Parameters:
entry- The entry which has changed and should be sent to the client.controls- The set of controls to include with the entry (may benullif none are needed).- Returns:
trueif the persistent search should keep reporting changes, orfalseif it should stop for some reason (e.g. the search has been abandoned).
-
endSearchPhase
void endSearchPhase()
Indicates that the search phase is over and that any further entry comes from a persistent search. State kept to dereference aliases during the search phase is released. Entries can still reachreturnEntry(Entry, List)afterwards, as backends are free to report their own results from another thread, so that method keeps track of this phase being over.
-
returnReference
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.- Parameters:
reference- The search reference to send to the client.dn- The DN related to the specified search reference.- Returns:
trueif the caller should continue processing the search request and sending additional entries and references , orfalseif not for some reason (e.g., the size limit has been reached or the search has been abandoned).
-
returnReference
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.- Parameters:
reference- The search reference to send to the client.dn- The DN related to the specified search reference.evaluateAci- Indicates whether the access rights to the entry should be evaluated.- Returns:
trueif the caller should continue processing the search request and sending additional entries and references , orfalseif not for some reason (e.g., the size limit has been reached or the search has been abandoned).
-
sendSearchResultDone
void sendSearchResultDone()
Sends the search result done message to the client. Note that this method should only be called from external classes in special cases (e.g., persistent search) where they are sure that the result won't be sent by the core server. Also note that the result code and optionally the error message should have been set for this operation before this method is called.
-
setTimeLimitExpiration
void setTimeLimitExpiration(long timeLimitExpiration)
Set the time after which the search time limit has expired.- Parameters:
timeLimitExpiration- - Time after which the search has expired
-
isReturnSubentriesOnly
boolean isReturnSubentriesOnly()
Indicates whether LDAP subentries should be returned or not.- Returns:
- true if the LDAP subentries should be returned, false otherwise
-
setReturnSubentriesOnly
void setReturnSubentriesOnly(boolean returnLDAPSubentries)
Set the flag indicating whether the LDAP subentries should be returned.- Parameters:
returnLDAPSubentries- - Boolean indicating whether the LDAP subentries should be returned or not
-
getMatchedValuesControl
MatchedValuesControl getMatchedValuesControl()
The matched values control associated with this search operation.- Returns:
- the match values control
-
setMatchedValuesControl
void setMatchedValuesControl(MatchedValuesControl controls)
Set the match values control.- Parameters:
controls- - The matched values control
-
isIncludeUsableControl
boolean isIncludeUsableControl()
Indicates whether to include the account usable response control with search result entries or not.- Returns:
- true if the usable control has to be part of the search result entry
-
setIncludeUsableControl
void setIncludeUsableControl(boolean includeUsableControl)
Specify whether to include the account usable response control within the search result entries.- Parameters:
includeUsableControl- - True if the account usable response control has to be included within the search result entries, false otherwise
-
isClientAcceptsReferrals
boolean isClientAcceptsReferrals()
Indicates whether the client is able to handle referrals.- Returns:
- true, if the client is able to handle referrals
-
setClientAcceptsReferrals
void setClientAcceptsReferrals(boolean clientAcceptReferrals)
Specify whether the client is able to handle referrals.- Parameters:
clientAcceptReferrals- - Boolean set to true if the client can handle referrals
-
isSendResponse
boolean isSendResponse()
Indicates whether the search result done message has to be sent to the client, or not.- Returns:
- true if the search result done message is to be sent to the client
-
setSendResponse
void setSendResponse(boolean sendResponse)
Specify whether the search result done message has to be sent to the client, or not.- Parameters:
sendResponse- - boolean indicating whether the search result done message is to send to the client
-
isRealAttributesOnly
boolean isRealAttributesOnly()
Returns true if only real attributes should be returned.- Returns:
- true if only real attributes should be returned, false otherwise
-
setRealAttributesOnly
void setRealAttributesOnly(boolean realAttributesOnly)
Specify whether to only return real attributes.- Parameters:
realAttributesOnly- - boolean setup to true, if only the real attributes should be returned
-
isVirtualAttributesOnly
boolean isVirtualAttributesOnly()
Returns true if only virtual attributes should be returned.- Returns:
- true if only virtual attributes should be returned, false otherwise
-
setVirtualAttributesOnly
void setVirtualAttributesOnly(boolean virtualAttributesOnly)
Specify whether to only return virtual attributes.- Parameters:
virtualAttributesOnly- - boolean setup to true, if only the virtual attributes should be returned
-
sendSearchEntry
void sendSearchEntry(SearchResultEntry entry) throws DirectoryException
Sends the provided search result entry to the client.- Parameters:
entry- The search result entry to be sent to the client.- Throws:
DirectoryException- If a problem occurs while attempting to send the entry to the client and the search should be terminated.
-
sendSearchReference
boolean sendSearchReference(SearchResultReference reference) throws DirectoryException
Sends the provided search result reference to the client.- Parameters:
reference- The search result reference to be sent to the client.- Returns:
trueif the client is able to accept referrals, orfalseif the client cannot handle referrals and no more attempts should be made to send them for the associated search operation.- Throws:
DirectoryException- If a problem occurs while attempting to send the reference to the client and the search should be terminated.
-
getProxiedAuthorizationDN
DN getProxiedAuthorizationDN()
Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
getProxiedAuthorizationDNin interfaceOperation- Returns:
- The proxied authorization DN for this operation if proxied
authorization has been requested, or
nullif proxied authorization has not been requested.
-
setProxiedAuthorizationDN
void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
Set the proxied authorization DN for this operation if proxied authorization has been requested.- Specified by:
setProxiedAuthorizationDNin interfaceOperation- Parameters:
proxiedAuthorizationDN- The proxied authorization DN for this operation if proxied authorization has been requested, ornullif proxied authorization has not been requested.
-
-