Class ClientConfigurationUtils


  • public final class ClientConfigurationUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static io.sphere.sdk.client.SphereClient createClient​(io.sphere.sdk.client.SphereClientConfig clientConfig)
      Creates a SphereClient with retry logic which computes a exponential backoff time delay in milliseconds.
      static io.sphere.sdk.client.SphereClient createClient​(io.sphere.sdk.client.SphereClientConfig clientConfig, long timeout, java.util.concurrent.TimeUnit timeUnit)
      Creates a BlockingSphereClient with a custom timeout with a custom TimeUnit.
      static io.sphere.sdk.client.SphereClient createClient​(java.lang.String projectKey, io.vrap.rmf.base.client.oauth2.ClientCredentials clientCredentials, com.commercetools.api.defaultconfig.ServiceRegion serviceRegion)
      Creates a SphereClient with compact layer provided in SDK-v2, which enable different middlewares to suport features like retry logic, NotFoundException handling and conversion of API error to Exception.
      static io.sphere.sdk.client.SphereClient createClient​(java.lang.String projectKey, io.vrap.rmf.base.client.oauth2.ClientCredentials clientCredentials, com.commercetools.api.defaultconfig.ServiceRegion serviceRegion, long timeout, java.util.concurrent.TimeUnit timeUnit)
      Creates a BlockingSphereClient with compact layer provided in SDK-v2, with a custom timeout with a custom TimeUnit.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • createClient

        public static io.sphere.sdk.client.SphereClient createClient​(@Nonnull
                                                                     java.lang.String projectKey,
                                                                     @Nonnull
                                                                     io.vrap.rmf.base.client.oauth2.ClientCredentials clientCredentials,
                                                                     @Nonnull
                                                                     com.commercetools.api.defaultconfig.ServiceRegion serviceRegion)
        Creates a SphereClient with compact layer provided in SDK-v2, which enable different middlewares to suport features like retry logic, NotFoundException handling and conversion of API error to Exception.
        Parameters:
        projectKey - the projectKey for the client.
        clientCredentials - the client credentials for the client consisting of client ID and secret.
        serviceRegion - the service region for the client consisting of API URI and OAuth URI.
        Returns:
        the instantiated SphereClient.
      • createClient

        public static io.sphere.sdk.client.SphereClient createClient​(@Nonnull
                                                                     java.lang.String projectKey,
                                                                     @Nonnull
                                                                     io.vrap.rmf.base.client.oauth2.ClientCredentials clientCredentials,
                                                                     @Nonnull
                                                                     com.commercetools.api.defaultconfig.ServiceRegion serviceRegion,
                                                                     long timeout,
                                                                     @Nonnull
                                                                     java.util.concurrent.TimeUnit timeUnit)
        Creates a BlockingSphereClient with compact layer provided in SDK-v2, with a custom timeout with a custom TimeUnit.
        Parameters:
        projectKey - the projectKey for the client.
        clientCredentials - the client credentials for the client consisting of client ID and secret.
        serviceRegion - the service region for the client consisting of API URI and OAuth URI.
        timeout - the timeout value for the client requests.
        timeUnit - the timeout time unit.
        Returns:
        the instantiated BlockingSphereClient.
      • createClient

        public static io.sphere.sdk.client.SphereClient createClient​(@Nonnull
                                                                     io.sphere.sdk.client.SphereClientConfig clientConfig)
        Creates a SphereClient with retry logic which computes a exponential backoff time delay in milliseconds.
        Parameters:
        clientConfig - the client configuration for the client.
        Returns:
        the instantiated SphereClient.
      • createClient

        public static io.sphere.sdk.client.SphereClient createClient​(@Nonnull
                                                                     io.sphere.sdk.client.SphereClientConfig clientConfig,
                                                                     long timeout,
                                                                     @Nonnull
                                                                     java.util.concurrent.TimeUnit timeUnit)
        Creates a BlockingSphereClient with a custom timeout with a custom TimeUnit.
        Parameters:
        clientConfig - the client configuration for the client.
        timeout - the timeout value for the client requests.
        timeUnit - the timeout time unit.
        Returns:
        the instantiated BlockingSphereClient.