Class NovaApiJavaSpikeOkHttpClient.Builder
-
- All Implemented Interfaces:
public final class NovaApiJavaSpikeOkHttpClient.BuilderA builder for NovaApiJavaSpikeOkHttpClient.
-
-
Method Summary
-
-
Method Detail
-
dispatcherExecutorService
final NovaApiJavaSpikeOkHttpClient.Builder dispatcherExecutorService(ExecutorService dispatcherExecutorService)
The executor service to use for running HTTP requests.
Defaults to OkHttp's default executor service.
This class takes ownership of the executor service and shuts it down when closed.
-
dispatcherExecutorService
final NovaApiJavaSpikeOkHttpClient.Builder dispatcherExecutorService(Optional<ExecutorService> dispatcherExecutorService)
Alias for calling Builder.dispatcherExecutorService with
dispatcherExecutorService.orElse(null).
-
proxy
final NovaApiJavaSpikeOkHttpClient.Builder proxy(Proxy proxy)
-
proxy
final NovaApiJavaSpikeOkHttpClient.Builder proxy(Optional<Proxy> proxy)
Alias for calling Builder.proxy with
proxy.orElse(null).
-
maxIdleConnections
final NovaApiJavaSpikeOkHttpClient.Builder maxIdleConnections(Integer maxIdleConnections)
The maximum number of idle connections kept by the underlying OkHttp connection pool.
If this is set, then keepAliveDuration must also be set.
If unset, then OkHttp's default is used.
-
maxIdleConnections
final NovaApiJavaSpikeOkHttpClient.Builder maxIdleConnections(Integer maxIdleConnections)
Alias for Builder.maxIdleConnections.
This unboxed primitive overload exists for backwards compatibility.
-
maxIdleConnections
final NovaApiJavaSpikeOkHttpClient.Builder maxIdleConnections(Optional<Integer> maxIdleConnections)
Alias for calling Builder.maxIdleConnections with
maxIdleConnections.orElse(null).
-
keepAliveDuration
final NovaApiJavaSpikeOkHttpClient.Builder keepAliveDuration(Duration keepAliveDuration)
The keep-alive duration for idle connections in the underlying OkHttp connection pool.
If this is set, then maxIdleConnections must also be set.
If unset, then OkHttp's default is used.
-
keepAliveDuration
final NovaApiJavaSpikeOkHttpClient.Builder keepAliveDuration(Optional<Duration> keepAliveDuration)
Alias for calling Builder.keepAliveDuration with
keepAliveDuration.orElse(null).
-
sslSocketFactory
final NovaApiJavaSpikeOkHttpClient.Builder sslSocketFactory(SSLSocketFactory sslSocketFactory)
The socket factory used to secure HTTPS connections.
If this is set, then trustManager must also be set.
If unset, then the system default is used. Most applications should not call this method, and instead use the system default. The default include special optimizations that can be lost if the implementation is modified.
-
sslSocketFactory
final NovaApiJavaSpikeOkHttpClient.Builder sslSocketFactory(Optional<SSLSocketFactory> sslSocketFactory)
Alias for calling Builder.sslSocketFactory with
sslSocketFactory.orElse(null).
-
trustManager
final NovaApiJavaSpikeOkHttpClient.Builder trustManager(X509TrustManager trustManager)
The trust manager used to secure HTTPS connections.
If this is set, then sslSocketFactory must also be set.
If unset, then the system default is used. Most applications should not call this method, and instead use the system default. The default include special optimizations that can be lost if the implementation is modified.
-
trustManager
final NovaApiJavaSpikeOkHttpClient.Builder trustManager(Optional<X509TrustManager> trustManager)
Alias for calling Builder.trustManager with
trustManager.orElse(null).
-
hostnameVerifier
final NovaApiJavaSpikeOkHttpClient.Builder hostnameVerifier(HostnameVerifier hostnameVerifier)
The verifier used to confirm that response certificates apply to requested hostnames for HTTPS connections.
If unset, then a default hostname verifier is used.
-
hostnameVerifier
final NovaApiJavaSpikeOkHttpClient.Builder hostnameVerifier(Optional<HostnameVerifier> hostnameVerifier)
Alias for calling Builder.hostnameVerifier with
hostnameVerifier.orElse(null).
-
checkJacksonVersionCompatibility
final NovaApiJavaSpikeOkHttpClient.Builder checkJacksonVersionCompatibility(Boolean checkJacksonVersionCompatibility)
Whether to throw an exception if any of the Jackson versions detected at runtime are incompatible with the SDK's minimum supported Jackson version (2.13.4).
Defaults to true. Use extreme caution when disabling this option. There is no guarantee that the SDK will work correctly when using an incompatible Jackson version.
-
jsonMapper
final NovaApiJavaSpikeOkHttpClient.Builder jsonMapper(JsonMapper jsonMapper)
The Jackson JSON mapper to use for serializing and deserializing JSON.
Defaults to io.github.ctotheameron.core.jsonMapper. The default is usually sufficient and rarely needs to be overridden.
-
sleeper
final NovaApiJavaSpikeOkHttpClient.Builder sleeper(Sleeper sleeper)
The interface to use for delaying execution, like during retries.
This is primarily useful for using fake delays in tests.
Defaults to real execution delays.
This class takes ownership of the sleeper and closes it when closed.
-
clock
final NovaApiJavaSpikeOkHttpClient.Builder clock(Clock clock)
The clock to use for operations that require timing, like retries.
This is primarily useful for using a fake clock in tests.
Defaults to Clock.systemUTC.
-
baseUrl
final NovaApiJavaSpikeOkHttpClient.Builder baseUrl(String baseUrl)
The base URL to use for every request.
Defaults to the production environment:
https://portal.angellist.com/api/v1.The following other environments, with dedicated builder methods, are available:
sandbox:
https://portal.angellist-staging.com/api/v1
-
baseUrl
final NovaApiJavaSpikeOkHttpClient.Builder baseUrl(Optional<String> baseUrl)
Alias for calling Builder.baseUrl with
baseUrl.orElse(null).
-
sandbox
final NovaApiJavaSpikeOkHttpClient.Builder sandbox()
Sets baseUrl to
https://portal.angellist-staging.com/api/v1.
-
responseValidation
final NovaApiJavaSpikeOkHttpClient.Builder responseValidation(Boolean responseValidation)
Whether to call
validateon every response before returning it.Defaults to false, which means the shape of the response will not be validated upfront. Instead, validation will only occur for the parts of the response that are accessed.
-
timeout
final NovaApiJavaSpikeOkHttpClient.Builder timeout(Timeout timeout)
Sets the maximum time allowed for various parts of an HTTP call's lifecycle, excluding retries.
Defaults to Timeout.default.
-
timeout
final NovaApiJavaSpikeOkHttpClient.Builder timeout(Duration timeout)
Sets the maximum time allowed for a complete HTTP call, not including retries.
See Timeout.request for more details.
For fine-grained control, pass a Timeout object.
-
maxRetries
final NovaApiJavaSpikeOkHttpClient.Builder maxRetries(Integer maxRetries)
The maximum number of times to retry failed requests, with a short exponential backoff between requests.
Only the following error types are retried:
Connection errors (for example, due to a network connectivity problem)
408 Request Timeout
409 Conflict
429 Rate Limit
5xx Internal
The API may also explicitly instruct the SDK to retry or not retry a request.
Defaults to 2.
-
clientId
final NovaApiJavaSpikeOkHttpClient.Builder clientId(String clientId)
-
clientId
final NovaApiJavaSpikeOkHttpClient.Builder clientId(Optional<String> clientId)
Alias for calling Builder.clientId with
clientId.orElse(null).
-
clientSecret
final NovaApiJavaSpikeOkHttpClient.Builder clientSecret(String clientSecret)
-
clientSecret
final NovaApiJavaSpikeOkHttpClient.Builder clientSecret(Optional<String> clientSecret)
Alias for calling Builder.clientSecret with
clientSecret.orElse(null).
-
organizationId
final NovaApiJavaSpikeOkHttpClient.Builder organizationId(String organizationId)
-
organizationId
final NovaApiJavaSpikeOkHttpClient.Builder organizationId(Optional<String> organizationId)
Alias for calling Builder.organizationId with
organizationId.orElse(null).
-
headers
final NovaApiJavaSpikeOkHttpClient.Builder headers(Headers headers)
-
putHeader
final NovaApiJavaSpikeOkHttpClient.Builder putHeader(String name, String value)
-
putHeaders
final NovaApiJavaSpikeOkHttpClient.Builder putHeaders(String name, Iterable<String> values)
-
putAllHeaders
final NovaApiJavaSpikeOkHttpClient.Builder putAllHeaders(Headers headers)
-
putAllHeaders
final NovaApiJavaSpikeOkHttpClient.Builder putAllHeaders(Map<String, Iterable<String>> headers)
-
replaceHeaders
final NovaApiJavaSpikeOkHttpClient.Builder replaceHeaders(String name, String value)
-
replaceHeaders
final NovaApiJavaSpikeOkHttpClient.Builder replaceHeaders(String name, Iterable<String> values)
-
replaceAllHeaders
final NovaApiJavaSpikeOkHttpClient.Builder replaceAllHeaders(Headers headers)
-
replaceAllHeaders
final NovaApiJavaSpikeOkHttpClient.Builder replaceAllHeaders(Map<String, Iterable<String>> headers)
-
removeHeaders
final NovaApiJavaSpikeOkHttpClient.Builder removeHeaders(String name)
-
removeAllHeaders
final NovaApiJavaSpikeOkHttpClient.Builder removeAllHeaders(Set<String> names)
-
queryParams
final NovaApiJavaSpikeOkHttpClient.Builder queryParams(QueryParams queryParams)
-
queryParams
final NovaApiJavaSpikeOkHttpClient.Builder queryParams(Map<String, Iterable<String>> queryParams)
-
putQueryParam
final NovaApiJavaSpikeOkHttpClient.Builder putQueryParam(String key, String value)
-
putQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder putQueryParams(String key, Iterable<String> values)
-
putAllQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder putAllQueryParams(QueryParams queryParams)
-
putAllQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder putAllQueryParams(Map<String, Iterable<String>> queryParams)
-
replaceQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder replaceQueryParams(String key, String value)
-
replaceQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder replaceQueryParams(String key, Iterable<String> values)
-
replaceAllQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder replaceAllQueryParams(QueryParams queryParams)
-
replaceAllQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder replaceAllQueryParams(Map<String, Iterable<String>> queryParams)
-
removeQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder removeQueryParams(String key)
-
removeAllQueryParams
final NovaApiJavaSpikeOkHttpClient.Builder removeAllQueryParams(Set<String> keys)
-
fromEnv
final NovaApiJavaSpikeOkHttpClient.Builder fromEnv()
Updates configuration using system properties and environment variables.
-
-
-
-