Class ClientBuilder
- All Implemented Interfaces:
Builder<ApiHttpClient>
The ClientBuilder is used to configure and create an ApiHttpClient
. As the ApiHttpClient uses a stack
of middlewares the Builder comes with methods to configure and attach new middlewares. Also it ensures that some default
used middlewares are instantiated at the correct location in the middleware stack.
The default middlewares and services are added as Supplier to be able to override the ones provided by e.g.: defaultClient(URI)
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionadd middleware to inject an Accept: gzip headeraddCorrelationIdProvider
(CorrelationIdProvider correlationIdProvider) addCorrelationIdProvider
(CorrelationIdProvider correlationIdProvider, boolean replace) addMiddleware
(Middleware middleware, Middleware... middlewares) adds the middlewares to be configured for the client.addMiddlewares
(List<Middleware> middlewares) adds the middlewares to be configured for the client.add Middleware to convert aNotFoundException
to a response with a null body valueaddNotFoundExceptionMiddleware
(NotFoundExceptionMiddleware exceptionMiddleware) add Middleware to convert aNotFoundException
to a response with a null body valueaddNotFoundExceptionMiddleware
(Predicate<ApiHttpRequest> requestPredicate) add Middleware to convert aNotFoundException
to a response with a null body valueaddNotFoundExceptionMiddleware
(Set<ApiHttpMethod> methods) add Middleware to convert aNotFoundException
to a response with a null body valuebuild()
build theApiHttpClient
with the configured valuesstatic String
default user agent providerdefaultClient
(ClientCredentials credentials, ServiceRegionConfig serviceRegionConfig) Configures a client with the default middlewares and the given baseUrldefaultClient
(String apiBaseUrl) Configures a client with the default middlewares and the given baseUrldefaultClient
(String apiBaseUrl, ClientCredentials credentials, String tokenEndpoint) Configures a client with the default middlewares and the given baseUrldefaultClient
(URI apiBaseUrl) Configures a client with the default middlewares and the given baseUrlstatic ClientBuilder
of()
Creates a default client builderstatic ClientBuilder
of
(ApiHttpClient httpClient) Creates a client builder with a specific or preconfiguredApiHttpClient
instance.static ClientBuilder
of
(HandlerStack stack) Creates a client builder with a specifigHandlerStack
static ClientBuilder
of
(VrapHttpClient httpClient) Creates a client builder with a specific or preconfiguredVrapHttpClient
instance.static ClientBuilder
of
(ExecutorService httpClientExecutorService) withAnonymousRefreshFlow
(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage) configure the client to use anonymous & refresh token flowwithAnonymousRefreshFlow
(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage, VrapHttpClient httpClient) configure the client to use anonymous & refresh token flowwithAnonymousRefreshFlow
(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use anonymous & refresh token flowwithAnonymousRefreshFlow
(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage, Supplier<HandlerStack> httpClientSupplier) configure the client to use anonymous & refresh token flowwithAnonymousSessionFlow
(ClientCredentials credentials, String tokenEndpoint) configure the client to use anonymous session flowwithAnonymousSessionFlow
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) configure the client to use anonymous session flowwithAnonymousSessionFlow
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use anonymous session flowwithAnonymousSessionFlow
(ClientCredentials credentials, String tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use anonymous session flowwithApiBaseUrl
(String apiBaseUrl) withApiBaseUrl
(URI apiBaseUrl) activates the circuit breaker for authentication.withAuthRetries
(int authRetries) withClientCredentials
(ClientCredentials credentials, String tokenEndpoint) Deprecated.withClientCredentials
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) Deprecated.withClientCredentialsFlow
(ClientCredentials credentials, String tokenEndpoint) configure the client to use client credentials flowwithClientCredentialsFlow
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) configure the client to use client credentials flowwithClientCredentialsFlow
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use client credentials flowwithClientCredentialsFlow
(ClientCredentials credentials, String tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use client credentials flowwithClientCredentialsFlow
(ClientCredentials credentials, URI tokenEndpoint) configure the client to use client credentials flowwithClientCredentialsFlow
(ClientCredentials credentials, URI tokenEndpoint, VrapHttpClient httpClient) configure the client to use client credentials flowwithClientCredentialsFlow
(ClientCredentials credentials, URI tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use client credentials flowadd middleware to create Exceptions for responses with error status codewithErrorMiddleware
(ErrorMiddleware errorMiddleware) add middleware to create Exceptions for responses with error status codewithErrorMiddleware
(ErrorMiddleware.ExceptionMode exceptionMode) add middleware to create Exceptions for responses with error status codewithErrorMiddleware
(Supplier<ErrorMiddleware> errorMiddleware) add middleware to create Exceptions for responses with error status codewithGlobalCustomerPasswordFlow
(ClientCredentials credentials, String email, String password, String tokenEndpoint) configure the client to use password flowwithGlobalCustomerPasswordFlow
(ClientCredentials credentials, String email, String password, String tokenEndpoint, VrapHttpClient httpClient) configure the client to use password flowwithGlobalCustomerPasswordFlow
(ClientCredentials credentials, String email, String password, String tokenEndpoint, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use password flowwithGlobalCustomerPasswordFlow
(ClientCredentials credentials, String email, String password, String tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use password flowwithHandlerStack
(HandlerStack stack) withHttpClient
(VrapHttpClient httpClient) configures the Factory for HTTP exception in case.withInternalLoggerFactory
(InternalLoggerFactory internalLoggerFactory) withInternalLoggerFactory
(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent) withInternalLoggerFactory
(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent, org.slf4j.event.Level defaultExceptionLogEvent, Map<Class<? extends Throwable>, org.slf4j.event.Level> exceptionLogEvents) withInternalLoggerFactory
(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent, org.slf4j.event.Level defaultExceptionLogEvent, Map<Class<? extends Throwable>, org.slf4j.event.Level> exceptionLogEvents, ResponseLogFormatter responseLogFormatter, ErrorLogFormatter errorLogFormatter) withInternalLoggerMiddleware
(InternalLoggerMiddleware internalLoggerMiddleware) withMiddleware
(Middleware middleware, Middleware... middlewares) sets the middlewares to be configured for the client.withMiddlewares
(List<Middleware> middlewares) sets the middlewares to be configured for the client.withOAuthExecutorService
(ExecutorService executorService) configures an ExecutorService to be used for the MiddlewareswithOAuthExecutorService
(Supplier<ExecutorService> executorService) configures an ExecutorService to be used for the MiddlewareswithOAuthHttpClient
(VrapHttpClient httpClient) withOAuthMiddleware
(OAuthMiddleware oAuthMiddleware) add authenticator middlewarewithOAuthMiddleware
(Supplier<OAuthMiddleware> oAuthMiddleware) add authenticator middlewaredeactivates the circuit breaker for authenticationwithPolicies
(PolicyBuilder policyBuilder) add middleware for safe handling of failed requestsadd middleware for safe handling of failed requestswithPolicyMiddleware
(PolicyMiddleware policyMiddleware) add middleware for safe handling of failed requestswithPolicyMiddleware
(Supplier<PolicyMiddleware> policyMiddleware) add middleware for safe handling of failed requestswithQueueMiddleware
(int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadwithQueueMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadwithQueueMiddleware
(QueueRequestMiddleware queueMiddleware) Deprecated.usewithPolicies(Function)
insteadwithQueueMiddleware
(ExecutorService executorService, int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadwithQueueMiddleware
(ScheduledExecutorService executorService, int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadwithQueueMiddleware
(Supplier<QueueRequestMiddleware> queueMiddleware) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(int maxRetries) Deprecated.usewithPolicies(Function)
} insteadwithRetryMiddleware
(int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
} insteadwithRetryMiddleware
(int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRetries) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(RetryRequestMiddleware retryMiddleware) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ExecutorService executorService, int maxRetries) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ExecutorService executorService, int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ExecutorService executorService, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ExecutorService executorService, int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ExecutorService executorService, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ScheduledExecutorService executorService, int maxRetries) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ScheduledExecutorService executorService, int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ScheduledExecutorService executorService, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ScheduledExecutorService executorService, int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(ScheduledExecutorService executorService, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadwithRetryMiddleware
(Supplier<RetryRequestMiddleware> retryMiddleware) Deprecated.usewithPolicies(Function)
insteadwithSerializer
(ResponseSerializer serializer) withSerializer
(Supplier<ResponseSerializer> serializer) configure the client to use client credentials flowwithTelemetryMiddleware
(TelemetryMiddleware telemetryMiddleware) add middleware to collect and report telemetry datawithTelemetryMiddleware
(Supplier<TelemetryMiddleware> telemetryMiddleware) add middleware to collect and report telemetry datawithTokenSupplier
(TokenSupplier tokenSupplier) use supplier for authentication tokenswithTokenSupplier
(Supplier<TokenSupplier> tokenSupplier) use supplier for authentication tokenswithUserAgentSupplier
(Supplier<String> userAgentSupplier)
-
Field Details
-
COMMERCETOOLS
- See Also:
-
-
Method Details
-
of
Creates a default client builder
- Returns:
- ClientBuilder instance
-
of
-
of
Creates a client builder with a specific or preconfigured
VrapHttpClient
instance. Uses defaults for theHandlerStack
- Parameters:
httpClient
- the HTTP client to be used- Returns:
- ClientBuilder instance
-
of
Creates a client builder with a specific or preconfigured
ApiHttpClient
instance. Uses defaults for theHandlerStack
- Parameters:
httpClient
- the HTTP client to be used- Returns:
- ClientBuilder instance
-
of
Creates a client builder with a specifig
HandlerStack
- Parameters:
stack
- the HandlerStack to be used- Returns:
- ClientBuilder instance
-
withoutAuthCircuitBreaker
deactivates the circuit breaker for authentication- Returns:
- ClientBuilder instance
-
withAuthCircuitBreaker
activates the circuit breaker for authentication. Upon erroneous authentication e.g. the authentication middleware will open the circuit breaker and retry regularly.- Returns:
- ClientBuilder instance
-
withAuthRetries
- Parameters:
authRetries
- number of retries for authentication before giving up.- Returns:
- ClientBuilder instance
-
withHandlerStack
- Parameters:
stack
-HandlerStack
to be used for the HTTP requests- Returns:
- ClientBuilder instance
-
withHttpClient
- Parameters:
httpClient
-VrapHttpClient
to be used for the HTTP requests- Returns:
- ClientBuilder instance
-
withOAuthHttpClient
- Parameters:
httpClient
-VrapHttpClient
to be used for the OAuth requests- Returns:
- ClientBuilder instance
-
withSerializer
- Parameters:
serializer
-ResponseSerializer
to be used for de-/serialization- Returns:
- ClientBuilder instance
-
withSerializer
- Parameters:
serializer
-ResponseSerializer
to be used for de-/serialization- Returns:
- ClientBuilder instance
-
withHttpExceptionFactory
- Parameters:
factory
-HttpExceptionFactory
to be used for creating Exceptions based on response status code- Returns:
- ClientBuilder instance
-
withHttpExceptionFactory
public ClientBuilder withHttpExceptionFactory(Function<ResponseSerializer, HttpExceptionFactory> factory) - Parameters:
factory
- function to createHttpExceptionFactory
to be used for creating Exceptions based on response status code with the configuredResponseSerializer
- Returns:
- ClientBuilder instance
-
withHttpExceptionFactory
configures the Factory for HTTP exception in case.- Parameters:
factory
-HttpExceptionFactory
to be used for creating Exceptions based on response status code- Returns:
- ClientBuilder instance
-
withOAuthExecutorService
configures an ExecutorService to be used for the Middlewares- Parameters:
executorService
- supplier of the executor service to be used- Returns:
- ClientBuilder instance
-
withOAuthExecutorService
configures an ExecutorService to be used for the Middlewares- Parameters:
executorService
- executor service to be used- Returns:
- ClientBuilder instance
-
defaultClient
Configures a client with the default middlewares and the given baseUrl
The following middlewares and services are configured:
- Parameters:
apiBaseUrl
- base URI for the API- Returns:
- ClientBuilder instance
-
defaultClient
Configures a client with the default middlewares and the given baseUrl
The following middlewares and services are configured:
- Parameters:
apiBaseUrl
- base URI for the API- Returns:
- ClientBuilder instance
-
defaultClient
public ClientBuilder defaultClient(String apiBaseUrl, ClientCredentials credentials, String tokenEndpoint) Configures a client with the default middlewares and the given baseUrl
The following middlewares and services are configured:
- Parameters:
apiBaseUrl
- base URI for the APIcredentials
-ClientCredentials
to be usedtokenEndpoint
- token endpoint URI to be used for authentication- Returns:
- ClientBuilder instance
-
defaultClient
public ClientBuilder defaultClient(ClientCredentials credentials, ServiceRegionConfig serviceRegionConfig) Configures a client with the default middlewares and the given baseUrl
The following middlewares and services are configured:
- Parameters:
credentials
-ClientCredentials
to be usedserviceRegionConfig
-ServiceRegionConfig
to be used- Returns:
- ClientBuilder instance
-
withClientCredentials
@Deprecated public ClientBuilder withClientCredentials(ClientCredentials credentials, String tokenEndpoint) Deprecated.- Parameters:
credentials
- OAuth credentialstokenEndpoint
- OAuth endpoint- Returns:
- client builder
-
withClientCredentials
@Deprecated public ClientBuilder withClientCredentials(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) Deprecated.- Parameters:
credentials
- OAuth credentialstokenEndpoint
- OAuth endpointhttpClient
- HTTP client to be used- Returns:
- client builder
-
withClientCredentialsFlow
configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authentication- Returns:
- ClientBuilder instance
-
withClientCredentialsFlow
public ClientBuilder withClientCredentialsFlow(ClientCredentials credentials, URI tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClientSupplier
-HandlerStack
to use for authentication- Returns:
- ClientBuilder instance
-
withClientCredentialsFlow
public ClientBuilder withClientCredentialsFlow(ClientCredentials credentials, URI tokenEndpoint, VrapHttpClient httpClient) configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClient
-VrapHttpClient
to use for authentication- Returns:
- ClientBuilder instance
-
withClientCredentialsFlow
configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authentication- Returns:
- ClientBuilder instance
-
withClientCredentialsFlow
public ClientBuilder withClientCredentialsFlow(ClientCredentials credentials, String tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClientSupplier
-VrapHttpClient
to use for authentication- Returns:
- ClientBuilder instance
-
withClientCredentialsFlow
public ClientBuilder withClientCredentialsFlow(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClient
-VrapHttpClient
to use for authentication- Returns:
- ClientBuilder instance
-
withClientCredentialsFlow
public ClientBuilder withClientCredentialsFlow(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use client credentials flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClient
-VrapHttpClient
to use for authenticationserializer
-ResponseSerializer
to be used for token deserialization- Returns:
- ClientBuilder instance
-
withStaticTokenFlow
configure the client to use client credentials flow- Parameters:
token
-AuthenticationToken
to be used requests- Returns:
- ClientBuilder instance
-
withAnonymousSessionFlow
configure the client to use anonymous session flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authentication- Returns:
- ClientBuilder instance
-
withAnonymousSessionFlow
public ClientBuilder withAnonymousSessionFlow(ClientCredentials credentials, String tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use anonymous session flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClientSupplier
-HandlerStack
to use for authentication- Returns:
- ClientBuilder instance
-
withAnonymousSessionFlow
public ClientBuilder withAnonymousSessionFlow(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) configure the client to use anonymous session flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClient
-VrapHttpClient
to use for authentication- Returns:
- ClientBuilder instance
-
withAnonymousSessionFlow
public ClientBuilder withAnonymousSessionFlow(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use anonymous session flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for authenticationhttpClient
-VrapHttpClient
to use for authenticationserializer
-ResponseSerializer
to be used for token deserialization- Returns:
- ClientBuilder instance
-
withAnonymousRefreshFlow
public ClientBuilder withAnonymousRefreshFlow(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage) configure the client to use anonymous & refresh token flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationanonTokenEndpoint
- URI to be used for anonymous token authenticationrefreshTokenEndpoint
- URI to be used for refresh token authenticationstorage
-TokenStorage
for the authentication tokens- Returns:
- ClientBuilder instance
-
withAnonymousRefreshFlow
public ClientBuilder withAnonymousRefreshFlow(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage, Supplier<HandlerStack> httpClientSupplier) configure the client to use anonymous & refresh token flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationanonTokenEndpoint
- URI to be used for anonymous token authenticationrefreshTokenEndpoint
- URI to be used for refresh token authenticationstorage
-TokenStorage
for the authentication tokenshttpClientSupplier
-HandlerStack
to be used for authentication- Returns:
- ClientBuilder instance
-
withAnonymousRefreshFlow
public ClientBuilder withAnonymousRefreshFlow(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage, VrapHttpClient httpClient) configure the client to use anonymous & refresh token flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationanonTokenEndpoint
- URI to be used for anonymous token authenticationrefreshTokenEndpoint
- URI to be used for refresh token authenticationstorage
-TokenStorage
for the authentication tokenshttpClient
-VrapHttpClient
to be used for authentication- Returns:
- ClientBuilder instance
-
withAnonymousRefreshFlow
public ClientBuilder withAnonymousRefreshFlow(ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, TokenStorage storage, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use anonymous & refresh token flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationanonTokenEndpoint
- URI to be used for anonymous token authenticationrefreshTokenEndpoint
- URI to be used for refresh token authenticationstorage
-TokenStorage
for the authentication tokenshttpClient
-VrapHttpClient
to be used for authenticationserializer
-ResponseSerializer
to be used for token deserialization- Returns:
- ClientBuilder instance
-
withGlobalCustomerPasswordFlow
public ClientBuilder withGlobalCustomerPasswordFlow(ClientCredentials credentials, String email, String password, String tokenEndpoint) configure the client to use password flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for password flow authenticationemail
- customer emailpassword
- customer password- Returns:
- ClientBuilder instance
-
withGlobalCustomerPasswordFlow
public ClientBuilder withGlobalCustomerPasswordFlow(ClientCredentials credentials, String email, String password, String tokenEndpoint, Supplier<HandlerStack> httpClientSupplier) configure the client to use password flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for password flow authenticationemail
- customer emailpassword
- customer passwordhttpClientSupplier
-HandlerStack
to use for authentication- Returns:
- ClientBuilder instance
-
withGlobalCustomerPasswordFlow
public ClientBuilder withGlobalCustomerPasswordFlow(ClientCredentials credentials, String email, String password, String tokenEndpoint, VrapHttpClient httpClient) configure the client to use password flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for password flow authenticationemail
- customer emailpassword
- customer passwordhttpClient
-VrapHttpClient
to use for authentication- Returns:
- ClientBuilder instance
-
withGlobalCustomerPasswordFlow
public ClientBuilder withGlobalCustomerPasswordFlow(ClientCredentials credentials, String email, String password, String tokenEndpoint, VrapHttpClient httpClient, ResponseSerializer serializer) configure the client to use password flow- Parameters:
credentials
-ClientCredentials
to be used for authenticationtokenEndpoint
- URI to be used for password flow authenticationemail
- customer emailpassword
- customer passwordhttpClient
-VrapHttpClient
to use for authenticationserializer
-ResponseSerializer
to be used for token deserialization- Returns:
- ClientBuilder instance
-
addAcceptGZipMiddleware
add middleware to inject an Accept: gzip header- Returns:
- ClientBuilder instance
-
withErrorMiddleware
add middleware to create Exceptions for responses with error status code- Parameters:
errorMiddleware
-ErrorMiddleware
to be used- Returns:
- ClientBuilder instance
-
withErrorMiddleware
add middleware to create Exceptions for responses with error status code- Returns:
- ClientBuilder instance
-
withErrorMiddleware
add middleware to create Exceptions for responses with error status code- Parameters:
errorMiddleware
-ErrorMiddleware
to be used- Returns:
- ClientBuilder instance
-
withErrorMiddleware
add middleware to create Exceptions for responses with error status code- Parameters:
exceptionMode
- either use CompletionExceptions or unwrap the Exception. SeeErrorMiddleware.ExceptionMode
- Returns:
- ClientBuilder instance
-
withTelemetryMiddleware
add middleware to collect and report telemetry data- Parameters:
telemetryMiddleware
-TelemetryMiddleware
to be used- Returns:
- ClientBuilder instance
-
withTelemetryMiddleware
add middleware to collect and report telemetry data- Parameters:
telemetryMiddleware
-TelemetryMiddleware
to be used- Returns:
- ClientBuilder instance
-
addNotFoundExceptionMiddleware
add Middleware to convert aNotFoundException
to a response with a null body value- Returns:
- ClientBuilder instance
-
addNotFoundExceptionMiddleware
add Middleware to convert aNotFoundException
to a response with a null body value- Parameters:
methods
- HTTP methods to convert onNotFoundException
- Returns:
- ClientBuilder instance
-
addNotFoundExceptionMiddleware
add Middleware to convert aNotFoundException
to a response with a null body value- Parameters:
requestPredicate
- predicate to match for convertingNotFoundException
- Returns:
- ClientBuilder instance
-
addNotFoundExceptionMiddleware
public ClientBuilder addNotFoundExceptionMiddleware(NotFoundExceptionMiddleware exceptionMiddleware) add Middleware to convert aNotFoundException
to a response with a null body value- Parameters:
exceptionMiddleware
- middleware to be used- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(Supplier<RetryRequestMiddleware> retryMiddleware) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests- Parameters:
retryMiddleware
-RetryRequestMiddleware
to be used- Returns:
- ClientBuilder instance
-
withRetryMiddleware
Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests- Parameters:
retryMiddleware
-RetryRequestMiddleware
to be used- Returns:
- ClientBuilder instance
-
withRetryMiddleware
Deprecated.usewithPolicies(Function)
} insteadadd middleware to retry failed requests. By default, status code 500 & 503 will be retried. Between each retry an incremental backoff strategy is applied- Parameters:
maxRetries
- number of retries before giving uo- Returns:
- ClientBuilder instance
-
withRetryMiddleware
Deprecated.usewithPolicies(Function)
} insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
maxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
maxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retried- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
maxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retrystatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retriedfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
maxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retryfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uo- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retried- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retrystatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retriedfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retryfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ScheduledExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uo- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ScheduledExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ScheduledExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retried- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ScheduledExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retrystatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retriedfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
executorService
-ScheduledExecutorService
to be used for the retry handlermaxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retryfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
scheduler
-Scheduler
to be used for the retry handlermaxRetries
- number of retries before giving uo- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, List<Integer> statusCodes) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
scheduler
-Scheduler
to be used for the retry handlermaxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
scheduler
-Scheduler
to be used for the retry handlermaxRetries
- number of retries before giving uostatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retried- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
scheduler
-Scheduler
to be used for the retry handlermaxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retrystatusCodes
- HTTP status codes to retry a failed request e.g. 500 & 503failures
-Throwable
s to be retriedfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withRetryMiddleware
@Deprecated public ClientBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) Deprecated.usewithPolicies(Function)
insteadadd middleware to retry failed requests. Between each retry an incremental backoff strategy is applied- Parameters:
scheduler
-Scheduler
to be used for the retry handlermaxRetries
- number of retries before giving uodelay
- the initial delay for a retrymaxDelay
- the maximum delay between each retryfn
- additional configuration for theRetryPolicy
to be applied- Returns:
- ClientBuilder instance
-
withQueueMiddleware
@Deprecated public ClientBuilder withQueueMiddleware(Supplier<QueueRequestMiddleware> queueMiddleware) Deprecated.usewithPolicies(Function)
insteadadd middleware to limit the concurrent requests to be executed- Parameters:
queueMiddleware
-QueueRequestMiddleware
to be used- Returns:
- ClientBuilder instance
-
withQueueMiddleware
Deprecated.usewithPolicies(Function)
insteadadd middleware to limit the concurrent requests to be executed- Parameters:
queueMiddleware
-QueueRequestMiddleware
to be used- Returns:
- ClientBuilder instance
-
withQueueMiddleware
Deprecated.usewithPolicies(Function)
insteadadd middleware to limit the concurrent requests to be executed- Parameters:
maxRequests
- maximum number of concurrent requestsmaxWaitTime
- maximum time to wait before giving up- Returns:
- ClientBuilder instance
-
withQueueMiddleware
@Deprecated public ClientBuilder withQueueMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadadd middleware to limit the concurrent requests to be executed- Parameters:
scheduler
-Scheduler
to be used for handling the queuemaxRequests
- maximum number of concurrent requestsmaxWaitTime
- maximum time to wait before giving up- Returns:
- ClientBuilder instance
-
withQueueMiddleware
@Deprecated public ClientBuilder withQueueMiddleware(ScheduledExecutorService executorService, int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadadd middleware to limit the concurrent requests to be executed- Parameters:
executorService
-ScheduledExecutorService
to be used for handling the queuemaxRequests
- maximum number of concurrent requestsmaxWaitTime
- maximum time to wait before giving up- Returns:
- ClientBuilder instance
-
withQueueMiddleware
@Deprecated public ClientBuilder withQueueMiddleware(ExecutorService executorService, int maxRequests, Duration maxWaitTime) Deprecated.usewithPolicies(Function)
insteadadd middleware to limit the concurrent requests to be executed- Parameters:
executorService
-ExecutorService
to be used for handling the queuemaxRequests
- maximum number of concurrent requestsmaxWaitTime
- maximum time to wait before giving up- Returns:
- ClientBuilder instance
-
withPolicies
add middleware for safe handling of failed requests- Parameters:
policyBuilder
- the policy builder- Returns:
- ClientBuilder instance
-
withPolicies
add middleware for safe handling of failed requests- Parameters:
fn
- the policy builder function- Returns:
- ClientBuilder instance
-
withPolicyMiddleware
add middleware for safe handling of failed requests- Parameters:
policyMiddleware
-PolicyMiddleware
to be used- Returns:
- ClientBuilder
-
withPolicyMiddleware
add middleware for safe handling of failed requests- Parameters:
policyMiddleware
-PolicyMiddleware
to be used- Returns:
- ClientBuilder
-
withOAuthMiddleware
add authenticator middleware- Parameters:
oAuthMiddleware
-OAuthMiddleware
to be used for authentication- Returns:
- ClientBuilder instance
-
withOAuthMiddleware
add authenticator middleware- Parameters:
oAuthMiddleware
-OAuthMiddleware
to be used for authentication- Returns:
- ClientBuilder instance
-
withTokenSupplier
use supplier for authentication tokens- Parameters:
tokenSupplier
-TokenSupplier
for retrieving authentication tokens- Returns:
- ClientBuilder instance
-
withTokenSupplier
use supplier for authentication tokens- Parameters:
tokenSupplier
-TokenSupplier
for retrieving authentication tokens- Returns:
- ClientBuilder instance
-
withInternalLoggerMiddleware
public ClientBuilder withInternalLoggerMiddleware(InternalLoggerMiddleware internalLoggerMiddleware) - Parameters:
internalLoggerMiddleware
-InternalLoggerMiddleware
used for logging requests and responses- Returns:
- ClientBuilder instance
-
withInternalLoggerFactory
- Parameters:
internalLoggerFactory
-InternalLoggerFactory
creates the logger for request & responses- Returns:
- ClientBuilder instance
-
withInternalLoggerFactory
public ClientBuilder withInternalLoggerFactory(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent) - Parameters:
internalLoggerFactory
-InternalLoggerFactory
creates the logger for request & responsesresponseLogEvent
-Level
for logging responses.deprecationLogEvent
-Level
for loggingApiHttpHeaders.X_DEPRECATION_NOTICE
- Returns:
- ClientBuilder instance
-
withInternalLoggerFactory
public ClientBuilder withInternalLoggerFactory(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent, org.slf4j.event.Level defaultExceptionLogEvent, Map<Class<? extends Throwable>, org.slf4j.event.Level> exceptionLogEvents) - Parameters:
internalLoggerFactory
-InternalLoggerFactory
creates the logger for request & responsesresponseLogEvent
-Level
for logging responses.deprecationLogEvent
-Level
for loggingApiHttpHeaders.X_DEPRECATION_NOTICE
defaultExceptionLogEvent
-Level
for logging errorsexceptionLogEvents
-Level
for logging by exception class- Returns:
- ClientBuilder instance
-
withInternalLoggerFactory
public ClientBuilder withInternalLoggerFactory(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent, org.slf4j.event.Level defaultExceptionLogEvent, Map<Class<? extends Throwable>, org.slf4j.event.Level> exceptionLogEvents, ResponseLogFormatter responseLogFormatter, ErrorLogFormatter errorLogFormatter) - Parameters:
internalLoggerFactory
-InternalLoggerFactory
creates the logger for request & responsesresponseLogEvent
-Level
for logging responses.deprecationLogEvent
-Level
for loggingApiHttpHeaders.X_DEPRECATION_NOTICE
defaultExceptionLogEvent
-Level
for logging errorsexceptionLogEvents
-Level
for logging by exception classresponseLogFormatter
-ResponseLogFormatter
response log formatter- Returns:
- ClientBuilder instance
-
withApiBaseUrl
- Parameters:
apiBaseUrl
- base URI for calling the API- Returns:
- ClientBuilder instance
-
withApiBaseUrl
- Parameters:
apiBaseUrl
- base URI for calling the API- Returns:
- ClientBuilder instance
-
withUserAgentSupplier
- Parameters:
userAgentSupplier
- user agent to be sent with the requests- Returns:
- ClientBuilder instance
-
addCorrelationIdProvider
public ClientBuilder addCorrelationIdProvider(@Nullable CorrelationIdProvider correlationIdProvider, boolean replace) - Parameters:
correlationIdProvider
- provider to create correlation IDs for each requestreplace
- replace any existing correlation id provider- Returns:
- ClientBuilder instance
-
addCorrelationIdProvider
public ClientBuilder addCorrelationIdProvider(@Nullable CorrelationIdProvider correlationIdProvider) - Parameters:
correlationIdProvider
- provider to create correlation IDs for each request- Returns:
- ClientBuilder instance
-
withMiddlewares
sets the middlewares to be configured for the client.- Parameters:
middlewares
-Middleware
instances- Returns:
- ClientBuilder instance
-
withMiddleware
sets the middlewares to be configured for the client.- Parameters:
middleware
-Middleware
instancemiddlewares
-Middleware
instances- Returns:
- ClientBuilder instance
-
addMiddlewares
adds the middlewares to be configured for the client.- Parameters:
middlewares
-Middleware
instances- Returns:
- ClientBuilder instance
-
addMiddleware
adds the middlewares to be configured for the client.- Parameters:
middleware
-Middleware
instancemiddlewares
-Middleware
instances- Returns:
- ClientBuilder instance
-
build
build theApiHttpClient
with the configured values- Specified by:
build
in interfaceBuilder<ApiHttpClient>
- Returns:
ApiHttpClient
-
buildDefaultUserAgent
default user agent provider- Returns:
- user agent string
-
withClientCredentialsFlow(ClientCredentials, String)
instead