public class QueryResponseImpl extends ResponseImpl<QueryRequest> implements QueryResponse
| Modifier and Type | Class and Description |
|---|---|
protected static class |
QueryResponseImpl.POISON_PILL_RESULT |
| Modifier and Type | Field and Description |
|---|---|
protected long |
hits |
protected boolean |
isQueueClosed |
protected static Result |
POISON_PILL_RESULT |
requestELAPSED_TIME, SITE_LIST, TOTAL_HITS, TOTAL_RESULTS_RETURNED| Constructor and Description |
|---|
QueryResponseImpl(QueryRequest request)
Instantiates a new QueryResponseImpl with a $(@link QueryRequest)
|
QueryResponseImpl(QueryRequest request,
List<Result> results,
boolean closeResultQueue,
long hits)
Instantiates a new QueryResponseImpl with a $(@link QueryRequest), a $
List of results,
a closeResultQueue indicator, and a number of hits to return |
QueryResponseImpl(QueryRequest request,
List<Result> results,
boolean closeResultQueue,
long hits,
Map<String,Serializable> properties)
|
QueryResponseImpl(QueryRequest request,
List<Result> results,
long totalHits)
Instantiates a new QueryResponseImpl with a $(@link QueryRequest) and and a $
List of
results |
QueryResponseImpl(QueryRequest request,
Map<String,Serializable> properties)
Instantiates a new QueryResponseImpl with a $(@link QueryRequest) and and a $
Map of
properties |
QueryResponseImpl(SourceResponse response,
String sourceId)
Construct from an underlying
SourceResponse |
| Modifier and Type | Method and Description |
|---|---|
void |
addResult(Result result,
boolean closeQueue)
Adds a $
Result to this QueryResponse, and specifies whether or not to close the queue |
void |
addResults(List<Result> results,
boolean closeQueue)
|
void |
closeResultQueue() |
long |
getHits()
|
Set<ProcessingDetails> |
getProcessingDetails()
Get any specific details about the execution of the
QueryRequest associated with this
SourceResponse. |
List<Result> |
getResults()
Get the
Results of the associated QueryRequest |
boolean |
hasMoreResults() |
Result |
poll() |
Result |
poll(long timeout) |
void |
setHits(long hits) |
void |
setProcessingDetails(Set<ProcessingDetails> set) |
Result |
take() |
List<Result> |
take(long size) |
getRequestcontainsPropertyName, getProperties, getPropertyNames, getPropertyValue, hasProperties, setPropertiesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetProcessingErrors, getRequestcontainsPropertyName, getProperties, getPropertyNames, getPropertyValue, hasPropertiesprotected static final Result POISON_PILL_RESULT
protected long hits
protected boolean isQueueClosed
public QueryResponseImpl(QueryRequest request)
request - the requestpublic QueryResponseImpl(QueryRequest request, Map<String,Serializable> properties)
Map of
propertiesrequest - the requestproperties - public QueryResponseImpl(QueryRequest request, List<Result> results, long totalHits)
List of
resultsrequest - the requestresults - the resultspublic QueryResponseImpl(QueryRequest request, List<Result> results, boolean closeResultQueue, long hits)
List of results,
a closeResultQueue indicator, and a number of hits to returnrequest - the requestresults - the resultshits - the hitspublic QueryResponseImpl(QueryRequest request, List<Result> results, boolean closeResultQueue, long hits, Map<String,Serializable> properties)
List of results,
a closeResultQueue indicator, a number of hits to return, and a $Map of propertiesrequest - the requestresults - the resultshits - the hitsproperties - the propertiespublic QueryResponseImpl(SourceResponse response, String sourceId)
SourceResponseresponse - sourceId - public long getHits()
SourceResponseQuery for the associated Source, -1 if unknown. This is typically more than the number of Results returned from SourceResponse.getResults().getHits in interface SourceResponseQuery, -1 if unknown.public void setHits(long hits)
public Set<ProcessingDetails> getProcessingDetails()
SourceResponseQueryRequest associated with this
SourceResponse. Must not be null.getProcessingDetails in interface QueryResponsegetProcessingDetails in interface SourceResponsepublic void setProcessingDetails(Set<ProcessingDetails> set)
public List<Result> getResults()
SourceResponseResults of the associated QueryRequestgetResults in interface SourceResponsepublic void addResult(Result result, boolean closeQueue)
Result to this QueryResponse, and specifies whether or not to close the queueresult - the resultcloseQueue - the indicator for closing of the queuepublic void addResults(List<Result> results, boolean closeQueue)
results - the resultscloseQueue - the indicator for closing of the queuepublic boolean hasMoreResults()
hasMoreResults in interface QueryResponsepublic void closeResultQueue()
public Result poll()
poll in interface QueryResponsepublic Result poll(long timeout)
poll in interface QueryResponsepublic Result take()
take in interface QueryResponsepublic List<Result> take(long size)
take in interface QueryResponseThis work is licensed under a Creative Commons Attribution 4.0 International License.