From 77dbb2c3d4c9a1246b74346f42ec499b4704f644 Mon Sep 17 00:00:00 2001 From: Jens Schulze Date: Fri, 13 Oct 2023 08:29:18 +0200 Subject: [PATCH] remove deprecations - methods in CtAsyncHttpClient - methods in RetryMiddleware - ApiFactory - ImportApiFactory - MLApiRootFactory - HistoryApiFactory - "rmf:okhttp-client: module - ClientFactory - MiddlewareFactory - ExceptionFactory - VrapJsonUtils --- build.gradle | 1 - .../http/asynchttp/CtAsyncHttpClient.java | 55 ---- .../api/defaultconfig/ApiFactory.java | 235 ------------------ .../defaultconfig/HistoryApiFactory.java | 193 -------------- .../defaultconfig/ImportApiFactory.java | 191 -------------- .../java/com/commercetools/api/TestBase.java | 8 +- .../ml/defaultconfig/MLApiRootFactory.java | 169 ------------- rmf/okhttp-client/build.gradle | 13 - .../io/vrap/rmf/okhttp/BuilderOptions.java | 9 - .../io/vrap/rmf/okhttp/VrapOkHttpClient.java | 186 -------------- .../rmf/okhttp/VrapOkHttpClientSupplier.java | 22 -- ...io.vrap.rmf.base.client.HttpClientSupplier | 1 - .../java/io/vrap/rmf/okhttp/SupplierTest.java | 14 -- .../vrap/rmf/base/client/ClientFactory.java | 97 -------- .../rmf/base/client/MiddlewareFactory.java | 55 ---- .../base/client/error/ExceptionFactory.java | 48 ---- .../rmf/base/client/http/RetryMiddleware.java | 109 -------- .../base/client/utils/json/VrapJsonUtils.java | 9 - settings.gradle | 1 - 19 files changed, 5 insertions(+), 1411 deletions(-) delete mode 100644 commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/defaultconfig/ApiFactory.java delete mode 100644 commercetools/commercetools-sdk-java-history/src/main/java/com/commercetools/history/defaultconfig/HistoryApiFactory.java delete mode 100644 commercetools/commercetools-sdk-java-importapi/src/main/java/com/commercetools/importapi/defaultconfig/ImportApiFactory.java delete mode 100644 commercetools/commercetools-sdk-java-ml/src/main/java/com/commercetools/ml/defaultconfig/MLApiRootFactory.java delete mode 100644 rmf/okhttp-client/build.gradle delete mode 100644 rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/BuilderOptions.java delete mode 100644 rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClient.java delete mode 100644 rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClientSupplier.java delete mode 100644 rmf/okhttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.HttpClientSupplier delete mode 100644 rmf/okhttp-client/src/test/java/io/vrap/rmf/okhttp/SupplierTest.java delete mode 100644 rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/ClientFactory.java delete mode 100644 rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/MiddlewareFactory.java delete mode 100644 rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/error/ExceptionFactory.java delete mode 100644 rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/utils/json/VrapJsonUtils.java diff --git a/build.gradle b/build.gradle index b043f8d4d9f..7782250bcc8 100644 --- a/build.gradle +++ b/build.gradle @@ -204,7 +204,6 @@ def documentationProjects= [ ":commercetools:commercetools-sdk-java-importapi", ":commercetools:commercetools-sdk-java-ml", ":commercetools:internal-docs", - ":rmf:okhttp-client", ":rmf:rmf-java-base" ] diff --git a/commercetools/commercetools-async-http-client/src/main/java/com/commercetools/http/asynchttp/CtAsyncHttpClient.java b/commercetools/commercetools-async-http-client/src/main/java/com/commercetools/http/asynchttp/CtAsyncHttpClient.java index 15d48bcb85c..cfdccd5edb1 100644 --- a/commercetools/commercetools-async-http-client/src/main/java/com/commercetools/http/asynchttp/CtAsyncHttpClient.java +++ b/commercetools/commercetools-async-http-client/src/main/java/com/commercetools/http/asynchttp/CtAsyncHttpClient.java @@ -36,18 +36,6 @@ public CtAsyncHttpClient() { clientBuilder.get().addRequestFilter(new ThrottleRequestFilter(MAX_REQUESTS)).build()); } - /** - * @deprecated usage of maxConnTotal and maxConnPerRoute not advised as there is no pooling done by AHC. Use {@link CtAsyncHttpClient#CtAsyncHttpClient(int)} instead. - * @param maxConnPerRoute maximum number of parallel connections to one host - * @param maxConnTotal maximum number of parallel connections - */ - @Deprecated - public CtAsyncHttpClient(final int maxConnTotal, final int maxConnPerRoute) { - super(); - asyncHttpClient = new DefaultAsyncHttpClient( - clientBuilder.get().setMaxConnections(maxConnTotal).setMaxConnectionsPerHost(maxConnPerRoute).build()); - } - /** * Uses a {@link ThrottleRequestFilter} to limit the number of concurrent requests * @param maxConnections maximum number of parallel connections @@ -67,20 +55,6 @@ public CtAsyncHttpClient(final BuilderOptions options) { asyncHttpClient = new DefaultAsyncHttpClient(options.plus(clientBuilder.get()).build()); } - /** - * @deprecated usage of maxConnTotal and maxConnPerRoute not advised as there is no pooling done by AHC. Use {@link CtAsyncHttpClient#CtAsyncHttpClient(int, BuilderOptions)} instead. - * @param maxConnPerRoute maximum number of parallel connections to one host - * @param maxConnTotal maximum number of parallel connections - * @param options options to build the underlying HTTP client - */ - @Deprecated - public CtAsyncHttpClient(final int maxConnTotal, final int maxConnPerRoute, final BuilderOptions options) { - super(); - asyncHttpClient = new DefaultAsyncHttpClient( - options.plus(clientBuilder.get().setMaxConnections(maxConnTotal).setMaxConnectionsPerHost(maxConnPerRoute)) - .build()); - } - /** * Uses a {@link ThrottleRequestFilter} to limit the number of concurrent requests * @param maxConnections maximum number of parallel connections @@ -110,19 +84,6 @@ public CtAsyncHttpClient(final ExecutorService executor) { asyncHttpClient = new DefaultAsyncHttpClient(clientBuilder.get().build()); } - /** - * @deprecated usage of maxConnTotal and maxConnPerRoute not advised as there is no pooling done by AHC. Use {@link CtAsyncHttpClient#CtAsyncHttpClient(ExecutorService, int)} instead. - * @param maxConnPerRoute maximum number of parallel connections to one host - * @param maxConnTotal maximum number of parallel connections - * @param executor ExecutorService to be used - */ - @Deprecated - public CtAsyncHttpClient(final ExecutorService executor, final int maxConnTotal, final int maxConnPerRoute) { - super(executor); - asyncHttpClient = new DefaultAsyncHttpClient( - clientBuilder.get().setMaxConnections(maxConnTotal).setMaxConnectionsPerHost(maxConnPerRoute).build()); - } - /** * Uses a {@link ThrottleRequestFilter} to limit the number of concurrent requests * @param maxConnections maximum number of parallel connections @@ -144,22 +105,6 @@ public CtAsyncHttpClient(final ExecutorService executor, final BuilderOptions op asyncHttpClient = new DefaultAsyncHttpClient(options.plus(clientBuilder.get()).build()); } - /** - * @deprecated usage of maxConnTotal and maxConnPerRoute not advised as there is no pooling done by AHC. Use {@link CtAsyncHttpClient#CtAsyncHttpClient(ExecutorService, int, BuilderOptions)} instead. - * @param maxConnPerRoute maximum number of parallel connections to one host - * @param maxConnTotal maximum number of parallel connections - * @param executor ExecutorService to be used - * @param options options to build the underlying HTTP client - */ - @Deprecated - public CtAsyncHttpClient(final ExecutorService executor, final int maxConnTotal, final int maxConnPerRoute, - final BuilderOptions options) { - super(executor); - asyncHttpClient = new DefaultAsyncHttpClient( - options.plus(clientBuilder.get().setMaxConnections(maxConnTotal).setMaxConnectionsPerHost(maxConnPerRoute)) - .build()); - } - /** * Uses a {@link ThrottleRequestFilter} to limit the number of concurrent requests * @param maxConnections maximum number of parallel connections diff --git a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/defaultconfig/ApiFactory.java b/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/defaultconfig/ApiFactory.java deleted file mode 100644 index 1c81e3f13e2..00000000000 --- a/commercetools/commercetools-sdk-java-api/src/main/java/com/commercetools/api/defaultconfig/ApiFactory.java +++ /dev/null @@ -1,235 +0,0 @@ - -package com.commercetools.api.defaultconfig; - -import java.util.List; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - -import com.commercetools.api.client.*; - -import io.vrap.rmf.base.client.ApiHttpClient; -import io.vrap.rmf.base.client.ServiceRegionConfig; -import io.vrap.rmf.base.client.VrapHttpClient; -import io.vrap.rmf.base.client.http.CorrelationIdProvider; -import io.vrap.rmf.base.client.http.Middleware; -import io.vrap.rmf.base.client.oauth2.ClientCredentials; - -/** - * @deprecated use {@link ApiRootBuilder} instead - */ -@Deprecated -public class ApiFactory { - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint) { - return ApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .withInternalLoggerFactory(ApiInternalLoggerFactory::get) - .addCorrelationIdProvider(new ApiCorrelationIdProvider(projectKey)) - .buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares) { - return ApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .withInternalLoggerFactory(ApiInternalLoggerFactory::get) - .addCorrelationIdProvider(new ApiCorrelationIdProvider(projectKey)) - .addMiddlewares(middlewares) - .buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final VrapHttpClient httpClient, final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares) { - return ApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .withInternalLoggerFactory(ApiInternalLoggerFactory::get) - .addCorrelationIdProvider(new ApiCorrelationIdProvider(projectKey)) - .addMiddlewares(middlewares) - .buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final VrapHttpClient httpClient, final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares, CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .withInternalLoggerFactory(ApiInternalLoggerFactory::get) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final Supplier clientSupplier) { - return create(clientSupplier).withProjectKey(projectKey); - } - - public static ApiRoot create(final ClientCredentials credentials) { - return ApiRootBuilder.of().defaultClient(credentials).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, ServiceRegionConfig serviceRegion) { - return ApiRootBuilder.of().defaultClient(credentials, serviceRegion).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return ApiRootBuilder.of().defaultClient(credentials, tokenEndpoint, apiEndpoint).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of() - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares) { - return ApiRootBuilder.of() - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of() - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return ApiRootBuilder.of(httpClient).defaultClient(credentials, tokenEndpoint, apiEndpoint).build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final Supplier clientSupplier) { - return ApiRoot.fromClient(clientSupplier.get()); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials) { - return ApiRootBuilder.of().defaultClient(credentials).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return ApiRootBuilder.of().defaultClient(credentials, tokenEndpoint, apiEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of() - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares) { - return ApiRootBuilder.of() - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return ApiRootBuilder.of(httpClient).defaultClient(credentials, tokenEndpoint, apiEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final Supplier userAgentSupplier, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClient) - .defaultClient(credentials, tokenEndpoint, apiEndpoint) - .withUserAgentSupplier(userAgentSupplier) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .withInternalLoggerFactory(ApiInternalLoggerFactory::get) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final Supplier userAgentSupplier, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return ApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .withInternalLoggerFactory(ApiInternalLoggerFactory::get) - .withUserAgentSupplier(userAgentSupplier) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } -} diff --git a/commercetools/commercetools-sdk-java-history/src/main/java/com/commercetools/history/defaultconfig/HistoryApiFactory.java b/commercetools/commercetools-sdk-java-history/src/main/java/com/commercetools/history/defaultconfig/HistoryApiFactory.java deleted file mode 100644 index 82099fc617e..00000000000 --- a/commercetools/commercetools-sdk-java-history/src/main/java/com/commercetools/history/defaultconfig/HistoryApiFactory.java +++ /dev/null @@ -1,193 +0,0 @@ - -package com.commercetools.history.defaultconfig; - -import java.util.List; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - -import com.commercetools.history.client.ApiRoot; -import com.commercetools.history.client.ByProjectKeyRequestBuilder; -import com.commercetools.history.client.HistoryCorrelationIdProvider; - -import io.vrap.rmf.base.client.*; -import io.vrap.rmf.base.client.http.CorrelationIdProvider; -import io.vrap.rmf.base.client.http.Middleware; -import io.vrap.rmf.base.client.oauth2.ClientCredentials; - -/** - * @deprecated use {@link HistoryApiRootBuilder} instead - */ -@Deprecated -public class HistoryApiFactory { - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint) { - return HistoryApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(new HistoryCorrelationIdProvider(projectKey)) - .buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final Supplier clientSupplier) { - return create(clientSupplier).withProjectKeyValue(projectKey); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return HistoryApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return HistoryApiRootBuilder.of(httpClient).defaultClient(apiEndpoint, credentials, tokenEndpoint).build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final Supplier clientSupplier) { - return ApiRoot.fromClient(clientSupplier.get()); - } - - public static ApiRoot create(final ClientCredentials credentials) { - return HistoryApiRootBuilder.of().defaultClient(credentials).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, ServiceRegionConfig serviceRegion) { - return HistoryApiRootBuilder.of().defaultClient(credentials, serviceRegion).build(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials) { - return HistoryApiRootBuilder.of().defaultClient(credentials).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return HistoryApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares) { - return HistoryApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final Supplier userAgentSupplier, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .withUserAgentSupplier(userAgentSupplier) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final Supplier userAgentSupplier, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return HistoryApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .withUserAgentSupplier(userAgentSupplier) - .addMiddlewares(middlewares) - .buildClient(); - } -} diff --git a/commercetools/commercetools-sdk-java-importapi/src/main/java/com/commercetools/importapi/defaultconfig/ImportApiFactory.java b/commercetools/commercetools-sdk-java-importapi/src/main/java/com/commercetools/importapi/defaultconfig/ImportApiFactory.java deleted file mode 100644 index cc0e30b6db5..00000000000 --- a/commercetools/commercetools-sdk-java-importapi/src/main/java/com/commercetools/importapi/defaultconfig/ImportApiFactory.java +++ /dev/null @@ -1,191 +0,0 @@ - -package com.commercetools.importapi.defaultconfig; - -import java.util.List; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - -import com.commercetools.importapi.client.ApiRoot; -import com.commercetools.importapi.client.ByProjectKeyRequestBuilder; -import com.commercetools.importapi.client.ImportCorrelationIdProvider; - -import io.vrap.rmf.base.client.*; -import io.vrap.rmf.base.client.http.CorrelationIdProvider; -import io.vrap.rmf.base.client.http.Middleware; -import io.vrap.rmf.base.client.oauth2.ClientCredentials; - -/** - * @deprecated use {@link ImportApiRootBuilder} instead - */ -@Deprecated -public class ImportApiFactory { - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint) { - return ImportApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(new ImportCorrelationIdProvider(projectKey)) - .buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final Supplier clientSupplier) { - return create(clientSupplier).withProjectKeyValue(projectKey); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return ImportApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return ImportApiRootBuilder.of(httpClient).defaultClient(apiEndpoint, credentials, tokenEndpoint).build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .build(); - } - - public static ApiRoot create(final Supplier clientSupplier) { - return ApiRoot.fromClient(clientSupplier.get()); - } - - public static ApiRoot create(final ClientCredentials credentials) { - return ImportApiRootBuilder.of().defaultClient(credentials).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, ServiceRegionConfig serviceRegion) { - return ImportApiRootBuilder.of().defaultClient(credentials, serviceRegion).build(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials) { - return ImportApiRootBuilder.of().defaultClient(credentials).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return ImportApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares) { - return ImportApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return ImportApiRootBuilder.of(httpClient).defaultClient(apiEndpoint, credentials, tokenEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final Supplier userAgentSupplier, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .withUserAgentSupplier(userAgentSupplier) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final Supplier userAgentSupplier, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return ImportApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .withUserAgentSupplier(userAgentSupplier) - .addMiddlewares(middlewares) - .buildClient(); - } -} diff --git a/commercetools/commercetools-sdk-java-ml/src/integrationTest/java/com/commercetools/api/TestBase.java b/commercetools/commercetools-sdk-java-ml/src/integrationTest/java/com/commercetools/api/TestBase.java index 7cbc13f9192..5b6e50481ea 100644 --- a/commercetools/commercetools-sdk-java-ml/src/integrationTest/java/com/commercetools/api/TestBase.java +++ b/commercetools/commercetools-sdk-java-ml/src/integrationTest/java/com/commercetools/api/TestBase.java @@ -4,7 +4,7 @@ import java.util.Optional; import com.commercetools.ml.client.ByProjectKeyRequestBuilder; -import com.commercetools.ml.defaultconfig.MLApiRootFactory; +import com.commercetools.ml.defaultconfig.MLApiRootBuilder; import com.commercetools.ml.defaultconfig.ServiceRegion; import io.vrap.rmf.base.client.oauth2.ClientCredentials; @@ -17,8 +17,10 @@ public class TestBase { public final String tokenUrl = ServiceRegion.GCP_EUROPE.getOAuthTokenUrl(); public final String ml_host = ServiceRegion.GCP_EUROPE.getApiUrl(); - public final ByProjectKeyRequestBuilder mlApiBuilder = MLApiRootFactory.createForProject(projectKey, - ClientCredentials.of().withClientId(clientId).withClientSecret(clientSecret).build(), tokenUrl, ml_host); + public final ByProjectKeyRequestBuilder mlApiBuilder = MLApiRootBuilder.of() + .defaultClient(ClientCredentials.of().withClientId(clientId).withClientSecret(clientSecret).build(), + tokenUrl, ml_host) + .buildForProject(projectKey); public static String requireEnvVar(String varName) { return Optional.ofNullable(System.getenv(varName)) diff --git a/commercetools/commercetools-sdk-java-ml/src/main/java/com/commercetools/ml/defaultconfig/MLApiRootFactory.java b/commercetools/commercetools-sdk-java-ml/src/main/java/com/commercetools/ml/defaultconfig/MLApiRootFactory.java deleted file mode 100644 index dd0eec4be5c..00000000000 --- a/commercetools/commercetools-sdk-java-ml/src/main/java/com/commercetools/ml/defaultconfig/MLApiRootFactory.java +++ /dev/null @@ -1,169 +0,0 @@ - -package com.commercetools.ml.defaultconfig; - -import java.util.List; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - -import com.commercetools.ml.client.ApiRoot; -import com.commercetools.ml.client.ByProjectKeyRequestBuilder; - -import io.vrap.rmf.base.client.*; -import io.vrap.rmf.base.client.http.CorrelationIdProvider; -import io.vrap.rmf.base.client.http.Middleware; -import io.vrap.rmf.base.client.oauth2.ClientCredentials; - -/** - * @deprecated use {@link MLApiRootFactory} instead - */ -@Deprecated -public class MLApiRootFactory { - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint) { - return MLApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).buildForProject(projectKey); - } - - public static ByProjectKeyRequestBuilder createForProject(final String projectKey, - final Supplier clientSupplier) { - return create(clientSupplier).withProjectKey(projectKey); - } - - public static ApiRoot create(final ClientCredentials credentials) { - return MLApiRootBuilder.of().defaultClient(credentials).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, ServiceRegionConfig serviceRegion) { - return MLApiRootBuilder.of().defaultClient(credentials, serviceRegion).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return MLApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return MLApiRootBuilder.of(httpClient).defaultClient(apiEndpoint, credentials, tokenEndpoint).build(); - } - - public static ApiRoot create(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .build(); - } - - public static ApiRoot create(final Supplier clientSupplier) { - return ApiRoot.fromClient(clientSupplier.get()); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials) { - return MLApiRootBuilder.of().defaultClient(credentials).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint) { - return MLApiRootBuilder.of().defaultClient(apiEndpoint, credentials, tokenEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares) { - return MLApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint) { - return MLApiRootBuilder.of(httpClient).defaultClient(apiEndpoint, credentials, tokenEndpoint).buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final ClientCredentials credentials, final String tokenEndpoint, - final String apiEndpoint, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of() - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares) { - return MLApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final VrapHttpClient httpClient, final ClientCredentials credentials, - final String tokenEndpoint, final String apiEndpoint, final Supplier userAgentSupplier, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of(httpClient) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .withUserAgentSupplier(userAgentSupplier) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .buildClient(); - } - - public static ApiHttpClient defaultClient(final Supplier httpClientSupplier, - final ClientCredentials credentials, final String tokenEndpoint, final String apiEndpoint, - final Supplier userAgentSupplier, final List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return MLApiRootBuilder.of(httpClientSupplier.get()) - .defaultClient(apiEndpoint, credentials, tokenEndpoint) - .addCorrelationIdProvider(correlationIdProvider) - .withUserAgentSupplier(userAgentSupplier) - .addMiddlewares(middlewares) - .buildClient(); - } -} diff --git a/rmf/okhttp-client/build.gradle b/rmf/okhttp-client/build.gradle deleted file mode 100644 index 0271010c1a3..00000000000 --- a/rmf/okhttp-client/build.gradle +++ /dev/null @@ -1,13 +0,0 @@ - -dependencies { - api project(":rmf:rmf-java-base") - api("com.squareup.okhttp3:okhttp") { - version { - strictly '[4.0,5.0[' - prefer '4.10.0' - } - } - implementation "com.squareup.okio:okio:3.5.0" - - implementation javax.validation -} diff --git a/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/BuilderOptions.java b/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/BuilderOptions.java deleted file mode 100644 index dc0bbc27c57..00000000000 --- a/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/BuilderOptions.java +++ /dev/null @@ -1,9 +0,0 @@ - -package io.vrap.rmf.okhttp; - -import okhttp3.OkHttpClient; - -@FunctionalInterface -public interface BuilderOptions { - OkHttpClient.Builder plus(OkHttpClient.Builder builder); -} diff --git a/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClient.java b/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClient.java deleted file mode 100644 index 9286531aecb..00000000000 --- a/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClient.java +++ /dev/null @@ -1,186 +0,0 @@ - -package io.vrap.rmf.okhttp; - -import java.io.IOException; -import java.util.Map; -import java.util.Objects; -import java.util.Optional; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; -import java.util.function.Supplier; -import java.util.stream.Collectors; - -import javax.validation.constraints.NotNull; - -import io.vrap.rmf.base.client.ApiHttpHeaders; -import io.vrap.rmf.base.client.ApiHttpRequest; -import io.vrap.rmf.base.client.ApiHttpResponse; -import io.vrap.rmf.base.client.VrapHttpClient; -import io.vrap.rmf.base.client.utils.Utils; - -import okhttp3.*; -import okhttp3.internal.http.RealResponseBody; -import okio.GzipSource; -import okio.Okio; - -/** - * HttpClient using OkHttp - */ -@Deprecated -public class VrapOkHttpClient implements VrapHttpClient, AutoCloseable { - - private final Supplier clientBuilder = () -> new OkHttpClient.Builder() - .connectTimeout(120, TimeUnit.SECONDS) - .writeTimeout(120, TimeUnit.SECONDS) - .readTimeout(120, TimeUnit.SECONDS) - .addInterceptor(new UnzippingInterceptor()); - - private final OkHttpClient okHttpClient; - - public VrapOkHttpClient() { - okHttpClient = clientBuilder.get().build(); - } - - public VrapOkHttpClient(BuilderOptions options) { - okHttpClient = options.plus(clientBuilder.get()).build(); - } - - public VrapOkHttpClient(Supplier builderSupplier) { - okHttpClient = builderSupplier.get().build(); - } - - public VrapOkHttpClient(int maxRequests, int maxRequestsPerHost) { - Dispatcher dispatcher = new Dispatcher(); - dispatcher.setMaxRequests(maxRequests); - dispatcher.setMaxRequestsPerHost(maxRequestsPerHost); - okHttpClient = clientBuilder.get().dispatcher(dispatcher).build(); - } - - public VrapOkHttpClient(ExecutorService executor, int maxRequests, int maxRequestsPerHost) { - Dispatcher dispatcher = new Dispatcher(executor); - dispatcher.setMaxRequests(maxRequests); - dispatcher.setMaxRequestsPerHost(maxRequestsPerHost); - okHttpClient = clientBuilder.get().dispatcher(dispatcher).build(); - } - - private static final String CONTENT_TYPE = "Content-Type"; - private static final MediaType JSON = MediaType.get("application/json; charset=utf-8"); - private static final byte[] emptyBody = new byte[0]; - - @Override - public CompletableFuture> execute(ApiHttpRequest request) { - return makeRequest(okHttpClient, toRequest(request)).thenApply(VrapOkHttpClient::toResponse); - - } - - private static ApiHttpResponse toResponse(final Response response) { - ApiHttpHeaders apiHttpHeaders = new ApiHttpHeaders(response.headers() - .toMultimap() - .entrySet() - .stream() - .flatMap(e -> e.getValue().stream().map(value -> ApiHttpHeaders.headerEntry(e.getKey(), value))) - .collect(Collectors.toList())); - - ApiHttpResponse apiHttpResponse = new ApiHttpResponse<>(response.code(), apiHttpHeaders, - Optional.ofNullable(response.body()).map(Utils.wrapToCompletionException(ResponseBody::bytes)).orElse(null), - response.message()); - if (apiHttpResponse.getBody() != null) { - response.close(); - } - return apiHttpResponse; - } - - private static Request toRequest(final ApiHttpRequest apiHttpRequest) { - - Request.Builder httpRequestBuilder = new Request.Builder().url(apiHttpRequest.getUrl()); - - //set headers - for (Map.Entry entry : apiHttpRequest.getHeaders().getHeaders()) { - httpRequestBuilder = httpRequestBuilder.header(entry.getKey(), entry.getValue()); - } - - if (apiHttpRequest.getMethod() == null) { - throw new IllegalStateException("apiHttpRequest method should be non null"); - } - - //default media type is JSON, if other media type is set as a header, use it - MediaType mediaType = JSON; - if (apiHttpRequest.getHeaders() - .getHeaders() - .stream() - .anyMatch(s -> s.getKey().equalsIgnoreCase(CONTENT_TYPE))) { - mediaType = MediaType - .get(Objects.requireNonNull(apiHttpRequest.getHeaders().getFirst(ApiHttpHeaders.CONTENT_TYPE))); - } - - final RequestBody body = apiHttpRequest.getBody() == null ? null - : RequestBody.create(apiHttpRequest.getBody(), mediaType); - httpRequestBuilder.method(apiHttpRequest.getMethod().name(), body); - return httpRequestBuilder.build(); - } - - private CompletableFuture makeRequest(OkHttpClient client, Request request) { - Call call = client.newCall(request); - OkHttpResponseFuture result = new OkHttpResponseFuture(); - call.enqueue(result); - return result.future; - } - - private static class OkHttpResponseFuture implements Callback { - public final CompletableFuture future = new CompletableFuture<>(); - - public OkHttpResponseFuture() { - } - - @Override - public void onFailure(Call call, IOException e) { - future.completeExceptionally(e); - } - - @Override - public void onResponse(Call call, Response response) throws IOException { - future.complete(response); - } - } - - @Override - public void close() throws IOException { - okHttpClient.dispatcher().executorService().shutdown(); - okHttpClient.connectionPool().evictAll(); - if (okHttpClient.cache() != null) - Objects.requireNonNull(okHttpClient.cache()).close(); - } - - private static class UnzippingInterceptor implements Interceptor { - @Override - @NotNull - public Response intercept(Chain chain) throws IOException { - Response response = chain.proceed(chain.request()); - return unzip(response); - } - - private Response unzip(final Response response) throws IOException { - if (!"gzip".equalsIgnoreCase(response.header("Content-Encoding"))) { - return response; - } - - ResponseBody responseBody = response.body(); - if (responseBody == null) { - return response; - } - - GzipSource gzipSource = new GzipSource(responseBody.source()); - Headers strippedHeaders = response.headers() - .newBuilder() - .removeAll("Content-Encoding") - .removeAll("Content-Length") - .build(); - String contentType = response.header("Content-Type"); - return response.newBuilder() - .headers(strippedHeaders) - .body(new RealResponseBody(contentType, -1L, Okio.buffer(gzipSource))) - .build(); - } - } -} diff --git a/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClientSupplier.java b/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClientSupplier.java deleted file mode 100644 index 42a1f0a4cfd..00000000000 --- a/rmf/okhttp-client/src/main/java/io/vrap/rmf/okhttp/VrapOkHttpClientSupplier.java +++ /dev/null @@ -1,22 +0,0 @@ - -package io.vrap.rmf.okhttp; - -import java.util.concurrent.ExecutorService; -import java.util.function.Supplier; - -import io.vrap.rmf.base.client.BaseHttpClientSupplier; -import io.vrap.rmf.base.client.VrapHttpClient; - -@Deprecated -public class VrapOkHttpClientSupplier extends BaseHttpClientSupplier { - - @Override - public VrapHttpClient get() { - return new VrapOkHttpClient(); - } - - @Override - public Supplier get(ExecutorService executorService) { - return () -> new VrapOkHttpClient(executorService, 64, 64); - } -} diff --git a/rmf/okhttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.HttpClientSupplier b/rmf/okhttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.HttpClientSupplier deleted file mode 100644 index a30cba6d8c3..00000000000 --- a/rmf/okhttp-client/src/main/resources/META-INF/services/io.vrap.rmf.base.client.HttpClientSupplier +++ /dev/null @@ -1 +0,0 @@ -io.vrap.rmf.okhttp.VrapOkHttpClientSupplier diff --git a/rmf/okhttp-client/src/test/java/io/vrap/rmf/okhttp/SupplierTest.java b/rmf/okhttp-client/src/test/java/io/vrap/rmf/okhttp/SupplierTest.java deleted file mode 100644 index 5e71b88daa4..00000000000 --- a/rmf/okhttp-client/src/test/java/io/vrap/rmf/okhttp/SupplierTest.java +++ /dev/null @@ -1,14 +0,0 @@ - -package io.vrap.rmf.okhttp; - -import io.vrap.rmf.base.client.HttpClientSupplier; - -import org.assertj.core.api.Assertions; -import org.junit.jupiter.api.Test; - -public class SupplierTest { - @Test - public void testCreate() { - Assertions.assertThat(HttpClientSupplier.of().get()).isInstanceOf(VrapOkHttpClient.class); - } -} diff --git a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/ClientFactory.java b/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/ClientFactory.java deleted file mode 100644 index 5050983802f..00000000000 --- a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/ClientFactory.java +++ /dev/null @@ -1,97 +0,0 @@ - -package io.vrap.rmf.base.client; - -import java.util.ArrayList; -import java.util.List; -import java.util.function.Supplier; - -import javax.annotation.Nullable; - -import io.vrap.rmf.base.client.http.*; -import io.vrap.rmf.base.client.oauth2.TokenSupplier; - -/** - * @deprecated use {@link ClientBuilder} instead - */ -@Deprecated -public class ClientFactory { - - public static final String COMMERCETOOLS = "commercetools"; - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier) { - return create(apiBaseUrl, httpClient, tokenSupplier, - (request, topic) -> InternalLogger.getLogger(COMMERCETOOLS + "." + topic), new ArrayList<>(), null); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final Supplier userAgentSupplier) { - return create(apiBaseUrl, httpClient, tokenSupplier, - (request, topic) -> InternalLogger.getLogger(COMMERCETOOLS + "." + topic), userAgentSupplier, - new ArrayList<>(), null); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final List middlewares) { - return create(apiBaseUrl, httpClient, tokenSupplier, - (request, topic) -> InternalLogger.getLogger(COMMERCETOOLS + "." + topic), middlewares, null); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final Supplier userAgentSupplier, - final List middlewares) { - return create(apiBaseUrl, httpClient, tokenSupplier, - (request, topic) -> InternalLogger.getLogger(COMMERCETOOLS + "." + topic), userAgentSupplier, middlewares, - null); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final List middlewares, - final CorrelationIdProvider correlationIdProvider) { - return create(apiBaseUrl, httpClient, tokenSupplier, - (request, topic) -> InternalLogger.getLogger(COMMERCETOOLS + "." + topic), middlewares, - correlationIdProvider); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final Supplier userAgentSupplier, - final List middlewares, final CorrelationIdProvider correlationIdProvider) { - return create(apiBaseUrl, httpClient, tokenSupplier, - (request, topic) -> InternalLogger.getLogger(COMMERCETOOLS + "." + topic), userAgentSupplier, middlewares, - correlationIdProvider); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final InternalLoggerFactory internalLoggerFactory, - List middlewares) { - return create(apiBaseUrl, httpClient, tokenSupplier, internalLoggerFactory, middlewares, null); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final InternalLoggerFactory internalLoggerFactory, - final Supplier userAgentSupplier, List middlewares) { - return create(apiBaseUrl, httpClient, tokenSupplier, internalLoggerFactory, userAgentSupplier, middlewares, - null); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final InternalLoggerFactory internalLoggerFactory, - List middlewares, @Nullable final CorrelationIdProvider correlationIdProvider) { - return create(apiBaseUrl, httpClient, tokenSupplier, internalLoggerFactory, - ClientBuilder::buildDefaultUserAgent, middlewares, correlationIdProvider); - } - - public static ApiHttpClient create(final String apiBaseUrl, final VrapHttpClient httpClient, - final TokenSupplier tokenSupplier, final InternalLoggerFactory internalLoggerFactory, - final Supplier userAgentSupplier, List middlewares, - @Nullable final CorrelationIdProvider correlationIdProvider) { - return ClientBuilder.of(httpClient) - .defaultClient(apiBaseUrl) - .withInternalLoggerFactory(internalLoggerFactory) - .withUserAgentSupplier(userAgentSupplier) - .withTokenSupplier(tokenSupplier) - .addCorrelationIdProvider(correlationIdProvider) - .addMiddlewares(middlewares) - .build(); - } -} diff --git a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/MiddlewareFactory.java b/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/MiddlewareFactory.java deleted file mode 100644 index 25cf1db53ec..00000000000 --- a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/MiddlewareFactory.java +++ /dev/null @@ -1,55 +0,0 @@ - -package io.vrap.rmf.base.client; - -import static java.util.Arrays.asList; - -import java.util.List; -import java.util.function.Supplier; - -import io.vrap.rmf.base.client.error.HttpExceptionFactory; -import io.vrap.rmf.base.client.http.*; -import io.vrap.rmf.base.client.oauth2.TokenSupplier; - -import org.apache.commons.lang3.SystemUtils; - -/** - * @deprecated functionality now available using the {@link ClientBuilder} - */ -@Deprecated -public class MiddlewareFactory { - public static List createDefault(final TokenSupplier tokenSupplier, - final InternalLoggerFactory internalLoggerFactory) { - return createDefault(tokenSupplier, internalLoggerFactory, MiddlewareFactory::buildUserAgent); - } - - public static List createDefault(final TokenSupplier tokenSupplier, - final InternalLoggerFactory internalLoggerFactory, final Supplier userAgent) { - return createDefault(tokenSupplier, internalLoggerFactory, userAgent, ResponseSerializer.of()); - } - - public static List createDefault(final TokenSupplier tokenSupplier, - final InternalLoggerFactory internalLoggerFactory, final Supplier userAgent, - final ResponseSerializer serializer) { - final OAuthHandler oAuthHandler = new OAuthHandler(tokenSupplier); - return asList( - (request, - next) -> next.apply(request.withHeader(ApiHttpHeaders.USER_AGENT, userAgent.get()) - .withHeader(ApiHttpHeaders.ACCEPT_ENCODING, "gzip")), - ErrorMiddleware.of(HttpExceptionFactory.of(serializer)), InternalLoggerMiddleware.of(internalLoggerFactory), - OAuthMiddleware.of(oAuthHandler)); - } - - /** - * @deprecated use {@link ClientBuilder#buildDefaultUserAgent()} instead - * @return user agent string - */ - @Deprecated - public static String buildUserAgent() { - String runtimeVersion = SystemUtils.JAVA_RUNTIME_VERSION; - String osName = SystemUtils.OS_NAME; - String osArch = SystemUtils.OS_ARCH; - String sdkVersion = BuildInfo.VERSION; - return "commercetools-java-sdks/" + sdkVersion + " " + " Java/" + runtimeVersion + " (" + osName + "; " + osArch - + ")"; - } -} diff --git a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/error/ExceptionFactory.java b/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/error/ExceptionFactory.java deleted file mode 100644 index 200a97579a0..00000000000 --- a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/error/ExceptionFactory.java +++ /dev/null @@ -1,48 +0,0 @@ - -package io.vrap.rmf.base.client.error; - -import io.vrap.rmf.base.client.ApiHttpException; -import io.vrap.rmf.base.client.ApiHttpRequest; -import io.vrap.rmf.base.client.ApiHttpResponse; -import io.vrap.rmf.base.client.ResponseSerializer; - -/** - * @deprecated use {@link HttpExceptionFactory} instead - */ -@Deprecated -public class ExceptionFactory { - public static ApiHttpException create(final ApiHttpRequest request, final ApiHttpResponse response) { - if (response.getStatusCode() >= 500) { - return createServerException(request, response); - } - return createClientException(request, response); - } - - public static ApiHttpException create(final ApiHttpRequest request, final ApiHttpResponse response, - final ResponseSerializer serializer) { - if (response.getStatusCode() >= 500) { - return createServerException(request, response, serializer); - } - return createClientException(request, response, serializer); - } - - public static ApiHttpException createServerException(final ApiHttpRequest request, - final ApiHttpResponse response) { - return createServerException(request, response, ResponseSerializer.of()); - } - - public static ApiHttpException createServerException(final ApiHttpRequest request, - final ApiHttpResponse response, final ResponseSerializer serializer) { - return HttpExceptionFactory.of(serializer).createServerException(request, response); - } - - public static ApiHttpException createClientException(final ApiHttpRequest request, - final ApiHttpResponse response) { - return createClientException(request, response, ResponseSerializer.of()); - } - - public static ApiHttpException createClientException(ApiHttpRequest request, ApiHttpResponse response, - final ResponseSerializer serializer) { - return HttpExceptionFactory.of(serializer).createClientException(request, response); - } -} diff --git a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/http/RetryMiddleware.java b/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/http/RetryMiddleware.java index 6f4512dc6be..b49cd7db7c6 100644 --- a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/http/RetryMiddleware.java +++ b/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/http/RetryMiddleware.java @@ -28,77 +28,17 @@ public class RetryMiddleware implements RetryRequestMiddleware, AutoCloseable { static final String loggerName = ClientBuilder.COMMERCETOOLS + ".retry"; - /** - * @deprecated use {@link RetryRequestMiddleware#DEFAULT_MAX_DELAY} instead - */ - @Deprecated - public static final int DEFAULT_MAX_DELAY = RetryRequestMiddleware.DEFAULT_MAX_DELAY; - /** - * @deprecated use {@link RetryRequestMiddleware#DEFAULT_INITIAL_DELAY} instead - */ - @Deprecated - public static final int DEFAULT_INITIAL_DELAY = RetryRequestMiddleware.DEFAULT_INITIAL_DELAY; - /** - * @deprecated use {@link RetryRequestMiddleware#DEFAULT_RETRY_STATUS_CODES} instead - */ - @Deprecated - public static final List DEFAULT_RETRY_STATUS_CODES = RetryRequestMiddleware.DEFAULT_RETRY_STATUS_CODES; private static final InternalLogger logger = InternalLogger.getLogger(loggerName); private static final Logger classLogger = LoggerFactory.getLogger(RetryMiddleware.class); private final FailsafeExecutor> failsafeExecutor; - /** - * @deprecated use {@link RetryRequestMiddleware#of(int)} instead - * @param maxRetries number of retries before giving up - */ - @Deprecated - public RetryMiddleware(final int maxRetries) { - this(Scheduler.DEFAULT, maxRetries, RetryRequestMiddleware.DEFAULT_INITIAL_DELAY, - RetryRequestMiddleware.DEFAULT_MAX_DELAY, RetryRequestMiddleware.DEFAULT_RETRY_STATUS_CODES, null); - } - - /** - * @deprecated use {@link RetryRequestMiddleware#of(int, List)} instead - * @param maxRetries number of retries before giving up - * @param statusCodes response status codes to be retried - */ - @Deprecated - public RetryMiddleware(final int maxRetries, final List statusCodes) { - this(Scheduler.DEFAULT, maxRetries, RetryRequestMiddleware.DEFAULT_INITIAL_DELAY, - RetryRequestMiddleware.DEFAULT_MAX_DELAY, statusCodes, null); - } - RetryMiddleware(final int maxRetries, final List statusCodes, final List> failures) { this(Scheduler.DEFAULT, maxRetries, RetryRequestMiddleware.DEFAULT_INITIAL_DELAY, RetryRequestMiddleware.DEFAULT_MAX_DELAY, statusCodes, failures); } - /** - * @deprecated use {@link RetryRequestMiddleware#of(int, long, long)} instead - * @param maxRetries number of retries before giving up - * @param delay initial delay before retry - * @param maxDelay maximum delay before retry - */ - @Deprecated - public RetryMiddleware(final int maxRetries, final long delay, final long maxDelay) { - this(Scheduler.DEFAULT, maxRetries, delay, maxDelay, RetryRequestMiddleware.DEFAULT_RETRY_STATUS_CODES, null); - } - - /** - * @deprecated use {@link RetryRequestMiddleware#of(int, long, long, List)} instead - * @param maxRetries number of retries before giving up - * @param delay initial delay before retry - * @param maxDelay maximum delay before retry - * @param statusCodes response status codes to be retried - */ - @Deprecated - public RetryMiddleware(final int maxRetries, final long delay, final long maxDelay, - final List statusCodes) { - this(Scheduler.DEFAULT, maxRetries, delay, maxDelay, statusCodes, null); - } - RetryMiddleware(final int maxRetries, final long delay, final long maxDelay, final List statusCodes, final List> failures) { this(Scheduler.DEFAULT, maxRetries, delay, maxDelay, RetryRequestMiddleware.handleFailures(failures) @@ -207,55 +147,6 @@ private String requestLog(final int attempt, ApiHttpRequest request, ApiHttpResp return output; } - /** - * @deprecated max parallel requests are limited by underlying HTTP client - * @param maxRetries number of retries before giving up - * @param maxParallelRequests maximum number of parallel retry requests - */ - @Deprecated - public RetryMiddleware(final int maxParallelRequests, final int maxRetries) { - this(maxRetries, RetryRequestMiddleware.DEFAULT_INITIAL_DELAY, RetryRequestMiddleware.DEFAULT_MAX_DELAY, - RetryRequestMiddleware.DEFAULT_RETRY_STATUS_CODES, null); - } - - /** - * @deprecated max parallel requests are limited by underlying HTTP client - * @param maxRetries number of retries before giving up - * @param maxParallelRequests maximum number of parallel retry requests - * @param statusCodes response status codes to be retried - */ - @Deprecated - public RetryMiddleware(final int maxParallelRequests, final int maxRetries, final List statusCodes) { - this(maxRetries, RetryRequestMiddleware.DEFAULT_INITIAL_DELAY, RetryRequestMiddleware.DEFAULT_MAX_DELAY, - statusCodes, null); - } - - /** - * @deprecated max parallel requests are limited by underlying HTTP client - * @param maxRetries number of retries before giving up - * @param maxParallelRequests maximum number of parallel retry requests - * @param delay initial delay before retry - * @param maxDelay maximum delay before retry - */ - @Deprecated - public RetryMiddleware(final int maxParallelRequests, final int maxRetries, final long delay, final long maxDelay) { - this(maxRetries, delay, maxDelay, RetryRequestMiddleware.DEFAULT_RETRY_STATUS_CODES, null); - } - - /** - * @deprecated max parallel requests are limited by underlying HTTP client - * @param maxRetries number of retries before giving up - * @param maxParallelRequests maximum number of parallel retry requests - * @param delay initial delay before retry - * @param maxDelay maximum delay before retry - * @param statusCodes response status codes to be retried - */ - @Deprecated - public RetryMiddleware(final int maxParallelRequests, final int maxRetries, final long delay, final long maxDelay, - List statusCodes) { - this(maxRetries, delay, maxDelay, statusCodes, null); - } - @Override public CompletableFuture> invoke(final ApiHttpRequest request, final Function>> next) { diff --git a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/utils/json/VrapJsonUtils.java b/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/utils/json/VrapJsonUtils.java deleted file mode 100644 index 07700c2145b..00000000000 --- a/rmf/rmf-java-base/src/main/java/io/vrap/rmf/base/client/utils/json/VrapJsonUtils.java +++ /dev/null @@ -1,9 +0,0 @@ - -package io.vrap.rmf.base.client.utils.json; - -/** - * @deprecated use {@link JsonUtils} instead - */ -@Deprecated -public final class VrapJsonUtils extends JsonUtils { -} diff --git a/settings.gradle b/settings.gradle index 50d9116b92d..149172a6206 100644 --- a/settings.gradle +++ b/settings.gradle @@ -2,7 +2,6 @@ rootProject.name = 'commercetools-sdk-java-v2' include 'rmf:rmf-java-base' include 'commercetools:commercetools-okhttp-client3' include 'commercetools:commercetools-okhttp-client4' -include 'rmf:okhttp-client' include 'commercetools:commercetools-http-client' include 'commercetools:commercetools-javanet-client' include 'commercetools:commercetools-monitoring-newrelic'