Class SavedResultsResourceImpl

  • All Implemented Interfaces:
    com.artisol.teneo.inquire.api.resources.SavedResultsResource

    public class SavedResultsResourceImpl
    extends AbstractResource
    implements com.artisol.teneo.inquire.api.resources.SavedResultsResource
    • Constructor Detail

      • SavedResultsResourceImpl

        public SavedResultsResourceImpl​(javax.ws.rs.client.WebTarget webTarget)
    • Method Detail

      • createSavedResult

        public com.artisol.teneo.inquire.api.models.SavedResult createSavedResult​(String ldsName,
                                                                                  String savedResultId,
                                                                                  InputStream data)
                                                                           throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Stores a saved result into Elasticsearch. If the data already exists, an exception is thrown.
        Parameters:
        ldsName - The LDS name
        savedResultId - The saved result ID
        data - The results to be saved. It must be UTF-8 encoded JSON data, usually the result of a TQL query execution
        Returns:
        The created saved result
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution
      • updateSavedResult

        public com.artisol.teneo.inquire.api.models.SavedResult updateSavedResult​(String ldsName,
                                                                                  String savedResultId,
                                                                                  InputStream data)
                                                                           throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Updates a saved result stored in Elasticsearch. If the data exists, it is overwritten.
        Parameters:
        ldsName - The LDS name
        savedResultId - The saved result ID
        data - The results to be saved. It must be a UTF-8 encoded json file, usually the result of a TQL query execution
        Returns:
        The updated saved result
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution
      • getSavedResults

        public List<com.artisol.teneo.inquire.api.models.SavedResult> getSavedResults​(String ldsName)
                                                                               throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Gets saved results for a given LDS.
        Parameters:
        ldsName - The LDS name
        Returns:
        The list of saved results
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution
      • deleteSavedResult

        public void deleteSavedResult​(String ldsName,
                                      String savedResultId)
                               throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Deletes from the Elasticsearch storage the saved result with the given name.
        Parameters:
        ldsName - The LDS name
        savedResultId - The saved result ID
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution
      • exportSavedResult

        public InputStream exportSavedResult​(String ldsName,
                                             String savedResultId,
                                             String format)
                                      throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Returns the content for a saved result.
        Parameters:
        ldsName - The LDS name
        savedResultId - The saved result ID
        format - The desired result file format
        Returns:
        an InputStream containing the requested files contents
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution
      • exportSavedResultsPackage

        public InputStream exportSavedResultsPackage​(String ldsName,
                                                     List<String> savedResultIds)
                                              throws com.artisol.teneo.inquire.api.exceptions.InquireException
        Returns a zip file containing previously saved results.
        Parameters:
        ldsName - The LDS name
        savedResultIds - A list of saved result IDs for the given lds
        Returns:
        an InputStream containing the packaged saved results
        Throws:
        com.artisol.teneo.inquire.api.exceptions.InquireException - if an unexpected error occurs during the method execution