Class InternalSearchOperation
- java.lang.Object
-
- org.opends.server.types.AbstractOperation
-
- org.opends.server.core.SearchOperationBasis
-
- org.opends.server.protocols.internal.InternalSearchOperation
-
- All Implemented Interfaces:
Runnable,SearchOperation,Operation,InProgressOperation,PluginOperation,PostResponseOperation,PostResponseSearchOperation,PreParseOperation,PreParseSearchOperation,SearchEntrySearchOperation,SearchReferenceSearchOperation
@PublicAPI(stability=UNCOMMITTED, mayInstantiate=true, mayExtend=false, mayInvoke=true) public final class InternalSearchOperation extends SearchOperationBasis
This class defines a subclass of the core search operation that is to be used for internal searches. The primary difference between this class and the core search operation is that the search entries and references will be queued in memory rather than sent to a client since there is no real client.
-
-
Field Summary
-
Fields inherited from class org.opends.server.types.AbstractOperation
cancelRequest, cancelResult, clientConnection, messageID, NO_RESPONSE_CONTROLS, operationID
-
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
-
-
Constructor Summary
Constructors Constructor Description InternalSearchOperation(ClientConnection internalConnection, long operationID, int messageID, SearchRequest request)Creates a new internal search operation with the provided information.InternalSearchOperation(ClientConnection internalConnection, long operationID, int messageID, SearchRequest request, InternalSearchListener searchListener)Creates a new internal search operation with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddSearchEntry(SearchResultEntry searchEntry)Provides the provided search result entry to the internal search listener if one was provided, or stores it in an internal list otherwise.voidaddSearchReference(SearchResultReference searchReference)Provides the provided search result reference to the internal search listener if one was provided, or stores it in an internal list otherwise.LinkedList<SearchResultEntry>getSearchEntries()Retrieves the set of search result entries returned for this search.List<SearchResultReference>getSearchReferences()Retrieves the set of search result references returned for this search.voidsendSearchEntry(SearchResultEntry searchEntry)Sends the provided search result entry to the client.booleansendSearchReference(SearchResultReference searchReference)Sends the provided search result reference to the client.-
Methods inherited from class org.opends.server.core.SearchOperationBasis
abort, addResponseControl, endSearchPhase, getAttributes, getBaseDN, getDerefPolicy, getEntriesSent, getFilter, getMatchedValuesControl, getOperationType, getProxiedAuthorizationDN, getRawBaseDN, getRawFilter, getReferencesSent, getResponseControls, getScope, getSizeLimit, getTimeLimit, getTimeLimitExpiration, getTypesOnly, isClientAcceptsReferrals, isIncludeUsableControl, isRealAttributesOnly, isReturnSubentriesOnly, isSendResponse, isVirtualAttributesOnly, removeResponseControl, returnEntry, returnEntry, returnPersistentSearchEntry, returnReference, returnReference, run, sendSearchResultDone, setAttributes, setBaseDN, setClientAcceptsReferrals, setDerefPolicy, setIncludeUsableControl, setMatchedValuesControl, setProxiedAuthorizationDN, setRawBaseDN, setRawFilter, setRealAttributesOnly, setReturnSubentriesOnly, setScope, setSendResponse, setSizeLimit, setTimeLimit, setTimeLimitExpiration, setTypesOnly, setVirtualAttributesOnly, toString, updateOperationErrMsgAndResCode
-
Methods inherited from class org.opends.server.types.AbstractOperation
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, getTransactionId, 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, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.opends.server.types.operation.InProgressOperation
addAdditionalLogItem, appendErrorMessage, getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getReferralURLs, getResultCode, setErrorMessage, setMatchedDN, setReferralURLs, setResponseData, setResultCode
-
Methods inherited from interface org.opends.server.types.Operation
addAdditionalLogItem, 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, toString
-
Methods inherited from interface org.opends.server.types.operation.PluginOperation
checkIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getProcessingStartTime, getRequestControl, getRequestControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toString
-
Methods inherited from interface org.opends.server.types.operation.PostResponseOperation
getAdditionalLogItems, getAuthorizationDN, getErrorMessage, getMatchedDN, getProcessingStopTime, getProcessingTime, getReferralURLs, getResultCode
-
Methods inherited from interface org.opends.server.types.operation.PreParseOperation
addAdditionalLogItem, addRequestControl, appendErrorMessage, getAdditionalLogItems, getErrorMessage, setErrorMessage
-
-
-
-
Constructor Detail
-
InternalSearchOperation
public InternalSearchOperation(ClientConnection internalConnection, long operationID, int messageID, SearchRequest request)
Creates a new internal search operation with the provided information.- Parameters:
internalConnection- The internal client connection with which this internal search operation is associated.operationID- The operation ID for this internal search.messageID- The message ID for this internal search.request- The search request
-
InternalSearchOperation
public InternalSearchOperation(ClientConnection internalConnection, long operationID, int messageID, SearchRequest request, InternalSearchListener searchListener)
Creates a new internal search operation with the provided information.- Parameters:
internalConnection- The internal client connection with which this internal search operation is associated.operationID- The operation ID for this internal search.messageID- The message ID for this internal search.request- The search requestsearchListener- The internal search listener that should be used to process the results, ornullif they should be collected internally.
-
-
Method Detail
-
getSearchEntries
public LinkedList<SearchResultEntry> getSearchEntries()
Retrieves the set of search result entries returned for this search.- Returns:
- The set of search result entries returned for this
search, or
nullif a custom internal search listener is to be used.
-
addSearchEntry
@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void addSearchEntry(SearchResultEntry searchEntry) throws DirectoryException
Provides the provided search result entry to the internal search listener if one was provided, or stores it in an internal list otherwise.- Parameters:
searchEntry- The search result entry returned for this search.- Throws:
DirectoryException- If a problem occurs while processing the provided entry and the search should be terminated.
-
getSearchReferences
public List<SearchResultReference> getSearchReferences()
Retrieves the set of search result references returned for this search.- Returns:
- The set of search result references returned for this
search, or
nullif a custom internal search listener is to be used.
-
addSearchReference
@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void addSearchReference(SearchResultReference searchReference) throws DirectoryException
Provides the provided search result reference to the internal search listener if one was provided, or stores it in an internal list otherwise.- Parameters:
searchReference- The search result reference returned for this search.- Throws:
DirectoryException- If a problem occurs while processing the provided reference and the search should be terminated.
-
sendSearchEntry
@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public void sendSearchEntry(SearchResultEntry searchEntry) throws DirectoryException
Sends the provided search result entry to the client.- Specified by:
sendSearchEntryin interfaceSearchOperation- Overrides:
sendSearchEntryin classSearchOperationBasis- Parameters:
searchEntry- 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
@PublicAPI(stability=PRIVATE, mayInstantiate=false, mayExtend=false, mayInvoke=false) public boolean sendSearchReference(SearchResultReference searchReference) throws DirectoryException
Sends the provided search result reference to the client.- Specified by:
sendSearchReferencein interfaceSearchOperation- Overrides:
sendSearchReferencein classSearchOperationBasis- Parameters:
searchReference- 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.
-
-