SearchOperation.java revision 99faa045b6241c1d2843cce1b7a9d9c97055beae
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at
* trunk/opends/resource/legal-notices/OpenDS.LICENSE. If applicable,
* add the following below this CDDL HEADER, with the fields enclosed
* by brackets "[]" replaced with your own identifying information:
* Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*
*
* Portions Copyright 2006-2007 Sun Microsystems, Inc.
*/
/**
* This class defines an operation that may be used to locate entries in the
* Directory Server based on a given set of criteria.
*/
public class SearchOperation
extends Operation
implements PreParseSearchOperation, PreOperationSearchOperation,
{
// Indicates whether a search result done response has been sent to the
// client.
private AtomicBoolean responseSent;
// Indicates whether the client is able to handle referrals.
private boolean clientAcceptsReferrals;
// Indicates whether to include the account usable control with search result
// entries.
private boolean includeUsableControl;
// Indicates whether to only real attributes should be returned.
private boolean realAttributesOnly;
// Indicates whether LDAP subentries should be returned.
private boolean returnLDAPSubentries;
// Indicates whether to include attribute types only or both types and values.
private boolean typesOnly;
// Indicates whether to only virtual attributes should be returned.
private boolean virtualAttributesOnly;
// The raw, unprocessed base DN as included in the request from the client.
private ByteString rawBaseDN;
// The cancel request that has been issued for this search operation.
private CancelRequest cancelRequest;
// The dereferencing policy for the search operation.
private DereferencePolicy derefPolicy;
// The base DN for the search operation.
// The number of entries that have been sent to the client.
private int entriesSent;
// The number of search result references that have been sent to the client.
private int referencesSent;
// The size limit for the search operation.
private int sizeLimit;
// The time limit for the search operation.
private int timeLimit;
// The set of attributes that should be returned in matching entries.
// The set of response controls for this search operation.
// The time that processing started on this operation.
private long processingStartTime;
// The time that processing ended on this operation.
private long processingStopTime;
// The time that the search time limit has expired.
private long timeLimitExpiration;
// The matched values control associated with this search operation.
private MatchedValuesControl matchedValuesControl;
// The persistent search associated with this search operation.
private PersistentSearch persistentSearch;
// The raw, unprocessed filter as included in the request from the client.
// The search filter for the search operation.
private SearchFilter filter;
// The search scope for the search operation.
private SearchScope scope;
/**
* Creates a new search operation with the provided information.
*
* @param clientConnection The client connection with which this operation
* is associated.
* @param operationID The operation ID for this operation.
* @param messageID The message ID of the request with which this
* operation is associated.
* @param requestControls The set of controls included in the request.
* @param rawBaseDN The raw, unprocessed base DN as included in the
* request from the client.
* @param scope The scope for this search operation.
* @param derefPolicy The alias dereferencing policy for this search
* operation.
* @param sizeLimit The size limit for this search operation.
* @param timeLimit The time limit for this search operation.
* @param typesOnly The typesOnly flag for this search operation.
* @param rawFilter the raw, unprocessed filter as included in the
* request from the client.
* @param attributes The requested attributes for this search
* operation.
*/
{
this.derefPolicy = derefPolicy;
if (attributes == null)
{
}
else
{
this.attributes = attributes;
}
{
}
else
{
if (sizeLimit <= 0)
{
}
else
{
}
}
{
}
else
{
if (timeLimit <= 0)
{
}
else
{
}
}
entriesSent = 0;
referencesSent = 0;
clientAcceptsReferrals = true;
includeUsableControl = false;
responseSent = new AtomicBoolean(false);
returnLDAPSubentries = false;
realAttributesOnly = false;
virtualAttributesOnly = false;
}
/**
* Creates a new search operation with the provided information.
*
* @param clientConnection The client connection with which this operation
* is associated.
* @param operationID The operation ID for this operation.
* @param messageID The message ID of the request with which this
* operation is associated.
* @param requestControls The set of controls included in the request.
* @param baseDN The base DN for this search operation.
* @param scope The scope for this search operation.
* @param derefPolicy The alias dereferencing policy for this search
* operation.
* @param sizeLimit The size limit for this search operation.
* @param timeLimit The time limit for this search operation.
* @param typesOnly The typesOnly flag for this search operation.
* @param filter The filter for this search operation.
* @param attributes The attributes for this search operation.
*/
{
this.derefPolicy = derefPolicy;
if (attributes == null)
{
}
else
{
this.attributes = attributes;
}
{
}
else
{
if (sizeLimit <= 0)
{
}
else
{
}
}
{
}
else
{
if (timeLimit <= 0)
{
}
else
{
}
}
entriesSent = 0;
referencesSent = 0;
clientAcceptsReferrals = true;
includeUsableControl = false;
responseSent = new AtomicBoolean(false);
returnLDAPSubentries = false;
}
/**
* 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.
*
* @return The raw, unprocessed base DN as included in the request from the
* client.
*/
public final ByteString getRawBaseDN()
{
return 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.
*
* @param rawBaseDN The raw, unprocessed base DN as included in the request
* from the client.
*/
{
}
/**
* 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 the <CODE>getRawBaseDN</CODE> method.
*
* @return The base DN for this search operation, or <CODE>null</CODE> if the
* raw base DN has not yet been processed.
*/
{
return baseDN;
}
/**
* Specifies the base DN for this search operation. This method is only
* intended for internal use.
*
* @param baseDN The base DN for this search operation.
*/
{
}
/**
* Retrieves the scope for this search operation.
*
* @return The scope for this search operation.
*/
public final SearchScope getScope()
{
return scope;
}
/**
* Specifies the scope for this search operation. This should only be called
* by pre-parse plugins.
*
* @param scope The scope for this search operation.
*/
{
}
/**
* Retrieves the alias dereferencing policy for this search operation.
*
* @return The alias dereferencing policy for this search operation.
*/
public final DereferencePolicy getDerefPolicy()
{
return derefPolicy;
}
/**
* Specifies the alias dereferencing policy for this search operation. This
* should only be called by pre-parse plugins.
*
* @param derefPolicy The alias dereferencing policy for this search
* operation.
*/
{
this.derefPolicy = derefPolicy;
}
/**
* Retrieves the size limit for this search operation.
*
* @return The size limit for this search operation.
*/
public final int getSizeLimit()
{
return sizeLimit;
}
/**
* Specifies the size limit for this search operation. This should only be
* called by pre-parse plugins.
*
* @param sizeLimit The size limit for this search operation.
*/
public final void setSizeLimit(int sizeLimit)
{
}
/**
* Retrieves the time limit for this search operation.
*
* @return The time limit for this search operation.
*/
public final int getTimeLimit()
{
return timeLimit;
}
/**
* Specifies the time limit for this search operation. This should only be
* called by pre-parse plugins.
*
* @param timeLimit The time limit for this search operation.
*/
public final void setTimeLimit(int timeLimit)
{
}
/**
* Retrieves the typesOnly flag for this search operation.
*
* @return The typesOnly flag for this search operation.
*/
public final boolean getTypesOnly()
{
return typesOnly;
}
/**
* Specifies the typesOnly flag for this search operation. This should only
* be called by pre-parse plugins.
*
* @param typesOnly The typesOnly flag for this search operation.
*/
public final void setTypesOnly(boolean typesOnly)
{
}
/**
* 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.
*
* @return The raw, unprocessed search filter as included in the request from
* the client.
*/
public final RawFilter getRawFilter()
{
return 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.
*
* @param rawFilter The raw, unprocessed search filter as included in the
* request from the client.
*/
{
}
/**
* 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.
*
* @return The filter for this search operation, or <CODE>null</CODE> if the
* raw filter has not yet been processed.
*/
public final SearchFilter getFilter()
{
return filter;
}
/**
* Retrieves the set of requested attributes for this search operation. Its
* contents should not be be altered.
*
* @return The set of requested attributes for this search operation.
*/
{
return attributes;
}
/**
* Specifies the set of requested attributes for this search operation. It
* should only be called by pre-parse plugins.
*
* @param attributes The set of requested attributes for this search
* operation.
*/
{
if (attributes == null)
{
this.attributes.clear();
}
else
{
this.attributes = attributes;
}
}
/**
* Retrieves the number of entries sent to the client for this search
* operation.
*
* @return The number of entries sent to the client for this search
* operation.
*/
public final int getEntriesSent()
{
return entriesSent;
}
/**
* Retrieves the number of search references sent to the client for this
* search operation.
*
* @return The number of search references sent to the client for this search
* operation.
*/
public final int getReferencesSent()
{
return referencesSent;
}
/**
* {@inheritDoc}
*/
@Override()
public final long getProcessingStartTime()
{
return processingStartTime;
}
/**
* {@inheritDoc}
*/
@Override()
public final long getProcessingStopTime()
{
return processingStopTime;
}
/**
* {@inheritDoc}
*/
@Override()
public final long getProcessingTime()
{
return (processingStopTime - processingStartTime);
}
/**
* 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.
*
* @param entry The entry that matches the search criteria and should be
* sent to the client.
* @param controls The set of controls to include with the entry (may be
* <CODE>null</CODE> if none are needed).
*
* @return <CODE>true</CODE> if the caller should continue processing the
* search request and sending additional entries and references, or
* <CODE>false</CODE> if not for some reason (e.g., the size limit
* has been reached or the search has been abandoned).
*/
{
// See if the operation has been abandoned. If so, then don't send the
// entry and indicate that the search should end.
if (cancelRequest != null)
{
return false;
}
// See if the size limit has been exceeded. If so, then don't send the
// entry and indicate that the search should end.
{
sizeLimit));
return false;
}
// See if the time limit has expired. If so, then don't send the entry and
// indicate that the search should end.
{
timeLimit));
return false;
}
// Determine whether the provided entry is a subentry and if so whether it
// should be returned.
{
// Check to see if the filter contains an equality element with the
// objectclass attribute type and a value of "ldapSubentry". If so, then
// we'll return it anyway. Technically, this isn't part of the
// specification so we don't need to get carried away with really in-depth
// checks.
switch (filter.getFilterType())
{
case AND:
case OR:
{
(f.getAttributeType().isObjectClassType()))
{
AttributeValue v = f.getAssertionValue();
{
returnLDAPSubentries = true;
}
break;
}
}
break;
case EQUALITY:
if (t.isObjectClassType())
{
{
returnLDAPSubentries = true;
}
}
break;
}
if (! returnLDAPSubentries)
{
// We still shouldn't return it even based on the filter. Just throw it
// away without doing anything.
return true;
}
}
// Determine whether to include the account usable control. If so, then
// create it now.
if (includeUsableControl)
{
try
{
// FIXME -- Need a way to enable PWP debugging.
false);
{
{
}
}
else
{
{
}
}
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
// Check to see if the entry can be read by the client.
controls);
return true;
}
// Make a copy of the entry and pare it down to only include the set
// of
// requested attributes.
{
true);
}
else
{
{
{
// This is a special placeholder indicating that all user attributes
// should be returned.
if (typesOnly)
{
// First, add the placeholder for the objectclass attribute.
}
else
{
// First, add the objectclass attribute.
try
{
}
catch (DirectoryException e)
{
// We cannot get this exception because the object classes have
// already been validated in the entry they came from.
}
}
// Next iterate through all the user attributes and include them.
{
}
continue;
}
{
// This is a special placeholder indicating that all operational
// attributes should be returned.
{
}
continue;
}
if (semicolonPos > 0)
{
while (nextPos > 0)
{
}
}
else
{
}
{
boolean added = false;
{
if (t.hasNameOrOID(lowerName))
{
{
added = true;
break;
}
}
}
if (added)
{
continue;
}
{
if (t.hasNameOrOID(lowerName))
{
{
break;
}
}
}
}
else
{
if (attrType.isObjectClassType()) {
if (typesOnly)
{
}
else
{
}
}
else
{
{
}
{
}
}
}
}
}
if (realAttributesOnly)
{
}
else if (virtualAttributesOnly)
{
}
// If there is a matched values control, then further pare down the entry
// based on the filters that it contains.
{
// First, look at the set of objectclasses.
while (ocIterator.hasNext())
{
new ASN1OctetString(ocName));
{
ocIterator.remove();
}
}
// Next, the set of user attributes.
{
{
while (valueIterator.hasNext())
{
if (! matchedValuesControl.valueMatches(t, v))
{
}
}
}
}
// Then the set of operational attributes.
{
{
while (valueIterator.hasNext())
{
if (! matchedValuesControl.valueMatches(t, v))
{
}
}
}
}
}
// Convert the provided entry to a search result entry.
controls);
// Strip out any attributes that the client does not have access to.
// FIXME: need some way to prevent plugins from adding attributes or
// values that the client is not permitted to see.
// Invoke any search entry plugins that may be registered with the server.
if (pluginResult.connectionTerminated())
{
// We won't attempt to send this entry, and we won't continue with
// any processing. Just update the operation to indicate that it was
// cancelled and return false.
return false;
}
// Send the entry to the client.
if (pluginResult.sendEntry())
{
try
{
// Log the entry sent to the client.
logSearchResultEntry(this, searchEntry);
entriesSent++;
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
return false;
}
}
return pluginResult.continueSearch();
}
/**
* 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.
*
* @param reference The search reference to send to the client.
*
* @return <CODE>true</CODE> if the caller should continue processing the
* search request and sending additional entries and references , or
* <CODE>false</CODE> if not for some reason (e.g., the size limit
* has been reached or the search has been abandoned).
*/
{
// See if the operation has been abandoned. If so, then don't send the
// reference and indicate that the search should end.
if (cancelRequest != null)
{
return false;
}
// See if the time limit has expired. If so, then don't send the entry and
// indicate that the search should end.
{
timeLimit));
return false;
}
// See if we know that this client can't handle referrals. If so, then
// don't even try to send it.
if (! clientAcceptsReferrals)
{
return true;
}
// See if the client has permission to read this reference.
return true;
}
// Invoke any search reference plugins that may be registered with the
// server.
if (pluginResult.connectionTerminated())
{
// We won't attempt to send this entry, and we won't continue with
// any processing. Just update the operation to indicate that it was
// cancelled and return false.
return false;
}
// Send the reference to the client. Note that this could throw an
// exception, which would indicate that the associated client can't handle
// referrals. If that't the case, then set a flag so we'll know not to try
// to send any more.
if (pluginResult.sendReference())
{
try
{
{
// Log the entry sent to the client.
logSearchResultReference(this, reference);
// FIXME -- Should the size limit apply here?
}
else
{
// We know that the client can't handle referrals, so we won't try to
// send it any more.
clientAcceptsReferrals = false;
}
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
return false;
}
}
return pluginResult.continueSearch();
}
/**
* 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.
*/
public final void sendSearchResultDone()
{
// Send the search result done message to the client. We want to make sure
// that this only gets sent once, and it's possible that this could be
// multithreaded in the event of a persistent search, so do it safely.
if (responseSent.compareAndSet(false, true))
{
// Send the response to the client.
clientConnection.sendResponse(this);
// Log the search result.
logSearchResultDone(this);
// Invoke the post-response search plugins.
}
}
/**
* {@inheritDoc}
*/
@Override()
public final OperationType getOperationType()
{
// Note that no debugging will be done in this method because it is a likely
// candidate for being called by the logging subsystem.
return OperationType.SEARCH;
}
/**
* {@inheritDoc}
*/
@Override()
int messageID)
{
// Before calling clientConnection.disconnect, we need to mark this
// operation as cancelled so that the attempt to cancel it later won't cause
// an unnecessary delay.
}
/**
* {@inheritDoc}
*/
@Override()
public final String[][] getRequestLogElements()
{
// Note that no debugging will be done in this method because it is a likely
// candidate for being called by the logging subsystem.
{
}
else
{
{
}
}
return new String[][]
{
};
}
/**
* {@inheritDoc}
*/
@Override()
public final String[][] getResponseLogElements()
{
// Note that no debugging will be done in this method because it is a likely
// candidate for being called by the logging subsystem.
if (errorMessageBuffer == null)
{
errorMessage = null;
}
else
{
}
{
matchedDNStr = null;
}
else
{
}
{
}
else
{
{
}
}
return new String[][]
{
new String[] { LOG_ELEMENT_REFERENCES_SENT,
};
}
/**
* {@inheritDoc}
*/
@Override()
{
return responseControls;
}
/**
* {@inheritDoc}
*/
@Override()
{
}
/**
* {@inheritDoc}
*/
@Override()
{
}
/**
* {@inheritDoc}
*/
@Override()
public final void run()
{
boolean sendResponse = true;
// Get the plugin config manager that will be used for invoking plugins.
boolean skipPostOperation = false;
// Start the processing timer.
if (timeLimit <= 0)
{
}
else
{
// FIXME -- Factor in the user's effective time limit.
}
// Check for and handle a request to cancel this operation.
if (cancelRequest != null)
{
return;
}
// Create a labeled block of code that we can break out of if a problem is
// detected.
{
{
// There's no point in continuing with anything. Log the request and
// result and return.
logSearchRequest(this);
logSearchResultDone(this);
return;
}
else if (preParseResult.sendResponseImmediately())
{
skipPostOperation = true;
logSearchRequest(this);
break searchProcessing;
}
// Log the search request message.
logSearchRequest(this);
// Check for and handle a request to cancel this operation.
if (cancelRequest != null)
{
logSearchResultDone(this);
return;
}
// Process the search base and filter to convert them from their raw forms
// as provided by the client to the forms required for the rest of the
// search processing.
try
{
{
}
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
break searchProcessing;
}
try
{
{
}
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
break searchProcessing;
}
// Check to see if there are any controls in the request. If so, then
// see if there is any special processing required.
boolean processSearch = true;
{
{
{
if (c instanceof LDAPAssertionRequestControl)
{
}
else
{
try
{
}
catch (LDAPException le)
{
if (debugEnabled())
{
}
break searchProcessing;
}
}
try
{
// FIXME -- We need to determine whether the current user has
// permission to make this determination.
try
{
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
break searchProcessing;
}
{
break searchProcessing;
}
{
break searchProcessing;
}
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
break searchProcessing;
}
}
{
// The requester must have the PROXIED_AUTH privilige in order to be
// able to use this control.
{
break searchProcessing;
}
if (c instanceof ProxiedAuthV1Control)
{
proxyControl = (ProxiedAuthV1Control) c;
}
else
{
try
{
}
catch (LDAPException le)
{
if (debugEnabled())
{
}
break searchProcessing;
}
}
try
{
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
break searchProcessing;
}
authorizationEntry) == false) {
skipPostOperation = true;
break searchProcessing;
}
}
{
// The requester must have the PROXIED_AUTH privilige in order to be
// able to use this control.
{
break searchProcessing;
}
if (c instanceof ProxiedAuthV2Control)
{
proxyControl = (ProxiedAuthV2Control) c;
}
else
{
try
{
}
catch (LDAPException le)
{
if (debugEnabled())
{
}
break searchProcessing;
}
}
try
{
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
break searchProcessing;
}
authorizationEntry) == false) {
skipPostOperation = true;
break searchProcessing;
}
}
{
if (c instanceof PersistentSearchControl)
{
}
else
{
try
{
}
catch (LDAPException le)
{
if (debugEnabled())
{
}
break searchProcessing;
}
}
// If we're only interested in changes, then we don't actually want
// to process the search now.
if (psearchControl.getChangesOnly())
{
processSearch = false;
}
}
{
returnLDAPSubentries = true;
}
{
if (c instanceof MatchedValuesControl)
{
}
else
{
try
{
}
catch (LDAPException le)
{
if (debugEnabled())
{
}
break searchProcessing;
}
}
}
{
includeUsableControl = true;
}
{
realAttributesOnly = true;
}
{
virtualAttributesOnly = true;
}
// NYI -- Add support for additional controls.
else if (c.isCritical())
{
{
break searchProcessing;
}
}
}
}
// Check to see if the client has permission to perform the
// search.
// FIXME: for now assume that this will check all permission
// pertinent to the operation. This includes proxy authorization
// and any other controls specified.
.getAccessControlHandler().isAllowed(this) == false) {
skipPostOperation = true;
break searchProcessing;
}
// Check for and handle a request to cancel this operation.
if (cancelRequest != null)
{
logSearchResultDone(this);
return;
}
// Invoke the pre-operation search plugins.
if (preOpResult.connectionTerminated())
{
// There's no point in continuing with anything. Log the request and
// result and return.
logSearchResultDone(this);
return;
}
else if (preOpResult.sendResponseImmediately())
{
skipPostOperation = true;
break searchProcessing;
}
// Check for and handle a request to cancel this operation.
if (cancelRequest != null)
{
logSearchResultDone(this);
return;
}
// Get the backend that should hold the search base. If there is none,
// then fail.
{
break searchProcessing;
}
// We'll set the result code to "success". If a problem occurs, then it
// will be overwritten.
// If there's a persistent search, then register it with the server.
if (persistentSearch != null)
{
sendResponse = false;
}
// Process the search in the backend and all its subordinates.
try
{
if (processSearch)
{
}
}
catch (DirectoryException de)
{
if (debugEnabled())
{
}
if (persistentSearch != null)
{
sendResponse = true;
}
break searchProcessing;
}
catch (CancelledOperationException coe)
{
if (debugEnabled())
{
}
{
}
if (persistentSearch != null)
{
sendResponse = true;
}
skipPostOperation = true;
break searchProcessing;
}
catch (Exception e)
{
if (debugEnabled())
{
}
if (persistentSearch != null)
{
sendResponse = true;
}
skipPostOperation = true;
break searchProcessing;
}
}
// Check for and handle a request to cancel this operation.
if (cancelRequest != null)
{
logSearchResultDone(this);
return;
}
// Invoke the post-operation search plugins.
if (! skipPostOperation)
{
{
logSearchResultDone(this);
return;
}
}
// Indicate that it is now too late to attempt to cancel the operation.
// Stop the processing timer.
// If everything is successful to this point and it is not a persistent
// search, then send the search result done message to the client.
// Otherwise, we'll want to make the size and time limit values unlimited
// to ensure that the remainder of the persistent search isn't subject to
// those restrictions.
if (sendResponse)
{
}
else
{
sizeLimit = 0;
timeLimit = 0;
}
}
/**
* Processes the search in the provided backend and recursively through its
* subordinate backends.
*
* @param backend The backend in which to process the search.
*
* @throws DirectoryException If a problem occurs while processing the
* search.
*
* @throws CancelledOperationException If the backend noticed and reacted
* to a request to cancel or abandon the
* search operation.
*/
{
// Check for and handle a request to cancel this operation.
if (cancelRequest != null)
{
return;
}
// Perform the search in the provided backend.
// If there are any subordinate backends, then process the search there as
// well.
for (Backend b : subBackends)
{
{
{
searchBackend(b);
break;
}
}
}
}
/**
* {@inheritDoc}
*/
@Override()
{
this.cancelRequest = cancelRequest;
if (persistentSearch != null)
{
}
while ((cancelResult == null) &&
{
try
{
}
catch (Exception e)
{
if (debugEnabled())
{
}
}
}
if (cancelResult == null)
{
// This can happen in some rare cases (e.g., if a client disconnects and
// there is still a lot of data to send to that client), and in this case
// we'll prevent the cancel thread from blocking for a long period of
// time.
}
return cancelResult;
}
/**
* {@inheritDoc}
*/
@Override()
public final CancelRequest getCancelRequest()
{
return cancelRequest;
}
/**
* {@inheritDoc}
*/
@Override()
{
this.cancelRequest = cancelRequest;
return true;
}
/**
* {@inheritDoc}
*/
@Override()
{
}
}