The main page for this API client can be found here. This release contains breaking changes, new features, and improved documentation. One can find the library’s code here. The latest release of the precompiled JAR can be found here.
Table of contents
Breaking changes
This release contains breaking changes, as some functions have been altered. These changes were made as a HTTP status code check has been implemented. If a HTTP status code is below 100, or more than (or equal to) 400, an IOException will be thrown.
As a result, bulk functions that potentially handle larger data sets have been altered. The downloadSamples functions now require a second argument, which decides if an exception should be suppressed or not. If exceptions are suppressed, the returned mapping will return all samples that have been downloaded successfully. If exceptions are not suppressed, any example is thrown. As such, the mapping prior to the thrown exception is lost. The affected functions are listed below.
public Map<String, Byte[]> downloadSamples(List<String> sampleIds, boolean suppressExceptions) throws IOException public Map<String, Byte[]> downloadSamples(TriageReport[] reports, boolean suppressExceptions) throws IOException public Map<String, Byte[]> downloadSamples(Sample[] samples, boolean suppressExceptions) throws IOException public Map<String, Byte[]> downloadSamples(TargetDesc[] targetDescs, boolean suppressExceptions) throws IOException
New features
This release contains several new functions, some of which are bulk wrappers for existing functions (such as uploadSamplesViaUrls for uploadSampleViaUrl). The other functions can be used to wait until the analysis of a sample (or list of samples) has finished. To wait until a sample is finished, getSampleEvents is to be used. To obtain the current status of a sample, one needs to use getSampleStatus. Both functions have a bulk wrapper, as can be seen in the overview of newly added functions below.
//Returns only once the given sample's analysis has finished public SampleEvents getSampleEvents(String sampleId) throws IOException //Bulk wrapper for getSampleEvents public Map<String, SampleEvents> awaitSampleAnalysisCompletion(List<String> sampleIds, boolean suppressExceptions) throws IOException //Bulk wrapper for getSampleStatus public Map<String, String> getSampleStatuses(List<String> sampleIds, boolean suppressExceptions) throws IOException //Bulk wrapper for uploadSampleViaUrl public Map<String, FileUploadResult> uploadSamplesViaUrls(List<String> urls) throws IOException //Bulk wrapper for uploadUrl public Map<String, FileUploadResult> uploadUrls(List<String> urls) throws IOException
Two new models have been added (being Events and SampleEvents) as they are used in the event related functions.
Lastly, the getSampleStatus function has been renewed. The old endpoint was deprecated and was removed by Triage. The new function is a wrapper for getSample(triageId).getStatus(), which has been added to maintain backwards compatibility, and since it is a convenient function to use. The function itself has not changed, as can be seen below.
public String getSampleStatus(String sampleId) throws IOException
Improved documentation
The JavaDoc for all functions in the TriageApi class has been updated, as spelling mistakes have been fixed, some missing documentation has been added, and the readability of the documentation has been improved greatly.
To contact me, you can e-mail me at [info][at][maxkersten][dot][nl], or DM me on BlueSky @maxkersten.nl.