Package stroom.query.common.v2
Class SearchResponseCreator
- java.lang.Object
-
- stroom.query.common.v2.SearchResponseCreator
-
public class SearchResponseCreator extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description SearchResponseCreator(Store store)
SearchResponseCreator(Store store, java.time.Duration defaultTimeout)
-
Method Summary
Modifier and Type Method Description SearchResponse
create(SearchRequest searchRequest)
Build aSearchResponse
from the passedSearchRequest
.static SearchResponse
createErrorResponse(java.util.List<java.lang.String> errorMessages)
void
destroy()
Stop searching and destroy any stored data.
-
-
-
Constructor Detail
-
SearchResponseCreator
public SearchResponseCreator(Store store)
- Parameters:
store
- The underlying store to use for creating the search responses.
-
SearchResponseCreator
public SearchResponseCreator(Store store, java.time.Duration defaultTimeout)
- Parameters:
store
- The underlying store to use for creating the search responses.defaultTimeout
- The service's default timeout period to use for waiting for the store to complete. This will be used when the search request hasn't specified a timeout period.
-
-
Method Detail
-
destroy
public void destroy()
Stop searching and destroy any stored data.
-
create
public SearchResponse create(SearchRequest searchRequest)
Build aSearchResponse
from the passedSearchRequest
.- Parameters:
searchRequest
- TheSearchRequest
containing the query terms and the result requests- Returns:
- A
SearchResponse
object that may be one of:- A 'complete'
SearchResponse
containing all the data requested - An incomplete
SearchResponse
containing none, some or all of the data requested, i.e the currently know results at the point the request is made. - An empty response with an error message indicating the request timed out waiting for a 'complete' result set. This only applies to non-incremental queries.
- An empty response with a different error message. This will happen when some unexpected error has
occurred while assembling the
SearchResponse
- A 'complete'
-
createErrorResponse
public static SearchResponse createErrorResponse(java.util.List<java.lang.String> errorMessages)
- Parameters:
errorMessages
- List of errors to add to theSearchResponse
- Returns:
- An empty
SearchResponse
with the passed error messages
-
-