Class MLApiRootBuilder
java.lang.Object
com.commercetools.ml.defaultconfig.MLApiRootBuilder
-
Method Summary
Modifier and TypeMethodDescriptionaddCorrelationIdProvider
(CorrelationIdProvider correlationIdProvider) addMiddleware
(Middleware middleware, Middleware... middlewares) addMiddlewares
(List<Middleware> middlewares) build()
buildForProject
(String projectKey) Deprecated.buildProjectRoot
(String projectKey) Deprecated.usebuild(String)
insteaddefaultClient
(ClientCredentials credentials) defaultClient
(ClientCredentials credentials, ServiceRegionConfig serviceRegion) defaultClient
(ClientCredentials credentials, String tokenEndpoint, String apiEndpoint) defaultClient
(String apiEndpoint) defaultClient
(String apiEndpoint, ClientCredentials credentials, String tokenEndpoint) defaultClient
(URI apiEndpoint) static MLApiRootBuilder
of()
static MLApiRootBuilder
of
(HandlerStack stack) static MLApiRootBuilder
of
(VrapHttpClient httpClient) with
(UnaryOperator<ClientBuilder> builderUnaryOperator) withAnonymousSessionFlow
(ClientCredentials credentials, String tokenEndpoint) withAnonymousSessionFlow
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) withApiBaseUrl
(String apiBaseUrl) withApiBaseUrl
(URI apiBaseUrl) withAuthRetries
(int authRetries) withClientCredentialsFlow
(ClientCredentials credentials, String tokenEndpoint) withClientCredentialsFlow
(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) withClientCredentialsFlow
(ClientCredentials credentials, URI tokenEndpoint) withClientCredentialsFlow
(ClientCredentials credentials, URI tokenEndpoint, VrapHttpClient httpClient) withErrorMiddleware
(ErrorMiddleware errorMiddleware) withGlobalCustomerPasswordFlow
(ClientCredentials credentials, String email, String password, String tokenEndpoint) withGlobalCustomerPasswordFlow
(ClientCredentials credentials, String email, String password, String tokenEndpoint, VrapHttpClient httpClient) withHandlerStack
(HandlerStack stack) withHttpClient
(VrapHttpClient httpClient) 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) withInternalLoggerMiddleware
(InternalLoggerMiddleware internalLoggerMiddleware) withMiddleware
(Middleware middleware, Middleware... middlewares) withMiddlewares
(List<Middleware> middlewares) withOAuthMiddleware
(OAuthMiddleware oAuthMiddleware) withOAuthMiddleware
(Supplier<OAuthMiddleware> oAuthMiddleware) withQueueMiddleware
(int maxRequests, Duration maxWaitTime) withQueueMiddleware
(dev.failsafe.spi.Scheduler scheduler, int maxRequests, Duration maxWaitTime) withQueueMiddleware
(QueueRequestMiddleware queueMiddleware) withQueueMiddleware
(ExecutorService executorService, int maxRequests, Duration maxWaitTime) withQueueMiddleware
(ScheduledExecutorService executorService, int maxRequests, Duration maxWaitTime) withQueueMiddleware
(Supplier<QueueRequestMiddleware> queueMiddleware) withRetryMiddleware
(int maxRetries) withRetryMiddleware
(int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) withRetryMiddleware
(int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) withRetryMiddleware
(int maxRetries, List<Integer> statusCodes) withRetryMiddleware
(int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures) withRetryMiddleware
(RetryRequestMiddleware retryMiddleware) withRetryMiddleware
(Supplier<RetryRequestMiddleware> retryMiddleware) withSerializer
(ResponseSerializer serializer) withSerializer
(Supplier<ResponseSerializer> serializer) withTokenSupplier
(TokenSupplier tokenSupplier) withTokenSupplier
(Supplier<TokenSupplier> tokenSupplier) withUserAgentSupplier
(Supplier<String> userAgentSupplier)
-
Method Details
-
of
-
of
-
of
-
withAuthCircuitBreaker
-
withoutAuthCircuitBreaker
-
withAuthRetries
-
withHandlerStack
-
withHttpClient
-
withSerializer
-
withSerializer
-
withHttpExceptionFactory
-
withHttpExceptionFactory
public MLApiRootBuilder withHttpExceptionFactory(Function<ResponseSerializer, HttpExceptionFactory> factory) -
withHttpExceptionFactory
-
defaultClient
-
defaultClient
public MLApiRootBuilder defaultClient(ClientCredentials credentials, ServiceRegionConfig serviceRegion) -
defaultClient
public MLApiRootBuilder defaultClient(ClientCredentials credentials, String tokenEndpoint, String apiEndpoint) -
defaultClient
public MLApiRootBuilder defaultClient(String apiEndpoint, ClientCredentials credentials, String tokenEndpoint) -
defaultClient
-
defaultClient
-
withClientCredentialsFlow
public MLApiRootBuilder withClientCredentialsFlow(ClientCredentials credentials, String tokenEndpoint) -
withClientCredentialsFlow
public MLApiRootBuilder withClientCredentialsFlow(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) -
withClientCredentialsFlow
-
withClientCredentialsFlow
public MLApiRootBuilder withClientCredentialsFlow(ClientCredentials credentials, URI tokenEndpoint, VrapHttpClient httpClient) -
withStaticTokenFlow
-
withAnonymousSessionFlow
public MLApiRootBuilder withAnonymousSessionFlow(ClientCredentials credentials, String tokenEndpoint) -
withAnonymousSessionFlow
public MLApiRootBuilder withAnonymousSessionFlow(ClientCredentials credentials, String tokenEndpoint, VrapHttpClient httpClient) -
withGlobalCustomerPasswordFlow
public MLApiRootBuilder withGlobalCustomerPasswordFlow(ClientCredentials credentials, String email, String password, String tokenEndpoint) -
withGlobalCustomerPasswordFlow
public MLApiRootBuilder withGlobalCustomerPasswordFlow(ClientCredentials credentials, String email, String password, String tokenEndpoint, VrapHttpClient httpClient) -
addAcceptGZipMiddleware
-
withErrorMiddleware
-
withErrorMiddleware
-
withRetryMiddleware
-
withRetryMiddleware
-
withRetryMiddleware
-
withRetryMiddleware
-
withRetryMiddleware
-
withRetryMiddleware
public MLApiRootBuilder withRetryMiddleware(int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, FailsafeRetryPolicyBuilderOptions fn) -
withRetryMiddleware
public MLApiRootBuilder withRetryMiddleware(int maxRetries, long delay, long maxDelay, FailsafeRetryPolicyBuilderOptions fn) -
withQueueMiddleware
-
withQueueMiddleware
-
withQueueMiddleware
-
withQueueMiddleware
public MLApiRootBuilder withQueueMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRequests, Duration maxWaitTime) -
withQueueMiddleware
public MLApiRootBuilder withQueueMiddleware(ScheduledExecutorService executorService, int maxRequests, Duration maxWaitTime) -
withQueueMiddleware
public MLApiRootBuilder withQueueMiddleware(ExecutorService executorService, int maxRequests, Duration maxWaitTime) -
withOAuthMiddleware
-
withOAuthMiddleware
-
withTokenSupplier
-
withTokenSupplier
-
withInternalLoggerMiddleware
public MLApiRootBuilder withInternalLoggerMiddleware(InternalLoggerMiddleware internalLoggerMiddleware) -
withInternalLoggerFactory
-
withInternalLoggerFactory
public MLApiRootBuilder withInternalLoggerFactory(InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent) -
withInternalLoggerFactory
public MLApiRootBuilder 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) -
withApiBaseUrl
-
withApiBaseUrl
-
withUserAgentSupplier
-
addCorrelationIdProvider
public MLApiRootBuilder addCorrelationIdProvider(@Nullable CorrelationIdProvider correlationIdProvider) -
withMiddleware
-
addMiddleware
-
withMiddlewares
-
addMiddlewares
-
with
-
build
-
buildClient
-
clientSupplier
-
buildForProject
Deprecated.usebuild(String)
instead -
buildProjectRoot
Deprecated.usebuild(String)
instead -
build
-
build(String)
instead