Class SavedResultsResourceImpl
- java.lang.Object
-
- com.artisol.teneo.inquire.client.resources.AbstractResource
-
- com.artisol.teneo.inquire.client.resources.SavedResultsResourceImpl
-
- All Implemented Interfaces:
com.artisol.teneo.inquire.api.resources.SavedResultsResource
public class SavedResultsResourceImpl extends AbstractResource implements com.artisol.teneo.inquire.api.resources.SavedResultsResource
-
-
Field Summary
-
Fields inherited from interface com.artisol.teneo.inquire.api.resources.SavedResultsResource
DELETE_SAVED_RESULT_PATH, DELETE_SAVED_RESULT_SUMMARY, GET_SAVED_RESULTS_EXPORT_PACKAGE_PATH, GET_SAVED_RESULTS_EXPORT_PACKAGE_SUMMARY, GET_SAVED_RESULTS_EXPORT_PATH, GET_SAVED_RESULTS_EXPORT_SUMMARY, GET_SAVED_RESULTS_PATH, GET_SAVED_RESULTS_SUMMARY, PATH, POST_SAVED_RESULT_CREATE_PATH, POST_SAVED_RESULT_CREATE_SUMMARY, PUT_SAVED_RESULT_UPDATE_PATH, PUT_SAVED_RESULT_UPDATE_SUMMARY
-
-
Constructor Summary
Constructors Constructor Description SavedResultsResourceImpl(javax.ws.rs.client.WebTarget webTarget)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.artisol.teneo.inquire.api.models.SavedResult
createSavedResult(String ldsName, String savedResultId, InputStream data)
Stores a saved result into Elasticsearch.void
deleteSavedResult(String ldsName, String savedResultId)
Deletes from the Elasticsearch storage the saved result with the given name.InputStream
exportSavedResult(String ldsName, String savedResultId, String format)
Returns the content for a saved result.InputStream
exportSavedResultsPackage(String ldsName, List<String> savedResultIds)
Returns a zip file containing previously saved results.List<com.artisol.teneo.inquire.api.models.SavedResult>
getSavedResults(String ldsName)
Gets saved results for a given LDS.com.artisol.teneo.inquire.api.models.SavedResult
updateSavedResult(String ldsName, String savedResultId, InputStream data)
Updates a saved result stored in Elasticsearch.
-
-
-
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 namesavedResultId
- The saved result IDdata
- 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 namesavedResultId
- The saved result IDdata
- 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 namesavedResultId
- 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 namesavedResultId
- The saved result IDformat
- 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 namesavedResultIds
- 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
-
-