org.opends.server.core
Class SearchOperationBasis

java.lang.Object
  extended by org.opends.server.types.AbstractOperation
      extended by org.opends.server.core.SearchOperationBasis
All Implemented Interfaces:
java.lang.Runnable, SearchOperation, Operation, InProgressOperation, PluginOperation, PostResponseOperation, PostResponseSearchOperation, PreParseOperation, PreParseSearchOperation, SearchEntrySearchOperation, SearchReferenceSearchOperation
Direct Known Subclasses:
InternalSearchOperation

public class SearchOperationBasis
extends AbstractOperation
implements PreParseSearchOperation, PostResponseSearchOperation, SearchEntrySearchOperation, SearchReferenceSearchOperation, SearchOperation

This class defines an operation that may be used to locate entries in the Directory Server based on a given set of criteria.


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
SearchOperationBasis(ClientConnection clientConnection, 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)
          Creates a new search operation with the provided information.
SearchOperationBasis(ClientConnection clientConnection, 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)
          Creates a new search operation with the provided information.
 
Method Summary
 void abort(CancelRequest cancelRequest)
          Attempts to cancel this operation before processing has completed without waiting for a cancel result.
 void addResponseControl(Control control)
          Adds the provided control to the set of controls to include in the response to the client.
 java.util.LinkedHashSet<java.lang.String> getAttributes()
          Retrieves the set of requested attributes for this search operation.
 DN getBaseDN()
          Retrieves the base DN for this search operation.
 DereferencePolicy 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.
 PersistentSearch getPersistentSearch()
          Get the psearch from the search 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.
 java.lang.String[][] getRequestLogElements()
          Retrieves a standard set of elements that should be logged in requests for this type of operation.
 java.util.List<Control> getResponseControls()
          Retrieves the set of controls to include in the response to the client.
 java.lang.String[][] getResponseLogElements()
          Retrieves a standard set of elements that should be logged in responses for this type of operation.
 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.
 java.lang.Long getTimeLimitExpiration()
          Get the time after which the search time limit has expired.
 boolean getTypesOnly()
          Retrieves the typesOnly flag for this search operation.
 void incrementEntriesSent()
          Increments by 1 the number of entries sent to the client for this search operation.
 void incrementReferencesSent()
          Increments by 1 the number of search references sent to the client 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 isReturnLDAPSubentries()
          Indicates whether LDAP subentries should be returned or not.
 boolean isSendResponse()
          Indicates wether 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, java.util.List<Control> controls)
          Returns the provided entry to the client.
 boolean returnReference(DN dn, SearchResultReference reference)
          Returns the provided search result reference 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(java.util.LinkedHashSet<java.lang.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(DereferencePolicy 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 setPersistentSearch(PersistentSearch psearch)
          Register the psearch in the search operation.
 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 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 wether to only return real attributes.
 void setReturnLDAPSubentries(boolean returnLDAPSubentries)
          Set the flag indicating wether the LDAP subentries should be returned.
 void setScope(SearchScope scope)
          Specifies the scope for this search operation.
 void setSendResponse(boolean sendResponse)
          Specify wether 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(java.lang.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 wether to only return virtual attributes.
 void toString(java.lang.StringBuilder buffer)
          Appends a string representation of this operation to the provided buffer.
 
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

SearchOperationBasis

public SearchOperationBasis(ClientConnection clientConnection,
                            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)
Creates a new search operation with the provided information.

Parameters:
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.

SearchOperationBasis

public SearchOperationBasis(ClientConnection clientConnection,
                            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)
Creates a new search operation with the provided information.

Parameters:
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.
Method Detail

getRawBaseDN

public final 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.

Specified by:
getRawBaseDN in interface SearchOperation
Specified by:
getRawBaseDN in interface PostResponseSearchOperation
Specified by:
getRawBaseDN in interface PreParseSearchOperation
Specified by:
getRawBaseDN in interface SearchEntrySearchOperation
Specified by:
getRawBaseDN in interface SearchReferenceSearchOperation
Returns:
The raw, unprocessed base DN as included in the request from the client.

setRawBaseDN

public final void setRawBaseDN(ByteString rawBaseDN)
Specifies the raw, unprocessed base DN for this search operation.

Specified by:
setRawBaseDN in interface SearchOperation
Specified by:
setRawBaseDN in interface PreParseSearchOperation
Parameters:
rawBaseDN - The raw, unprocessed base DN for this search operation.

getBaseDN

public final DN getBaseDN()
Retrieves the base DN for this search operation.

Specified by:
getBaseDN in interface SearchOperation
Specified by:
getBaseDN in interface PostResponseSearchOperation
Specified by:
getBaseDN in interface SearchEntrySearchOperation
Specified by:
getBaseDN in interface SearchReferenceSearchOperation
Returns:
The base DN for this search operation.

setBaseDN

public final void setBaseDN(DN baseDN)
Specifies the base DN for this search operation. This method is only intended for internal use.

Specified by:
setBaseDN in interface SearchOperation
Parameters:
baseDN - The base DN for this search operation.

getScope

public final SearchScope getScope()
Retrieves the scope for this search operation.

Specified by:
getScope in interface SearchOperation
Specified by:
getScope in interface PostResponseSearchOperation
Specified by:
getScope in interface PreParseSearchOperation
Specified by:
getScope in interface SearchEntrySearchOperation
Specified by:
getScope in interface SearchReferenceSearchOperation
Returns:
The scope for this search operation.

setScope

public final void setScope(SearchScope scope)
Specifies the scope for this search operation.

Specified by:
setScope in interface SearchOperation
Specified by:
setScope in interface PreParseSearchOperation
Parameters:
scope - The scope for this search operation.

getDerefPolicy

public final DereferencePolicy getDerefPolicy()
Retrieves the alias dereferencing policy for this search operation.

Specified by:
getDerefPolicy in interface SearchOperation
Specified by:
getDerefPolicy in interface PostResponseSearchOperation
Specified by:
getDerefPolicy in interface PreParseSearchOperation
Specified by:
getDerefPolicy in interface SearchEntrySearchOperation
Specified by:
getDerefPolicy in interface SearchReferenceSearchOperation
Returns:
The alias dereferencing policy for this search operation.

setDerefPolicy

public final void setDerefPolicy(DereferencePolicy derefPolicy)
Specifies the alias dereferencing policy for this search operation.

Specified by:
setDerefPolicy in interface SearchOperation
Specified by:
setDerefPolicy in interface PreParseSearchOperation
Parameters:
derefPolicy - The alias dereferencing policy for this search operation.

getSizeLimit

public final int getSizeLimit()
Retrieves the size limit for this search operation.

Specified by:
getSizeLimit in interface SearchOperation
Specified by:
getSizeLimit in interface PostResponseSearchOperation
Specified by:
getSizeLimit in interface PreParseSearchOperation
Specified by:
getSizeLimit in interface SearchEntrySearchOperation
Specified by:
getSizeLimit in interface SearchReferenceSearchOperation
Returns:
The size limit for this search operation.

setSizeLimit

public final void setSizeLimit(int sizeLimit)
Specifies the size limit for this search operation.

Specified by:
setSizeLimit in interface SearchOperation
Specified by:
setSizeLimit in interface PreParseSearchOperation
Parameters:
sizeLimit - The size limit for this search operation.

getTimeLimit

public final int getTimeLimit()
Retrieves the time limit for this search operation.

Specified by:
getTimeLimit in interface SearchOperation
Specified by:
getTimeLimit in interface PostResponseSearchOperation
Specified by:
getTimeLimit in interface PreParseSearchOperation
Specified by:
getTimeLimit in interface SearchEntrySearchOperation
Specified by:
getTimeLimit in interface SearchReferenceSearchOperation
Returns:
The time limit for this search operation.

setTimeLimit

public final void setTimeLimit(int timeLimit)
Specifies the time limit for this search operation.

Specified by:
setTimeLimit in interface SearchOperation
Specified by:
setTimeLimit in interface PreParseSearchOperation
Parameters:
timeLimit - The time limit for this search operation.

getTypesOnly

public final boolean getTypesOnly()
Retrieves the typesOnly flag for this search operation.

Specified by:
getTypesOnly in interface SearchOperation
Specified by:
getTypesOnly in interface PostResponseSearchOperation
Specified by:
getTypesOnly in interface PreParseSearchOperation
Specified by:
getTypesOnly in interface SearchEntrySearchOperation
Specified by:
getTypesOnly in interface SearchReferenceSearchOperation
Returns:
The typesOnly flag for this search operation.

setTypesOnly

public final void setTypesOnly(boolean typesOnly)
Specifies the typesOnly flag for this search operation.

Specified by:
setTypesOnly in interface SearchOperation
Specified by:
setTypesOnly in interface PreParseSearchOperation
Parameters:
typesOnly - The typesOnly flag for this search operation.

getRawFilter

public final 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.

Specified by:
getRawFilter in interface SearchOperation
Specified by:
getRawFilter in interface PostResponseSearchOperation
Specified by:
getRawFilter in interface PreParseSearchOperation
Specified by:
getRawFilter in interface SearchEntrySearchOperation
Specified by:
getRawFilter in interface SearchReferenceSearchOperation
Returns:
The raw, unprocessed search filter as included in the request from the client.

setRawFilter

public final void setRawFilter(RawFilter rawFilter)
Specifies the raw, unprocessed search filter as included in the request from the client.

Specified by:
setRawFilter in interface SearchOperation
Specified by:
setRawFilter in interface PreParseSearchOperation
Parameters:
rawFilter - The raw, unprocessed search filter.

getFilter

public final SearchFilter getFilter()
Retrieves the filter for this search operation.

Specified by:
getFilter in interface SearchOperation
Specified by:
getFilter in interface PostResponseSearchOperation
Specified by:
getFilter in interface SearchEntrySearchOperation
Specified by:
getFilter in interface SearchReferenceSearchOperation
Returns:
The filter for this search operation.

getAttributes

public final java.util.LinkedHashSet<java.lang.String> getAttributes()
Retrieves the set of requested attributes for this search operation. Its contents should not be be altered.

Specified by:
getAttributes in interface SearchOperation
Specified by:
getAttributes in interface PostResponseSearchOperation
Specified by:
getAttributes in interface PreParseSearchOperation
Specified by:
getAttributes in interface SearchEntrySearchOperation
Specified by:
getAttributes in interface SearchReferenceSearchOperation
Returns:
The set of requested attributes for this search operation.

setAttributes

public final void setAttributes(java.util.LinkedHashSet<java.lang.String> attributes)
Specifies the set of requested attributes for this search operation.

Specified by:
setAttributes in interface SearchOperation
Specified by:
setAttributes in interface PreParseSearchOperation
Parameters:
attributes - The set of requested attributes for this search operation.

getEntriesSent

public final int getEntriesSent()
Retrieves the number of entries sent to the client for this search operation.

Specified by:
getEntriesSent in interface SearchOperation
Specified by:
getEntriesSent in interface PostResponseSearchOperation
Returns:
The number of entries sent to the client for this search operation.

getReferencesSent

public final int getReferencesSent()
Retrieves the number of search references sent to the client for this search operation.

Specified by:
getReferencesSent in interface SearchOperation
Specified by:
getReferencesSent in interface PostResponseSearchOperation
Returns:
The number of search references sent to the client for this search operation.

returnEntry

public final boolean returnEntry(Entry entry,
                                 java.util.List<Control> controls)
Returns the provided entry to the client.

Specified by:
returnEntry in interface SearchOperation
Specified by:
returnEntry in interface PreParseSearchOperation
Parameters:
entry - 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).
Returns:
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).

returnReference

public final boolean returnReference(DN dn,
                                     SearchResultReference reference)
Returns the provided search result reference to the client.

Specified by:
returnReference in interface SearchOperation
Specified by:
returnReference in interface PreParseSearchOperation
Parameters:
dn - A DN related to the specified search reference.
reference - The search reference that should be returned.
Returns:
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).

