Package com.datastax.astra.internal.http
Class RetryHttpClient
java.lang.Object
com.datastax.astra.internal.http.RetryHttpClient
Http Client using JDK11 client with a retry mechanism.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Headers, Api is usig JSONstatic final String
Header param.static final String
Headers param to insert the token for devops API.static final String
Headers param to insert the conte type.static final String
Headers param to insert the user agent identifying the client.static final String
Headers param to insert the token.static final String
Headers name to insert the user agent identifying the client.protected final HttpClient
JDK11 Http client.protected final HttpClientOptions
Http Options.protected final com.evanlennick.retry4j.config.RetryConfig
Default retry configuration.protected final TimeoutOptions
Http Options. -
Constructor Summary
ConstructorDescriptionRetryHttpClient
(HttpClientOptions httpClientOptions, TimeoutOptions timeoutOptions) Initialize the instance with all items -
Method Summary
Modifier and TypeMethodDescriptioncom.evanlennick.retry4j.Status
<HttpResponse<String>> Implementing retries.Give access to the user agent header.parseHttpResponse
(HttpResponse<String> response) Parse HTTP response as a ApiResponseHttp.
-
Field Details
-
CONTENT_TYPE_JSON
Headers, Api is usig JSON- See Also:
-
HEADER_ACCEPT
Header param.- See Also:
-
HEADER_TOKEN
Headers param to insert the token.- See Also:
-
HEADER_CONTENT_TYPE
Headers param to insert the conte type.- See Also:
-
HEADER_AUTHORIZATION
Headers param to insert the token for devops API.- See Also:
-
HEADER_USER_AGENT
Headers name to insert the user agent identifying the client.- See Also:
-
HEADER_REQUESTED_WITH
Headers param to insert the user agent identifying the client.- See Also:
-
httpClient
JDK11 Http client. -
httpClientOptions
Http Options. -
timeoutOptions
Http Options. -
retryConfig
protected final com.evanlennick.retry4j.config.RetryConfig retryConfigDefault retry configuration.
-
-
Constructor Details
-
RetryHttpClient
Initialize the instance with all items- Parameters:
httpClientOptions
- http client optionstimeoutOptions
- timeout options
-
-
Method Details
-
getUserAgentHeader
Give access to the user agent header.- Returns:
- user agent header
-
parseHttpResponse
Parse HTTP response as a ApiResponseHttp.- Parameters:
response
- http response from the JDK11 client- Returns:
- the response as an ApiResponseHttp
-
executeHttpRequest
Implementing retries.- Parameters:
req
- current request- Returns:
- the closeable response
-