Class ApiRootBuilder

java.lang.Object
com.commercetools.api.defaultconfig.ApiRootBuilder

public class ApiRootBuilder extends Object
Builder to create a ApiRoot or a project scoped ProjectApiRoot
  • Method Details

    • of

      public static ApiRootBuilder of()
    • of

      public static ApiRootBuilder of(ExecutorService httpClientExecutorService)
    • of

      public static ApiRootBuilder of(io.vrap.rmf.base.client.ApiHttpClient httpClient)
    • of

      public static ApiRootBuilder of(io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • ofEnvironmentVariables

      public static ApiRootBuilder ofEnvironmentVariables()
    • ofEnvironmentVariables

      public static ApiRootBuilder ofEnvironmentVariables(String prefix)
    • ofProperties

      public static ApiRootBuilder ofProperties(Properties properties)
    • ofProperties

      public static ApiRootBuilder ofProperties(Properties properties, String prefix)
    • of

      public static ApiRootBuilder of(io.vrap.rmf.base.client.http.HandlerStack stack)
    • withProjectKey

      public ApiRootBuilder withProjectKey(String projectKey)
    • withAuthCircuitBreaker

      public ApiRootBuilder withAuthCircuitBreaker()
    • withoutAuthCircuitBreaker

      public ApiRootBuilder withoutAuthCircuitBreaker()
    • withAuthRetries

      public ApiRootBuilder withAuthRetries(int authRetries)
    • withHandlerStack

      public ApiRootBuilder withHandlerStack(io.vrap.rmf.base.client.http.HandlerStack stack)
    • withHttpClient

      public ApiRootBuilder withHttpClient(io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • withSerializer

      public ApiRootBuilder withSerializer(io.vrap.rmf.base.client.ResponseSerializer serializer)
    • withSerializer

      public ApiRootBuilder withSerializer(Supplier<io.vrap.rmf.base.client.ResponseSerializer> serializer)
    • withHttpExceptionFactory

      public ApiRootBuilder withHttpExceptionFactory(io.vrap.rmf.base.client.error.HttpExceptionFactory factory)
    • withHttpExceptionFactory

      public ApiRootBuilder withHttpExceptionFactory(Function<io.vrap.rmf.base.client.ResponseSerializer,io.vrap.rmf.base.client.error.HttpExceptionFactory> factory)
    • withHttpExceptionFactory

      public ApiRootBuilder withHttpExceptionFactory(Supplier<io.vrap.rmf.base.client.error.HttpExceptionFactory> factory)
    • defaultClient

      public ApiRootBuilder defaultClient(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials)
    • defaultClient

      public ApiRootBuilder defaultClient(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, io.vrap.rmf.base.client.ServiceRegionConfig serviceRegion)
    • defaultClient

      public ApiRootBuilder defaultClient(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint, String apiEndpoint)
    • defaultClient

      public ApiRootBuilder defaultClient(String apiEndpoint, io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint)
    • defaultClient

      public ApiRootBuilder defaultClient(String apiEndpoint)
    • defaultClient

      public ApiRootBuilder defaultClient(URI apiEndpoint)
    • withOAuthExecutorService

      public ApiRootBuilder withOAuthExecutorService(ExecutorService executorService)
    • withOAuthExecutorService

      public ApiRootBuilder withOAuthExecutorService(Supplier<ExecutorService> executorService)
    • withClientCredentialsFlow

      public ApiRootBuilder withClientCredentialsFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint)
    • withClientCredentialsFlow

      public ApiRootBuilder withClientCredentialsFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint, Supplier<io.vrap.rmf.base.client.http.HandlerStack> httpClient)
    • withClientCredentialsFlow

      public ApiRootBuilder withClientCredentialsFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint, io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • withClientCredentialsFlow

      public ApiRootBuilder withClientCredentialsFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, URI tokenEndpoint)
    • withClientCredentialsFlow

      public ApiRootBuilder withClientCredentialsFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, URI tokenEndpoint, Supplier<io.vrap.rmf.base.client.http.HandlerStack> httpClient)
    • withClientCredentialsFlow

      public ApiRootBuilder withClientCredentialsFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, URI tokenEndpoint, io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • withStaticTokenFlow

      public ApiRootBuilder withStaticTokenFlow(io.vrap.rmf.base.client.AuthenticationToken token)
    • withAnonymousSessionFlow

      public ApiRootBuilder withAnonymousSessionFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint)
    • withAnonymousSessionFlow

      public ApiRootBuilder withAnonymousSessionFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint, Supplier<io.vrap.rmf.base.client.http.HandlerStack> httpClient)
    • withAnonymousSessionFlow

      public ApiRootBuilder withAnonymousSessionFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String tokenEndpoint, io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • withAnonymousRefreshFlow

      public ApiRootBuilder withAnonymousRefreshFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, ServiceRegion serviceRegion, io.vrap.rmf.base.client.oauth2.TokenStorage storage)
    • withAnonymousRefreshFlow

      public ApiRootBuilder withAnonymousRefreshFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, ServiceRegion serviceRegion, String projectKey, io.vrap.rmf.base.client.oauth2.TokenStorage storage)
    • withAnonymousRefreshFlow

      public ApiRootBuilder withAnonymousRefreshFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, io.vrap.rmf.base.client.oauth2.TokenStorage storage)
    • withAnonymousRefreshFlow

      public ApiRootBuilder withAnonymousRefreshFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, io.vrap.rmf.base.client.oauth2.TokenStorage storage, Supplier<io.vrap.rmf.base.client.http.HandlerStack> httpClient)
    • withAnonymousRefreshFlow

      public ApiRootBuilder withAnonymousRefreshFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String anonTokenEndpoint, String refreshTokenEndpoint, io.vrap.rmf.base.client.oauth2.TokenStorage storage, io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • withGlobalCustomerPasswordFlow

      public ApiRootBuilder withGlobalCustomerPasswordFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String email, String password, String tokenEndpoint)
    • withGlobalCustomerPasswordFlow

      public ApiRootBuilder withGlobalCustomerPasswordFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String email, String password, String tokenEndpoint, Supplier<io.vrap.rmf.base.client.http.HandlerStack> httpClient)
    • withGlobalCustomerPasswordFlow

      public ApiRootBuilder withGlobalCustomerPasswordFlow(io.vrap.rmf.base.client.oauth2.ClientCredentials credentials, String email, String password, String tokenEndpoint, io.vrap.rmf.base.client.VrapHttpClient httpClient)
    • addAcceptGZipMiddleware

      public ApiRootBuilder addAcceptGZipMiddleware()
    • withErrorMiddleware

      public ApiRootBuilder withErrorMiddleware()
    • withErrorMiddleware

      public ApiRootBuilder withErrorMiddleware(io.vrap.rmf.base.client.http.ErrorMiddleware.ExceptionMode exceptionMode)
    • withErrorMiddleware

      public ApiRootBuilder withErrorMiddleware(io.vrap.rmf.base.client.http.ErrorMiddleware errorMiddleware)
    • withTelemetryMiddleware

      public ApiRootBuilder withTelemetryMiddleware(Supplier<io.vrap.rmf.base.client.http.TelemetryMiddleware> telemetryMiddleware)
    • withTelemetryMiddleware

      public ApiRootBuilder withTelemetryMiddleware(io.vrap.rmf.base.client.http.TelemetryMiddleware telemetryMiddleware)
    • addConcurrentModificationMiddleware

      public ApiRootBuilder addConcurrentModificationMiddleware()
    • addConcurrentModificationMiddleware

      public ApiRootBuilder addConcurrentModificationMiddleware(int maxRetries)
    • addConcurrentModificationMiddleware

      public ApiRootBuilder addConcurrentModificationMiddleware(int maxRetries, long delay, long maxDelay)
    • addConcurrentModificationMiddleware

      public ApiRootBuilder addConcurrentModificationMiddleware(ConcurrentModificationMiddleware middleware)
    • addNotFoundExceptionMiddleware

      public ApiRootBuilder addNotFoundExceptionMiddleware(io.vrap.rmf.base.client.http.NotFoundExceptionMiddleware notFoundExceptionMiddleware)
    • addNotFoundExceptionMiddleware

      public ApiRootBuilder addNotFoundExceptionMiddleware()
    • addNotFoundExceptionMiddleware

      public ApiRootBuilder addNotFoundExceptionMiddleware(Set<io.vrap.rmf.base.client.ApiHttpMethod> method)
    • addNotFoundExceptionMiddleware

      public ApiRootBuilder addNotFoundExceptionMiddleware(Predicate<io.vrap.rmf.base.client.ApiHttpRequest> requestPredicate)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(Supplier<io.vrap.rmf.base.client.http.RetryRequestMiddleware> retryMiddleware)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(io.vrap.rmf.base.client.http.RetryRequestMiddleware retryMiddleware)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(int maxRetries)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(int maxRetries, List<Integer> statusCodes)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(int maxRetries, long delay, long maxDelay, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, List<Integer> statusCodes)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ScheduledExecutorService executorService, int maxRetries, long delay, long maxDelay, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, List<Integer> statusCodes)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(ExecutorService executorService, int maxRetries, long delay, long maxDelay, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, List<Integer> statusCodes)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, List<Integer> statusCodes, List<Class<? extends Throwable>> failures)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, long delay, long maxDelay, List<Integer> statusCodes, List<Class<? extends Throwable>> failures, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withRetryMiddleware

      public ApiRootBuilder withRetryMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRetries, long delay, long maxDelay, io.vrap.rmf.base.client.http.FailsafeRetryPolicyBuilderOptions fn)
    • withQueueMiddleware

      public ApiRootBuilder withQueueMiddleware(Supplier<io.vrap.rmf.base.client.http.QueueRequestMiddleware> queueMiddleware)
    • withQueueMiddleware

      public ApiRootBuilder withQueueMiddleware(io.vrap.rmf.base.client.http.QueueRequestMiddleware queueMiddleware)
    • withQueueMiddleware

      public ApiRootBuilder withQueueMiddleware(int maxRequests, Duration maxWaitTime)
    • withQueueMiddleware

      public ApiRootBuilder withQueueMiddleware(dev.failsafe.spi.Scheduler scheduler, int maxRequests, Duration maxWaitTime)
    • withQueueMiddleware

      public ApiRootBuilder withQueueMiddleware(ScheduledExecutorService executorService, int maxRequests, Duration maxWaitTime)
    • withQueueMiddleware

      public ApiRootBuilder withQueueMiddleware(ExecutorService executorService, int maxRequests, Duration maxWaitTime)
    • withOAuthMiddleware

      public ApiRootBuilder withOAuthMiddleware(Supplier<io.vrap.rmf.base.client.http.OAuthMiddleware> oAuthMiddleware)
    • withOAuthMiddleware

      public ApiRootBuilder withOAuthMiddleware(io.vrap.rmf.base.client.http.OAuthMiddleware oAuthMiddleware)
    • withTokenSupplier

      public ApiRootBuilder withTokenSupplier(io.vrap.rmf.base.client.oauth2.TokenSupplier tokenSupplier)
    • withTokenSupplier

      public ApiRootBuilder withTokenSupplier(Supplier<io.vrap.rmf.base.client.oauth2.TokenSupplier> tokenSupplier)
    • withInternalLoggerMiddleware

      public ApiRootBuilder withInternalLoggerMiddleware(io.vrap.rmf.base.client.http.InternalLoggerMiddleware internalLoggerMiddleware)
    • withInternalLoggerFactory

      public ApiRootBuilder withInternalLoggerFactory(io.vrap.rmf.base.client.http.InternalLoggerFactory internalLoggerFactory)
    • withInternalLoggerFactory

      public ApiRootBuilder withInternalLoggerFactory(io.vrap.rmf.base.client.http.InternalLoggerFactory internalLoggerFactory, org.slf4j.event.Level responseLogEvent, org.slf4j.event.Level deprecationLogEvent)
    • withInternalLoggerFactory

      public ApiRootBuilder withInternalLoggerFactory(io.vrap.rmf.base.client.http.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

      public ApiRootBuilder withApiBaseUrl(String apiBaseUrl)
    • withApiBaseUrl

      public ApiRootBuilder withApiBaseUrl(URI apiBaseUrl)
    • withUserAgentSupplier

      public ApiRootBuilder withUserAgentSupplier(Supplier<String> userAgentSupplier)
    • addCorrelationIdProvider

      public ApiRootBuilder addCorrelationIdProvider(@Nullable io.vrap.rmf.base.client.http.CorrelationIdProvider correlationIdProvider)
    • withMiddleware

      public ApiRootBuilder withMiddleware(io.vrap.rmf.base.client.http.Middleware middleware, io.vrap.rmf.base.client.http.Middleware... middlewares)
    • addMiddleware

      public ApiRootBuilder addMiddleware(io.vrap.rmf.base.client.http.Middleware middleware, io.vrap.rmf.base.client.http.Middleware... middlewares)
    • withMiddlewares

      public ApiRootBuilder withMiddlewares(List<io.vrap.rmf.base.client.http.Middleware> middlewares)
    • addMiddlewares

      public ApiRootBuilder addMiddlewares(List<io.vrap.rmf.base.client.http.Middleware> middlewares)
    • with

      public ApiRootBuilder with(UnaryOperator<io.vrap.rmf.base.client.ClientBuilder> builderUnaryOperator)
    • build

      public ApiRoot build()
    • buildClient

      public io.vrap.rmf.base.client.ApiHttpClient buildClient()
    • clientSupplier

      public Supplier<io.vrap.rmf.base.client.ApiHttpClient> clientSupplier()
    • buildForProject

      @Deprecated public ByProjectKeyRequestBuilder buildForProject(String projectKey)
      Deprecated.
      use build(String) instead
      Parameters:
      projectKey - the project key to be used
      Returns:
      Builder
    • buildProjectRoot

      public ProjectApiRoot buildProjectRoot()
    • buildProjectRoot

      @Deprecated public ProjectApiRoot buildProjectRoot(String projectKey)
      Deprecated.
      use build(String) instead
      Parameters:
      projectKey - the project key to be used
      Returns:
      Builder
    • build

      public ProjectApiRoot build(String projectKey)
    • createForProject

      public static ByProjectKeyRequestBuilder createForProject(String projectKey, io.vrap.rmf.base.client.ApiHttpClient clientSupplier)