sendSearchResultDone

public final 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.

Specified by:
sendSearchResultDone in interface SearchOperation

getOperationType

public final OperationType getOperationType()
Retrieves the operation type for this operation.

Specified by:
getOperationType in interface Operation
Specified by:
getOperationType in interface PluginOperation
Specified by:
getOperationType in class AbstractOperation
Returns:
The operation type for this operation.

getRequestLogElements

public final java.lang.String[][] getRequestLogElements()
Retrieves a standard set of elements that should be logged in requests for this type of operation. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getRequestLogElements in interface Operation
Specified by:
getRequestLogElements in class AbstractOperation
Returns:
A standard set of elements that should be logged in requests for this type of operation.

getResponseLogElements

public final java.lang.String[][] getResponseLogElements()
Retrieves a standard set of elements that should be logged in responses for this type of operation. Each element in the array will itself be a two-element array in which the first element is the name of the field and the second is a string representation of the value, or null if there is no value for that field.

Specified by:
getResponseLogElements in interface Operation
Specified by:
getResponseLogElements in class AbstractOperation
Returns:
A standard set of elements that should be logged in responses for this type of operation.

getProxiedAuthorizationDN

public DN getProxiedAuthorizationDN()
Retrieves the proxied authorization DN for this operation if proxied authorization has been requested.

