Package stroom.query.audit.client
Class QueryServiceHttpClient
- java.lang.Object
-
- stroom.query.audit.client.QueryServiceHttpClient
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,QueryService
public class QueryServiceHttpClient extends java.lang.Object implements QueryService, java.io.Closeable
-
-
Constructor Summary
Constructors Constructor Description QueryServiceHttpClient(java.lang.String type, java.lang.String baseUrl)
-
Method Summary
Modifier and Type Method Description voidclose()java.lang.Booleandestroy(ServiceUser user, QueryKey queryKey)Destroy any existing query being conducted under the given key.java.util.Optional<DataSource>getDataSource(ServiceUser user, DocRef docRef)Get the details of the DataSource given by the DocRef.java.util.Optional<DocRef>getDocRefForQueryKey(ServiceUser user, QueryKey queryKey)Used by REST layer to retrieve the doc ref for a given query key.java.lang.StringgetType()Get the doc ref type that this service wraps.java.util.Optional<SearchResponse>search(ServiceUser user, SearchRequest request)Conduct a search on the data, it may be a successive call for long running searches.
-
-
-
Method Detail
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
getType
public java.lang.String getType()
Description copied from interface:QueryServiceGet the doc ref type that this service wraps.- Specified by:
getTypein interfaceQueryService- Returns:
- The doc ref type name
-
getDataSource
public java.util.Optional<DataSource> getDataSource(ServiceUser user, DocRef docRef) throws QueryApiException
Description copied from interface:QueryServiceGet the details of the DataSource given by the DocRef. Used to build user interfaces for querying the specific data.- Specified by:
getDataSourcein interfaceQueryService- Parameters:
user- The authenticated userdocRef- The Doc Ref of the DataSource to fetch- Returns:
- The DataSource definition for the given doc ref
- Throws:
QueryApiException- if anything goes wrong
-
search
public java.util.Optional<SearchResponse> search(ServiceUser user, SearchRequest request) throws QueryApiException
Description copied from interface:QueryServiceConduct a search on the data, it may be a successive call for long running searches.- Specified by:
searchin interfaceQueryService- Parameters:
user- The authenticated userrequest- The details of the search- Returns:
- An optional search response.
- Throws:
QueryApiException- if anything goes wrong
-
destroy
public java.lang.Boolean destroy(ServiceUser user, QueryKey queryKey) throws QueryApiException
Description copied from interface:QueryServiceDestroy any existing query being conducted under the given key.- Specified by:
destroyin interfaceQueryService- Parameters:
user- The authenticated userqueryKey- The query key that was given with the search request.- Returns:
- Success indicator
- Throws:
QueryApiException- if anything goes wrong
-
getDocRefForQueryKey
public java.util.Optional<DocRef> getDocRefForQueryKey(ServiceUser user, QueryKey queryKey)
Description copied from interface:QueryServiceUsed by REST layer to retrieve the doc ref for a given query key. Primarily used to check the permissions for the given doc ref.- Specified by:
getDocRefForQueryKeyin interfaceQueryService- Parameters:
user- The authenticated userqueryKey- The query key, it should match a current query- Returns:
- The DocRef of the query, if found, if not found the result will be empty.
-
-