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 void
close()
java.lang.Boolean
destroy(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.String
getType()
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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
-
getType
public java.lang.String getType()
Description copied from interface:QueryService
Get the doc ref type that this service wraps.- Specified by:
getType
in interfaceQueryService
- Returns:
- The doc ref type name
-
getDataSource
public java.util.Optional<DataSource> getDataSource(ServiceUser user, DocRef docRef) throws QueryApiException
Description copied from interface:QueryService
Get the details of the DataSource given by the DocRef. Used to build user interfaces for querying the specific data.- Specified by:
getDataSource
in 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:QueryService
Conduct a search on the data, it may be a successive call for long running searches.- Specified by:
search
in 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:QueryService
Destroy any existing query being conducted under the given key.- Specified by:
destroy
in 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:QueryService
Used 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:
getDocRefForQueryKey
in 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.
-
-