Specified by:
getProxiedAuthorizationDN in interface SearchOperation
Returns:
The proxied authorization DN for this operation if proxied authorization has been requested, or null if proxied authorization has not been requested.

getResponseControls

public final java.util.List<Control> getResponseControls()
Retrieves the set of controls to include in the response to the client. The contents of this list must not be altered.

Specified by:
getResponseControls in interface Operation
Specified by:
getResponseControls in interface PluginOperation
Specified by:
getResponseControls in class AbstractOperation
Returns:
The set of controls to include in the response to the client.

addResponseControl

public final void addResponseControl(Control control)
Adds the provided control to the set of controls to include in the response to the client. This method may not be called by post-response plugins.

Specified by:
addResponseControl in interface Operation
Specified by:
addResponseControl in interface InProgressOperation
Specified by:
addResponseControl in interface PreParseOperation
Specified by:
addResponseControl in class AbstractOperation
Parameters:
control - The control to add to the set of controls to include in the response to the client.

removeResponseControl

public final void removeResponseControl(Control control)
Removes the provided control from the set of controls to include in the response to the client. This method may not be called by post-response plugins.

Specified by:
removeResponseControl in interface Operation
Specified by:
removeResponseControl in interface InProgressOperation
Specified by:
removeResponseControl in interface PreParseOperation
Specified by:
removeResponseControl in class AbstractOperation
Parameters:
control - The control to remove from the set of controls to include in the response to the client.

