Package com.commercetools.compat
Class CompatSphereClient
java.lang.Object
io.vrap.rmf.base.client.AutoCloseableService
com.commercetools.compat.CompatSphereClient
- All Implemented Interfaces:
SphereClient,AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic enum -
Method Summary
Modifier and TypeMethodDescriptionapiRoot()<T> CompletionStage<T>execute(SphereRequest<T> sphereRequest) static CompatSphereClientof(ProjectApiRoot apiRoot) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ProjectApiRoot apiRoot, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ProjectApiRoot apiRoot, ObjectMapper mapper) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ProjectApiRoot apiRoot, ObjectMapper mapper, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(SphereClientConfig clientConfig) creates an instance of the CompatSphereClient.static CompatSphereClientof(SphereClientConfig clientConfig, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ApiHttpClient apiHttpClient, ObjectMapper mapper, String projectKey) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ApiHttpClient apiHttpClient, ObjectMapper mapper, String projectKey, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ApiHttpClient apiHttpClient, String projectKey) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.static CompatSphereClientof(ApiHttpClient apiHttpClient, String projectKey, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient.inttoString()Methods inherited from class io.vrap.rmf.base.client.AutoCloseableService
close, closeQuietly, equals, hashCodeMethods inherited from interface io.sphere.sdk.client.SphereClient
close
-
Method Details
-
apiRoot
-
getClient
-
getProjectKey
-
getExceptionMode
-
getMapper
-
of
creates an instance of the CompatSphereClient. Please be aware for backwards compatibility the v2 Exceptions are thrown- Parameters:
clientConfig- client configuration- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiRoot- the ApiRoot with the underlying ApiHttpClient to be used- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiRoot- the ApiRoot with the underlying ApiHttpClient to be usedmapper- Jackson ObjectMapper to be used for deserialization- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiHttpClient- the underlying ApiHttpClient to be usedprojectKey- the key of the used project- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
public static CompatSphereClient of(ApiHttpClient apiHttpClient, ObjectMapper mapper, String projectKey) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiHttpClient- the underlying ApiHttpClient to be usedprojectKey- the project key to be usedmapper- Jackson ObjectMapper to be used for deserialization- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
public static CompatSphereClient of(SphereClientConfig clientConfig, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
clientConfig- client configurationexceptionMode- SDKv1 or SDKv2 exceptions to be used- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
public static CompatSphereClient of(ProjectApiRoot apiRoot, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiRoot- the ApiRoot with the underlying ApiHttpClient to be usedexceptionMode- SDKv1 or SDKv2 exceptions to be used- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
public static CompatSphereClient of(ProjectApiRoot apiRoot, ObjectMapper mapper, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiRoot- the ApiRoot with the underlying ApiHttpClient to be usedmapper- Jackson ObjectMapper to be used for deserializationexceptionMode- SDKv1 or SDKv2 exceptions to be used- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
public static CompatSphereClient of(ApiHttpClient apiHttpClient, String projectKey, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiHttpClient- the underlying ApiHttpClient to be usedprojectKey- project key to be usedexceptionMode- SDKv1 or SDKv2 exceptions to be used- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
of
public static CompatSphereClient of(ApiHttpClient apiHttpClient, ObjectMapper mapper, String projectKey, CompatSphereClient.ExceptionMode exceptionMode) Wraps an ApiHttpClient in a SDK v1 compatible SphereClient. SDKv1 Exceptions are thrown- Parameters:
apiHttpClient- the underlying ApiHttpClient to be usedprojectKey- the project key to be usedmapper- Jackson ObjectMapper to be used for deserializationexceptionMode- SDKv1 or SDKv2 exceptions to be used- Returns:
- SphereClient using a SDK v2 ApiHttpClient as HTTP client
-
execute
- Specified by:
executein interfaceSphereClient
-
getConfig
- Specified by:
getConfigin interfaceSphereClient
-
toString
-
reflectionHashCode
public int reflectionHashCode()
-