Interface QueryService

    • Method Detail

      • getType

        java.lang.String getType()
        Get the doc ref type that this service wraps.
        Returns:
        The doc ref type name
      • getDataSource

        java.util.Optional<DataSource> getDataSource​(ServiceUser user,
                                                     DocRef docRef)
                                              throws QueryApiException
        Get the details of the DataSource given by the DocRef. Used to build user interfaces for querying the specific data.
        Parameters:
        user - The authenticated user
        docRef - The Doc Ref of the DataSource to fetch
        Returns:
        The DataSource definition for the given doc ref
        Throws:
        QueryApiException - if anything goes wrong
      • search

        java.util.Optional<SearchResponse> search​(ServiceUser user,
                                                  SearchRequest request)
                                           throws QueryApiException
        Conduct a search on the data, it may be a successive call for long running searches.
        Parameters:
        user - The authenticated user
        request - The details of the search
        Returns:
        An optional search response.
        Throws:
        QueryApiException - if anything goes wrong
      • destroy

        java.lang.Boolean destroy​(ServiceUser user,
                                  QueryKey queryKey)
                           throws QueryApiException
        Destroy any existing query being conducted under the given key.
        Parameters:
        user - The authenticated user
        queryKey - The query key that was given with the search request.
        Returns:
        Success indicator
        Throws:
        QueryApiException - if anything goes wrong
      • getDocRefForQueryKey

        java.util.Optional<DocRef> getDocRefForQueryKey​(ServiceUser user,
                                                        QueryKey queryKey)
                                                 throws QueryApiException
        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.
        Parameters:
        user - The authenticated user
        queryKey - 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.
        Throws:
        QueryApiException - if anything goes wrong