abort

public void abort(CancelRequest cancelRequest)
Attempts to cancel this operation before processing has completed without waiting for a cancel result.

Specified by:
abort in interface Operation
Overrides:
abort in class AbstractOperation
Parameters:
cancelRequest - Information about the way in which the operation should be canceled.

toString

public final void toString(java.lang.StringBuilder buffer)
Appends a string representation of this operation to the provided buffer.

Specified by:
toString in interface Operation
Specified by:
toString in interface PluginOperation
Specified by:
toString in class AbstractOperation
Parameters:
buffer - The buffer into which a string representation of this operation should be appended.

setTimeLimitExpiration

public void setTimeLimitExpiration(java.lang.Long timeLimitExpiration)
Set the time after which the search time limit has expired.

Specified by:
setTimeLimitExpiration in interface SearchOperation
Parameters:
timeLimitExpiration - - Time after which the search has expired

isReturnLDAPSubentries

public boolean isReturnLDAPSubentries()
Indicates whether LDAP subentries should be returned or not.

Specified by:
isReturnLDAPSubentries in interface SearchOperation
Returns:
true if the LDAP subentries should be returned, false otherwise

setReturnLDAPSubentries

public void setReturnLDAPSubentries(boolean returnLDAPSubentries)
Set the flag indicating wether the LDAP subentries should be returned.

Specified by:
setReturnLDAPSubentries in interface SearchOperation
Parameters:
returnLDAPSubentries - - Boolean indicating wether the LDAP subentries should be returned or not

getMatchedValuesControl

public MatchedValuesControl getMatchedValuesControl()
The matched values control associated with this search operation.

Specified by:
getMatchedValuesControl in interface SearchOperation
Returns:
the match values control

setMatchedValuesControl

public void setMatchedValuesControl(MatchedValuesControl controls)
Set the match values control.

Specified by:
setMatchedValuesControl in interface SearchOperation
Parameters:
controls - - The matched values control

getPersistentSearch

public PersistentSearch getPersistentSearch()
Get the psearch from the search operation.

Specified by:
getPersistentSearch in interface SearchOperation
Returns:
the psearch, or null if no psearch was registered

isIncludeUsableControl

public boolean isIncludeUsableControl()
Indicates whether to include the account usable response control with search result entries or not.

Specified by:
isIncludeUsableControl in interface SearchOperation
Returns:
true if the usable control has to be part of the search result entry

