Cortex Java Client SDK Release Notes
2.1.0
Released: June 10, 2020
Release Highlights
Support for Query Parameters on GET operations
Added an overloaded get method to the CortexClient class to support GET operations on the specified resource path with the following passed query parameters:
/**
* Perform a generic GET operation on a Cortex resource with uri parameters. Expects a string object represents cortex response.
*
* @param resourcePath the resource path
* @param queryParameters the query parameters
* @return the string format response from cortex
*/
CortexResponse<String> get(String resourcePath, Map<String, Object> queryParameters);
This method makes a GET request to the Cortex base URL at the specified resource path along with the specified query parameters, such as zoom, and returns a String that contains the raw response from Cortex.
Annotation support for Format Parameters
A new Format annotation was added that can be applied to a DTO request class which tells the CortexClient to pass the specified values to Cortex in the format query parameter. For example:
/**
* Sales order request data transfer object.
*/
@Format({FormatOptionEnum.STANDARDLINKS, FormatOptionEnum.ZOOM_NODATALINKS, FormatOptionEnum.ZOOM_NOSELF})
public class SalesOrderRequest {
private List<OrderItem> items;
public List<OrderItem> getItems() {
return items;
}
}
Return HTTP status code in Exceptions
When a CortexClient request results in an error response from Cortex, indicated by a 4XX or 5XX HTTP status code, a CortexClientException is thrown. Previously, this exception class only contained the list of structured error messages or the text-based error message String returned in the Cortex response body. The exception class now also contains a getStatusCode() method that contains the HTTP status code response from Cortex.
Third Party Library Upgrades
Several third party libraries were upgraded to address reported security vulnerabilities in these dependencies.
| Library | New Version | Old Version |
|---|---|---|
| guava | 24.1.1-jre | 15.0 |
| httpclient | 4.5.12 | 4.3.6 |
| httpclient-cache | 4.5.12 | 4.3.6 |
| httpcore | 4.4.13 | 4.3.3 |
| jackson-annotations | 2.11.0 | 2.4.4 |
| jackson-jaxrs-base | 2.11.0 | 2.4.4 |
| jackson-jaxrs-json-provider | 2.11.0 | 2.4.4 |
| jackson-databind | 2.11.0 | 2.4.4 |
| json-unmarshaller | 1.1.2 | 1.1.1 |
| groovy-all | 2.4.15 | 2.4.2 |
| wiremock | 2.16.0 (wiremock-standalone) | 1.52 |
| commons-codec | 1.14 | 1.11 |