Package ddf.catalog.operation.impl
Class QueryResponseImpl
java.lang.Object
ddf.catalog.operation.impl.OperationImpl
ddf.catalog.operation.impl.ResponseImpl<ddf.catalog.operation.QueryRequest>
ddf.catalog.operation.impl.QueryResponseImpl
- All Implemented Interfaces:
ddf.catalog.operation.Operation,ddf.catalog.operation.QueryResponse,ddf.catalog.operation.Response<ddf.catalog.operation.QueryRequest>,ddf.catalog.operation.SourceResponse,Serializable
public class QueryResponseImpl
extends ResponseImpl<ddf.catalog.operation.QueryRequest>
implements ddf.catalog.operation.QueryResponse
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected AtomicLongprotected AtomicBooleanprotected static final ddf.catalog.data.ResultFields inherited from class ddf.catalog.operation.impl.ResponseImpl
requestFields inherited from interface ddf.catalog.operation.QueryResponse
ELAPSED_TIME, SITE_LIST, TOTAL_HITS, TOTAL_RESULTS_RETURNED -
Constructor Summary
ConstructorsConstructorDescriptionQueryResponseImpl(ddf.catalog.operation.QueryRequest request) Instantiates a new QueryResponseImpl with a $(@link QueryRequest)QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, boolean closeResultQueue, long hits) Instantiates a new QueryResponseImpl with a $(@link QueryRequest), a $Listof results, a closeResultQueue indicator, and a number of hits to returnQueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, boolean closeResultQueue, long hits, Map<String, Serializable> properties) QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, boolean shouldCloseResultQueue, long hits, Map<String, Serializable> properties, Set<ddf.catalog.operation.ProcessingDetails> processingDetails) QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, long totalHits) Instantiates a new QueryResponseImpl with a $(@link QueryRequest) and and a $Listof resultsQueryResponseImpl(ddf.catalog.operation.QueryRequest request, Map<String, Serializable> properties) Instantiates a new QueryResponseImpl with a $(@link QueryRequest) and and a $Mapof propertiesQueryResponseImpl(ddf.catalog.operation.SourceResponse response, String sourceId) Construct from an underlyingSourceResponse -
Method Summary
Modifier and TypeMethodDescriptionvoidaddResult(ddf.catalog.data.Result result, boolean closeQueue) Adds a $Resultto this QueryResponse, and specifies whether or not to close the queuevoidaddResults(List<ddf.catalog.data.Result> results, boolean closeQueue) Adds a $Listof $Results to this QueryResponse, and specifies whether or not to close the queuevoidlonggetHits()Set<ddf.catalog.operation.ProcessingDetails>List<ddf.catalog.data.Result>booleanddf.catalog.data.Resultpoll()ddf.catalog.data.Resultpoll(long timeout) voidsetHits(long hits) voidsetProcessingDetails(Set<ddf.catalog.operation.ProcessingDetails> details) ddf.catalog.data.Resulttake()List<ddf.catalog.data.Result>take(long size) Methods inherited from class ddf.catalog.operation.impl.ResponseImpl
getRequestMethods inherited from class ddf.catalog.operation.impl.OperationImpl
containsPropertyName, getProperties, getPropertyNames, getPropertyValue, hasProperties, setPropertiesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ddf.catalog.operation.Operation
containsPropertyName, getProperties, getPropertyNames, getPropertyValue, hasPropertiesMethods inherited from interface ddf.catalog.operation.Response
getProcessingErrors, getRequest
-
Field Details
-
POISON_PILL_RESULT
protected static final ddf.catalog.data.Result POISON_PILL_RESULT -
hits
-
isQueueClosed
-
-
Constructor Details
-
QueryResponseImpl
public QueryResponseImpl(ddf.catalog.operation.QueryRequest request) Instantiates a new QueryResponseImpl with a $(@link QueryRequest)- Parameters:
request- the request
-
QueryResponseImpl
public QueryResponseImpl(ddf.catalog.operation.QueryRequest request, Map<String, Serializable> properties) Instantiates a new QueryResponseImpl with a $(@link QueryRequest) and and a $Mapof properties- Parameters:
request- the requestproperties-
-
QueryResponseImpl
public QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, long totalHits) Instantiates a new QueryResponseImpl with a $(@link QueryRequest) and and a $Listof results- Parameters:
request- the requestresults- the results
-
QueryResponseImpl
public QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, boolean closeResultQueue, long hits) Instantiates a new QueryResponseImpl with a $(@link QueryRequest), a $Listof results, a closeResultQueue indicator, and a number of hits to return- Parameters:
request- the requestresults- the resultshits- the hits
-
QueryResponseImpl
public QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, boolean closeResultQueue, long hits, Map<String, Serializable> properties) Instantiates a new QueryResponseImpl with a $(@link QueryRequest), a $Listof results, a closeResultQueue indicator, a number of hits to return, and a $Mapof properties- Parameters:
request- the requestresults- the resultshits- the hitsproperties- the properties
-
QueryResponseImpl
public QueryResponseImpl(ddf.catalog.operation.QueryRequest request, List<ddf.catalog.data.Result> results, boolean shouldCloseResultQueue, long hits, Map<String, Serializable> properties, Set<ddf.catalog.operation.ProcessingDetails> processingDetails) Instantiates a newQueryResponseImplwith: aQueryRequest, aListofResults, the indicator of whether to close thequeue, the number ofResults, properties, and aSetofProcessingDetails- Parameters:
request- theQueryRequestused to elicit thisQueryResponseImplresults- theListofResults which the execution of the request has returnedshouldCloseResultQueue- the indicator of whether to close thisQueryResponseImpl'squeueofResults or to leave thequeueopen so that it may continue to addResults as they become availablehits- the number of distinctResults in the list of resultsproperties- theMapfrom each key of thisQueryResponseImpl's properties to its valueprocessingDetails- theSetofProcessingDetailswhich the execution of the request generated
-
QueryResponseImpl
Construct from an underlyingSourceResponse- Parameters:
response-sourceId-
-
-
Method Details
-
getHits
public long getHits()- Specified by:
getHitsin interfaceddf.catalog.operation.SourceResponse
-
setHits
public void setHits(long hits) -
getProcessingDetails
- Specified by:
getProcessingDetailsin interfaceddf.catalog.operation.QueryResponse- Specified by:
getProcessingDetailsin interfaceddf.catalog.operation.SourceResponse
-
setProcessingDetails
-
getResults
- Specified by:
getResultsin interfaceddf.catalog.operation.SourceResponse
-
addResult
public void addResult(ddf.catalog.data.Result result, boolean closeQueue) Adds a $Resultto this QueryResponse, and specifies whether or not to close the queue- Parameters:
result- the resultcloseQueue- the indicator for closing of the queue
-
addResults
Adds a $Listof $Results to this QueryResponse, and specifies whether or not to close the queue- Parameters:
results- the resultscloseQueue- the indicator for closing of the queue
-
hasMoreResults
public boolean hasMoreResults()- Specified by:
hasMoreResultsin interfaceddf.catalog.operation.QueryResponse
-
closeResultQueue
public void closeResultQueue() -
poll
public ddf.catalog.data.Result poll()- Specified by:
pollin interfaceddf.catalog.operation.QueryResponse
-
poll
public ddf.catalog.data.Result poll(long timeout) - Specified by:
pollin interfaceddf.catalog.operation.QueryResponse
-
take
public ddf.catalog.data.Result take()- Specified by:
takein interfaceddf.catalog.operation.QueryResponse
-
take
- Specified by:
takein interfaceddf.catalog.operation.QueryResponse
-