setIncludeUsableControl

public void setIncludeUsableControl(boolean includeUsableControl)
Specify whether to include the account usable response control within the search result entries.

Specified by:
setIncludeUsableControl in interface SearchOperation
Parameters:
includeUsableControl - - True if the account usable response control has to be included within the search result entries, false otherwise

setPersistentSearch

public void setPersistentSearch(PersistentSearch psearch)
Register the psearch in the search operation.

Specified by:
setPersistentSearch in interface SearchOperation
Parameters:
psearch - - Persistent search associated to that operation

getTimeLimitExpiration

public java.lang.Long getTimeLimitExpiration()
Get the time after which the search time limit has expired.

Specified by:
getTimeLimitExpiration in interface SearchOperation
Returns:
the timeLimitExpiration

isClientAcceptsReferrals

public boolean isClientAcceptsReferrals()
Indicates whether the client is able to handle referrals.

Specified by:
isClientAcceptsReferrals in interface SearchOperation
Returns:
true, if the client is able to handle referrals

setClientAcceptsReferrals

public void setClientAcceptsReferrals(boolean clientAcceptReferrals)
Specify whether the client is able to handle referrals.

Specified by:
setClientAcceptsReferrals in interface SearchOperation
Parameters:
clientAcceptReferrals - - Boolean set to true if the client can handle referrals

incrementEntriesSent

public void incrementEntriesSent()
Increments by 1 the number of entries sent to the client for this search operation.

Specified by:
incrementEntriesSent in interface SearchOperation

incrementReferencesSent

public void incrementReferencesSent()
Increments by 1 the number of search references sent to the client for this search operation.

Specified by:
incrementReferencesSent in interface SearchOperation

isSendResponse

public boolean isSendResponse()
Indicates wether the search result done message has to be sent to the client, or not.

Specified by:
isSendResponse in interface SearchOperation
Returns:
true if the search result done message is to be sent to the client

setSendResponse

public void setSendResponse(boolean sendResponse)
Specify wether the search result done message has to be sent to the client, or not.

Specified by:
setSendResponse in interface SearchOperation
Parameters:
sendResponse - - boolean indicating wether the search result done message is to send to the client

isRealAttributesOnly

public boolean isRealAttributesOnly()
Returns true if only real attributes should be returned.

Specified by:
isRealAttributesOnly in interface SearchOperation
Returns:
true if only real attributes should be returned, false otherwise

isVirtualAttributesOnly

public boolean isVirtualAttributesOnly()
Returns true if only virtual attributes should be returned.

Specified by:
isVirtualAttributesOnly in interface SearchOperation
Returns:
true if only virtual attributes should be returned, false otherwise

setRealAttributesOnly

public void setRealAttributesOnly(boolean realAttributesOnly)
Specify wether to only return real attributes.

Specified by:
setRealAttributesOnly in interface SearchOperation
Parameters:
realAttributesOnly - - boolean setup to true, if only the real attributes should be returned

setVirtualAttributesOnly

public void setVirtualAttributesOnly(boolean virtualAttributesOnly)
Specify wether to only return virtual attributes.

Specified by:
setVirtualAttributesOnly in interface SearchOperation
Parameters:
virtualAttributesOnly - - boolean setup to true, if only the virtual attributes should be returned

sendSearchEntry

public void sendSearchEntry(SearchResultEntry searchEntry)
                     throws DirectoryException
Sends the provided search result entry to the client.

Specified by:
sendSearchEntry in interface SearchOperation
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

public boolean sendSearchReference(SearchResultReference searchReference)
                            throws DirectoryException
Sends the provided search result reference to the client.

Specified by:
sendSearchReference in interface SearchOperation
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.

setProxiedAuthorizationDN

public void setProxiedAuthorizationDN(DN proxiedAuthorizationDN)
Set the proxied authorization DN for this operation if proxied authorization has been requested.

Specified by:
setProxiedAuthorizationDN in interface SearchOperation
Parameters:
proxiedAuthorizationDN - The proxied authorization DN for this operation if proxied authorization has been requested, or null if proxied authorization has not been requested.

run

public final void run()
Performs the work of actually processing this operation. This should include all processing for the operation, including invoking pre-parse and post-response plugins, logging messages and any other work that might need to be done in the course of processing.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class AbstractOperation