org.opends.server.protocols.internal
Class InternalSearchOperation

java.lang.Object
  extended by org.opends.server.types.AbstractOperation
      extended by org.opends.server.core.SearchOperationBasis
          extended by org.opends.server.protocols.internal.InternalSearchOperation
All Implemented Interfaces:
java.lang.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, useNanoTime
 
Fields inherited from interface org.opends.server.types.Operation
LOCALBACKENDOPERATIONS
 
Constructor Summary
InternalSearchOperation(ClientConnection internalConnection, long operationID, int messageID, java.util.List<Control> requestControls, ByteString rawBaseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, RawFilter rawFilter, java.util.LinkedHashSet<java.lang.String> attributes, InternalSearchListener searchListener)
          Creates a new internal search operation with the provided information.
InternalSearchOperation(ClientConnection internalConnection, long operationID, int messageID, java.util.List<Control> requestControls, DN baseDN, SearchScope scope, DereferencePolicy derefPolicy, int sizeLimit, int timeLimit, boolean typesOnly, SearchFilter filter, java.util.LinkedHashSet<java.lang.String> attributes, InternalSearchListener searchListener)
          Creates a new internal search operation with the provided information.
 
Method Summary
 void addSearchEntry(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.
 void addSearchReference(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.
 java.util.LinkedList<SearchResultEntry> getSearchEntries()
          Retrieves the set of search result entries returned for this search.
 java.util.LinkedList<SearchResultReference> getSearchReferences()
          Retrieves the set of search result references returned for this search.
 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.
 
Methods inherited from class org.opends.server.core.SearchOperationBasis
abort, addResponseControl, getAttributes, getBaseDN, getDerefPolicy, getEntriesSent, getFilter, getMatchedValuesControl, getOperationType, getPersistentSearch, getProxiedAuthorizationDN, getRawBaseDN, getRawFilter, getReferencesSent, getRequestLogElements, getResponseControls, getResponseLogElements, getScope, getSizeLimit, getTimeLimit, getTimeLimitExpiration, getTypesOnly, incrementEntriesSent, incrementReferencesSent, isClientAcceptsReferrals, isIncludeUsableControl, isRealAttributesOnly, isReturnLDAPSubentries, isSendResponse, isVirtualAttributesOnly, removeResponseControl, returnEntry, returnReference, run, sendSearchResultDone, setAttributes, setBaseDN, setClientAcceptsReferrals, setDerefPolicy, setIncludeUsableControl, setMatchedValuesControl, setPersistentSearch, setProxiedAuthorizationDN, setRawBaseDN, setRawFilter, setRealAttributesOnly, setReturnLDAPSubentries, setScope, setSendResponse, setSizeLimit, setTimeLimit, setTimeLimitExpiration, setTypesOnly, setVirtualAttributesOnly, toString
 
Methods inherited from class org.opends.server.types.AbstractOperation
addRequestControl, appendAdditionalLogMessage, appendErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogMessage, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getCommonLogElements, getConnectionID, getErrorMessage, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControls, getResultCode, isInternalOperation, isSynchronizationOperation, operationCompleted, removeAttachment, removeRequestControl, setAdditionalLogMessage, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInternalOperation, setMatchedDN, setProcessingStartTime, setProcessingStopTime, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.opends.server.types.operation.PreParseOperation
addRequestControl, appendAdditionalLogMessage, appendErrorMessage, getAdditionalLogMessage, getErrorMessage, removeRequestControl, setAdditionalLogMessage, setErrorMessage
 
Methods inherited from interface org.opends.server.types.operation.PostResponseOperation
getAdditionalLogMessage, getAuthorizationDN, getErrorMessage, getMatchedDN, getProcessingStopTime, getProcessingTime, getReferralURLs, getResultCode
 
Methods inherited from interface org.opends.server.types.operation.InProgressOperation
appendAdditionalLogMessage, appendErrorMessage, getAdditionalLogMessage, getAuthorizationDN, getErrorMessage, getMatchedDN, getReferralURLs, getResultCode, setAdditionalLogMessage, setErrorMessage, setMatchedDN, setReferralURLs, setResponseData, setResultCode
 
Methods inherited from interface org.opends.server.types.operation.PluginOperation
checkIfCanceled, disconnectClient, getAttachment, getAttachments, getClientConnection, getConnectionID, getMessageID, getOperationID, getProcessingStartTime, getRequestControls, isInternalOperation, isSynchronizationOperation, removeAttachment, setAttachment, toString
 
Methods inherited from interface org.opends.server.types.Operation
addRequestControl, appendAdditionalLogMessage, appendErrorMessage, cancel, checkIfCanceled, disconnectClient, dontSynchronize, getAdditionalLogMessage, getAttachment, getAttachments, getAuthorizationDN, getAuthorizationEntry, getCancelRequest, getCancelResult, getClientConnection, getCommonLogElements, getConnectionID, getErrorMessage, getMatchedDN, getMessageID, getOperationID, getProcessingNanoTime, getProcessingStartTime, getProcessingStopTime, getProcessingTime, getReferralURLs, getRequestControls, getResultCode, isInternalOperation, isSynchronizationOperation, operationCompleted, removeAttachment, removeRequestControl, setAdditionalLogMessage, setAttachment, setAttachments, setAuthorizationEntry, setDontSynchronize, setErrorMessage, setInternalOperation, setMatchedDN, setReferralURLs, setResponseData, setResultCode, setSynchronizationOperation, toString
 

Constructor Detail

InternalSearchOperation

public InternalSearchOperation(ClientConnection internalConnection,
                               long operationID,
                               int messageID,
                               java.util.List<Control> requestControls,
                               ByteString rawBaseDN,
                               SearchScope scope,
                               DereferencePolicy derefPolicy,
                               int sizeLimit,
                               int timeLimit,
                               boolean typesOnly,
                               RawFilter rawFilter,
                               java.util.LinkedHashSet<java.lang.String> attributes,
                               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.
requestControls - The set of request controls for this internal search.
rawBaseDN - The raw base DN for this internal search.
scope - The scope for this internal search.
derefPolicy - The alias dereferencing policy for this internal search.
sizeLimit - The size limit for this internal search.
timeLimit - The time limit for this internal search.
typesOnly - The typesOnly flag for this internal search.
rawFilter - The raw filter for this internal search.
attributes - The names of the requested attributes for this internal search.
searchListener - The internal search listener that should be used to process the results, or null if they should be collected internally.

InternalSearchOperation

public InternalSearchOperation(ClientConnection internalConnection,
                               long operationID,
                               int messageID,
                               java.util.List<Control> requestControls,
                               DN baseDN,
                               SearchScope scope,
                               DereferencePolicy derefPolicy,
                               int sizeLimit,
                               int timeLimit,
                               boolean typesOnly,
                               SearchFilter filter,
                               java.util.LinkedHashSet<java.lang.String> attributes,
                               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.
requestControls - The set of request controls for this internal search.
baseDN - The base DN for this internal search.
scope - The scope for this internal search.
derefPolicy - The alias dereferencing policy for this internal search.
sizeLimit - The size limit for this internal search.
timeLimit - The time limit for this internal search.
typesOnly - The typesOnly flag for this internal search.
filter - The filter for this internal search.
attributes - The names of the requested attributes for this internal search.
searchListener - The internal search listener that should be used to process the results, or null if they should be collected internally.
Method Detail

getSearchEntries

public java.util.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 null if 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 java.util.LinkedList<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 null if 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:
sendSearchEntry in interface SearchOperation
Overrides:
sendSearchEntry in class SearchOperationBasis
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:
sendSearchReference in interface SearchOperation
Overrides:
sendSearchReference in class SearchOperationBasis
Parameters:
searchReference - The search result reference to be sent to the client.
Returns:
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.
Throws:
DirectoryException - If a problem occurs while attempting to send the reference to the client and the search should be terminated.