map) {
- R body = response.getBody() != null
- ? map.apply(response.getBody())
- : null;
- return new Result<>(response, body);
- }
-
- /**
- * Apply {@code map} function to {@code Response::getBody} and return
- * {@link Future} with the transformed body.
- *
- *
- * A {@code null}-body is passed as-is.
- *
- *
- * Usage:
- *
- *
{@code @Override
- * public Future run(FutureCallback> callback) {
- * // Deserializes into Person.class but returns Person's firstName or null.
- * return sendGetRequest("/person", callback, Result.mapParser(Person.class, Person::getFirstName));
- * }
- * }
- */
- public static ResponseParser mapParser(Class cls, Function map) {
- return new ResponseParser() {
- @Override
- public Result parse(HttpResponse response, String body, ContentType contentType) {
- Response resp = this.serializer.toResponse(response.getCode(), body, cls);
- return Result.map(resp, map);
- }
- };
- }
-
- /**
- * Convert {@code T[]} response to a {@code List} response.
- * This is handy for all request handlers which returns lists,
- * as the current client does not support deserializing into a parametrized
- * {@code List.class}.
- *
- *
- * Usage:
- *
- *
{@code @Override
- * public Result> run() {
- * return Result.toList(sendGetRequest("/names", String[].class));
- * }
- * }
- */
- public static Result> toList(Response response) {
- return toList(response, Function.identity());
- }
-
- public static Result> toList(Response response, Function super T, ? extends R> mapper) {
- List mapped = Optional.ofNullable(response.getBody())
- .map(Arrays::asList).orElse(new ArrayList<>())
- .stream().map(mapper).collect(Collectors.toList());
- return new Result<>(response, mapped);
- }
-
- /**
- * Convert {@code T[]} response to a {@code List} response.
- * This is handy for all request handlers which returns lists,
- * as the current client does not support deserializing into a parametrized
- * {@code List.class}.
- *
- *
- * Usage:
- *
- *
{@code @Override
- * public Future> run(FutureCallback> callback) {
- * return sendGetRequest("/names", callback, Result.toListParser(String[].class));
- * }
- * }
- */
- public static ResponseParser> toListParser(Class cls) {
- return new ResponseParser>() {
-
- @Override
- public Result> parse(HttpResponse response, String body, ContentType contentType) {
- Response resp = this.serializer.toResponse(response.getCode(), body, cls);
- return Result.toList(resp);
- }
- };
- }
-
- /**
- * Convert {@code Result} response to a {@code Result}.
- * The result contains true if status code is in 100-299 range.
- *
- * @param response Response from a call that does not return a value, like
- * {@link BaseClient#sendDeleteRequest}.
- * @return {@code Result}
- */
- public static Result voidToBoolean(Response response) {
- int status = response.getStatusCode();
- return new Result<>(status, status <= 299, response.getErrors());
- }
-
- /**
- * Convert {@code Result} response to a {@code Result}.
- * The result contains true if status code is in 100-299 range or is one of the
- * allowed codes (e.g. HTTP 409 is used when the request has no effect, because
- * a previous one has already succeeded).
- *
- * @param allowCodes Avoid treating these error codes as an error
- * and only return false.
- *
- * @param response Response from a call that does not return a value, like
- * {@link BaseClient#sendDeleteRequest}.
- * @return {@code Result}
- */
- public static Result voidToBoolean(Response response, int... allowCodes) {
- Integer status = response.getStatusCode();
- boolean isCodeAllowed = Arrays.stream(allowCodes).anyMatch(status::equals);
- if (status <= 299) {
- return new Result<>(status, true, null);
- }
- return new Result<>(status, false, isCodeAllowed ? null : response.getErrors());
- }
-
- /**
- * Get a custom parser to convert {@code Result} response as to a
- * {@code Result}. The result contains true if status code is 200.
- *
- * @return {@code Result}
- */
- public static ResponseParser voidToBooleanParser() {
- return new ResponseParser() {
- @Override
- public Result parse(HttpResponse response, String body, ContentType contentType) {
- Response resp = this.serializer.toResponse(response.getCode(), body, Void.class);
- return voidToBoolean(resp);
- }
- };
- }
-
- /**
- * Get a custom parser to convert {@code Result} response as to a
- * {@code Result}. The result contains true if status code is 200.
- *
- * @param allowCodes Avoid treating these error codes as an error
- * and only return false.
- *
- * @return {@code Result}
- */
- public static ResponseParser voidToBooleanParser(int... allowCodes) {
- return new ResponseParser() {
- @Override
- public Result parse(HttpResponse response, String body, ContentType contentType) {
- Response resp = this.serializer.toResponse(response.getCode(), body, Void.class);
- return voidToBoolean(resp, allowCodes);
- }
- };
- }
-
- public static ResponseParser> arrayToListParser(Class cls) {
- return arrayToListParser(cls, Function.identity());
- }
-
- public static ResponseParser> arrayToListParser(Class cls,
- Function super T, ? extends R> mapper) {
- return new ResponseParser>() {
- @Override
- public Result> parse(HttpResponse response, String body, ContentType contentType) {
- Response resp = this.serializer.toResponse(response.getCode(), body, cls);
- List mapped = Optional.ofNullable(resp.getBody())
- .map(Arrays::asList).orElse(new ArrayList<>())
- .stream().map(mapper).collect(Collectors.toList());
- return new Result<>(resp.getStatusCode(), mapped, resp.getErrors());
- }
- };
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/Serializer.java b/src/main/java/io/weaviate/client/base/Serializer.java
deleted file mode 100644
index 2469d0ef7..000000000
--- a/src/main/java/io/weaviate/client/base/Serializer.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package io.weaviate.client.base;
-
-import java.lang.reflect.Type;
-
-import com.google.gson.Gson;
-import com.google.gson.GsonBuilder;
-import com.google.gson.reflect.TypeToken;
-
-import io.weaviate.client.base.util.GroupHitDeserializer;
-import io.weaviate.client.v1.data.model.WeaviateObject;
-import io.weaviate.client.v1.graphql.model.GraphQLGetBaseObject;
-import io.weaviate.client.v1.graphql.model.GraphQLTypedResponse;
-
-public class Serializer {
- private Gson gson;
-
- public Serializer() {
- this.gson = new GsonBuilder()
- .disableHtmlEscaping()
- .registerTypeAdapter(WeaviateObject.class, WeaviateObject.Adapter.INSTANCE)
- .create();
- }
-
- public GraphQLTypedResponse toGraphQLTypedResponse(String response, Class classOfT) {
- Gson gsonTyped = new GsonBuilder()
- .disableHtmlEscaping()
- .registerTypeAdapter(GraphQLGetBaseObject.Additional.Group.GroupHit.class, new GroupHitDeserializer())
- .create();
- return gsonTyped.fromJson(response,
- TypeToken.getParameterized(GraphQLTypedResponse.class, classOfT).getType());
- }
-
- public C toResponse(String response, Type typeOfT) {
- return gson.fromJson(response, typeOfT);
- }
-
- public T toResponse(String response, Class classOfT) {
- return gson.fromJson(response, classOfT);
- }
-
- public String toJsonString(Object object) {
- return (object != null) ? gson.toJson(object) : null;
- }
-
- public Result toResult(int statusCode, String body, Class classOfT) {
- if (statusCode < 399) {
- return new Result<>(toResponse(statusCode, body, classOfT));
- }
- return new Result<>(statusCode, null, toWeaviateError(body));
- }
-
- public Response toResponse(int statusCode, String body, Class classOfT) {
- if (statusCode < 399) {
- T obj = toResponse(body, classOfT);
- return new Response<>(statusCode, obj, null);
- }
- return new Response<>(statusCode, null, toWeaviateError(body));
- }
-
- public Response> toGraphQLTypedResponse(int statusCode, String body, Class classOfC) {
- if (statusCode < 399) {
- GraphQLTypedResponse obj = toGraphQLTypedResponse(body, classOfC);
- return new Response<>(statusCode, obj, null);
- }
- return new Response<>(statusCode, null, toWeaviateError(body));
- }
-
- public Result> toGraphQLTypedResult(int statusCode, String body, Class classOfC) {
- if (statusCode < 399) {
- return new Result<>(toGraphQLTypedResponse(statusCode, body, classOfC));
- }
- return new Result<>(statusCode, null, toWeaviateError(body));
- }
-
- public WeaviateErrorResponse toWeaviateError(String body) {
- return toResponse(body, WeaviateErrorResponse.class);
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/WeaviateError.java b/src/main/java/io/weaviate/client/base/WeaviateError.java
deleted file mode 100644
index b05cdb2e6..000000000
--- a/src/main/java/io/weaviate/client/base/WeaviateError.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package io.weaviate.client.base;
-
-import java.util.List;
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.ToString;
-import lombok.experimental.FieldDefaults;
-
-@Getter
-@AllArgsConstructor
-@ToString
-@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
-public class WeaviateError {
- int statusCode;
- List messages;
-}
diff --git a/src/main/java/io/weaviate/client/base/WeaviateErrorMessage.java b/src/main/java/io/weaviate/client/base/WeaviateErrorMessage.java
deleted file mode 100644
index bcf92bfba..000000000
--- a/src/main/java/io/weaviate/client/base/WeaviateErrorMessage.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package io.weaviate.client.base;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.ToString;
-import lombok.experimental.FieldDefaults;
-
-@Getter
-@Builder
-@ToString
-@AllArgsConstructor(access = AccessLevel.PUBLIC)
-@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
-public class WeaviateErrorMessage {
- String message;
- transient Throwable throwable; // transient = not serialized by gson. This field is only used on Java.
-}
diff --git a/src/main/java/io/weaviate/client/base/WeaviateErrorResponse.java b/src/main/java/io/weaviate/client/base/WeaviateErrorResponse.java
deleted file mode 100644
index e5fd62c1e..000000000
--- a/src/main/java/io/weaviate/client/base/WeaviateErrorResponse.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package io.weaviate.client.base;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import lombok.AccessLevel;
-import lombok.Builder;
-import lombok.Getter;
-import lombok.ToString;
-import lombok.experimental.FieldDefaults;
-
-@Getter
-@Builder
-@ToString
-@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
-public class WeaviateErrorResponse {
- Integer code;
- String message;
-
- @Builder.Default
- List error = new ArrayList<>();
-}
diff --git a/src/main/java/io/weaviate/client/base/grpc/AsyncGrpcClient.java b/src/main/java/io/weaviate/client/base/grpc/AsyncGrpcClient.java
deleted file mode 100644
index 5c2636b85..000000000
--- a/src/main/java/io/weaviate/client/base/grpc/AsyncGrpcClient.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package io.weaviate.client.base.grpc;
-
-import com.google.common.util.concurrent.ListenableFuture;
-import io.grpc.ManagedChannel;
-import io.grpc.Metadata;
-import io.grpc.stub.MetadataUtils;
-import io.weaviate.client.Config;
-import io.weaviate.client.base.grpc.base.BaseGrpcClient;
-import io.weaviate.client.grpc.protocol.v1.WeaviateGrpc;
-import io.weaviate.client.grpc.protocol.v1.WeaviateProtoBatch;
-import io.weaviate.client.v1.auth.provider.AccessTokenProvider;
-import lombok.AccessLevel;
-import lombok.experimental.FieldDefaults;
-
-@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
-public class AsyncGrpcClient extends BaseGrpcClient {
- WeaviateGrpc.WeaviateFutureStub client;
- ManagedChannel channel;
-
- private AsyncGrpcClient(WeaviateGrpc.WeaviateFutureStub client, ManagedChannel channel) {
- this.client = client;
- this.channel = channel;
- }
-
- public ListenableFuture batchObjects(WeaviateProtoBatch.BatchObjectsRequest request) {
- return this.client.batchObjects(request);
- }
-
- public void shutdown() {
- this.channel.shutdown();
- }
-
- public static AsyncGrpcClient create(Config config, AccessTokenProvider tokenProvider) {
- Metadata headers = getHeaders(config, tokenProvider);
- ManagedChannel channel = buildChannel(config);
- WeaviateGrpc.WeaviateFutureStub stub = WeaviateGrpc.newFutureStub(channel);
- WeaviateGrpc.WeaviateFutureStub client = stub.withInterceptors(MetadataUtils.newAttachHeadersInterceptor(headers));
- return new AsyncGrpcClient(client, channel);
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/grpc/GrpcClient.java b/src/main/java/io/weaviate/client/base/grpc/GrpcClient.java
deleted file mode 100644
index 003a5136f..000000000
--- a/src/main/java/io/weaviate/client/base/grpc/GrpcClient.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package io.weaviate.client.base.grpc;
-
-import io.grpc.ManagedChannel;
-import io.grpc.Metadata;
-import io.grpc.stub.MetadataUtils;
-import io.weaviate.client.Config;
-import io.weaviate.client.base.grpc.base.BaseGrpcClient;
-import io.weaviate.client.grpc.protocol.v1.WeaviateGrpc;
-import io.weaviate.client.grpc.protocol.v1.WeaviateProtoBatch;
-import io.weaviate.client.grpc.protocol.v1.WeaviateProtoSearchGet;
-import io.weaviate.client.v1.auth.provider.AccessTokenProvider;
-import lombok.AccessLevel;
-import lombok.experimental.FieldDefaults;
-
-@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
-public class GrpcClient extends BaseGrpcClient {
- WeaviateGrpc.WeaviateBlockingStub client;
- ManagedChannel channel;
-
- private GrpcClient(WeaviateGrpc.WeaviateBlockingStub client, ManagedChannel channel) {
- this.client = client;
- this.channel = channel;
- }
-
- public WeaviateProtoBatch.BatchObjectsReply batchObjects(WeaviateProtoBatch.BatchObjectsRequest request) {
- return this.client.batchObjects(request);
- }
-
- public WeaviateProtoSearchGet.SearchReply search(WeaviateProtoSearchGet.SearchRequest request) {
- return this.client.search(request);
- }
-
- public void shutdown() {
- this.channel.shutdown();
- }
-
- public static GrpcClient create(Config config, AccessTokenProvider tokenProvider) {
- Metadata headers = getHeaders(config, tokenProvider);
- ManagedChannel channel = buildChannel(config);
- WeaviateGrpc.WeaviateBlockingStub blockingStub = WeaviateGrpc.newBlockingStub(channel);
- WeaviateGrpc.WeaviateBlockingStub client = blockingStub
- .withInterceptors(MetadataUtils.newAttachHeadersInterceptor(headers));
- return new GrpcClient(client, channel);
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/grpc/base/BaseGrpcClient.java b/src/main/java/io/weaviate/client/base/grpc/base/BaseGrpcClient.java
deleted file mode 100644
index b659711b6..000000000
--- a/src/main/java/io/weaviate/client/base/grpc/base/BaseGrpcClient.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package io.weaviate.client.base.grpc.base;
-
-import io.grpc.ManagedChannel;
-import io.grpc.ManagedChannelBuilder;
-import io.grpc.Metadata;
-import io.weaviate.client.Config;
-import io.weaviate.client.v1.auth.provider.AccessTokenProvider;
-import java.util.Map;
-
-public class BaseGrpcClient {
-
- protected static Metadata getHeaders(Config config, AccessTokenProvider tokenProvider) {
- Metadata headers = new Metadata();
- if (config.getHeaders() != null) {
- for (Map.Entry e : config.getHeaders().entrySet()) {
- headers.put(Metadata.Key.of(e.getKey(), Metadata.ASCII_STRING_MARSHALLER), e.getValue());
- }
- }
- if (tokenProvider != null) {
- headers.put(Metadata.Key.of("Authorization", Metadata.ASCII_STRING_MARSHALLER), String.format("Bearer %s", tokenProvider.getAccessToken()));
- }
- return headers;
- }
-
- protected static ManagedChannel buildChannel(Config config) {
- ManagedChannelBuilder> channelBuilder = ManagedChannelBuilder.forTarget(getAddress(config));
- if (config.isGRPCSecured()) {
- channelBuilder = channelBuilder.useTransportSecurity();
- } else {
- channelBuilder.usePlaintext();
- }
- return channelBuilder.build();
- }
-
- private static String getAddress(Config config) {
- if (config.getGRPCHost() != null) {
- String host = config.getGRPCHost();
- if (host.contains(":")) {
- return host;
- }
- if (config.isGRPCSecured()) {
- return String.format("%s:443", host);
- }
- return String.format("%s:80", host);
- }
- return "";
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/http/HttpClient.java b/src/main/java/io/weaviate/client/base/http/HttpClient.java
deleted file mode 100644
index 38d5561da..000000000
--- a/src/main/java/io/weaviate/client/base/http/HttpClient.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package io.weaviate.client.base.http;
-
-public interface HttpClient {
- HttpResponse sendGetRequest(String url) throws Exception;
- HttpResponse sendPostRequest(String url, String json) throws Exception;
- HttpResponse sendPutRequest(String url, String json) throws Exception;
- HttpResponse sendPatchRequest(String url, String json) throws Exception;
- HttpResponse sendDeleteRequest(String url, String json) throws Exception;
- HttpResponse sendHeadRequest(String url) throws Exception;
-}
diff --git a/src/main/java/io/weaviate/client/base/http/HttpResponse.java b/src/main/java/io/weaviate/client/base/http/HttpResponse.java
deleted file mode 100644
index 09afe4e15..000000000
--- a/src/main/java/io/weaviate/client/base/http/HttpResponse.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package io.weaviate.client.base.http;
-
-import lombok.AccessLevel;
-import lombok.AllArgsConstructor;
-import lombok.Getter;
-import lombok.experimental.FieldDefaults;
-
-@Getter
-@AllArgsConstructor
-@FieldDefaults(makeFinal = true, level = AccessLevel.PRIVATE)
-public class HttpResponse {
- int statusCode;
- String body;
-}
diff --git a/src/main/java/io/weaviate/client/base/http/async/AsyncHttpClient.java b/src/main/java/io/weaviate/client/base/http/async/AsyncHttpClient.java
deleted file mode 100644
index 01392b479..000000000
--- a/src/main/java/io/weaviate/client/base/http/async/AsyncHttpClient.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package io.weaviate.client.base.http.async;
-
-import io.weaviate.client.Config;
-import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
-import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
-import org.apache.hc.core5.reactor.IOReactorConfig;
-import org.apache.hc.core5.util.Timeout;
-
-public class AsyncHttpClient {
-
- public static CloseableHttpAsyncClient create(Config config) {
- IOReactorConfig ioReactorConfig = IOReactorConfig.custom()
- .setSoTimeout(Timeout.ofSeconds(config.getSocketTimeout()))
- .build();
-
- return HttpAsyncClients.custom()
- .setIOReactorConfig(ioReactorConfig)
- .build();
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/http/async/ResponseParser.java b/src/main/java/io/weaviate/client/base/http/async/ResponseParser.java
deleted file mode 100644
index 878da54c3..000000000
--- a/src/main/java/io/weaviate/client/base/http/async/ResponseParser.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package io.weaviate.client.base.http.async;
-
-import io.weaviate.client.base.Result;
-import io.weaviate.client.base.Serializer;
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.HttpResponse;
-
-public abstract class ResponseParser {
- protected final Serializer serializer;
-
- public ResponseParser() {
- this.serializer = new Serializer();
- }
-
- public abstract Result parse(HttpResponse response, String body, ContentType contentType);
-}
diff --git a/src/main/java/io/weaviate/client/base/http/async/WeaviateGraphQLTypedResponseConsumer.java b/src/main/java/io/weaviate/client/base/http/async/WeaviateGraphQLTypedResponseConsumer.java
deleted file mode 100644
index 5de7a8f28..000000000
--- a/src/main/java/io/weaviate/client/base/http/async/WeaviateGraphQLTypedResponseConsumer.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package io.weaviate.client.base.http.async;
-
-import io.weaviate.client.base.Result;
-import io.weaviate.client.base.Serializer;
-import io.weaviate.client.v1.graphql.model.GraphQLTypedResponse;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.HttpException;
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.nio.entity.BasicAsyncEntityConsumer;
-import org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer;
-import org.apache.hc.core5.http.protocol.HttpContext;
-
-public class WeaviateGraphQLTypedResponseConsumer extends AbstractAsyncResponseConsumer>, byte[]> {
- private final Serializer serializer;
- private final Class classOfT;
-
- public WeaviateGraphQLTypedResponseConsumer(Class classOfT) {
- super(new BasicAsyncEntityConsumer());
- this.serializer = new Serializer();
- this.classOfT = classOfT;
- }
-
- @Override
- protected Result> buildResult(HttpResponse response, byte[] entity, ContentType contentType) {
- String body = (entity != null) ? new String(entity, StandardCharsets.UTF_8) : "";
- return serializer.toGraphQLTypedResult(response.getCode(), body, classOfT);
- }
-
- @Override
- public void informationResponse(HttpResponse response, HttpContext context) throws HttpException, IOException {
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/http/async/WeaviateResponseConsumer.java b/src/main/java/io/weaviate/client/base/http/async/WeaviateResponseConsumer.java
deleted file mode 100644
index 652c8682c..000000000
--- a/src/main/java/io/weaviate/client/base/http/async/WeaviateResponseConsumer.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package io.weaviate.client.base.http.async;
-
-import io.weaviate.client.base.Result;
-import io.weaviate.client.base.Serializer;
-import java.io.IOException;
-import java.nio.charset.StandardCharsets;
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.HttpException;
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.nio.entity.BasicAsyncEntityConsumer;
-import org.apache.hc.core5.http.nio.support.AbstractAsyncResponseConsumer;
-import org.apache.hc.core5.http.protocol.HttpContext;
-
-public class WeaviateResponseConsumer extends AbstractAsyncResponseConsumer, byte[]> {
- private final Serializer serializer;
- private final Class classOfT;
- private final ResponseParser parser;
-
- public WeaviateResponseConsumer(Class classOfT, ResponseParser parser) {
- super(new BasicAsyncEntityConsumer());
- this.serializer = new Serializer();
- this.classOfT = classOfT;
- this.parser = parser;
- }
-
- @Override
- protected Result buildResult(HttpResponse response, byte[] entity, ContentType contentType) {
- String body = (entity != null) ? new String(entity, StandardCharsets.UTF_8) : "";
- if (this.parser != null) {
- return this.parser.parse(response, body, contentType);
- }
- return serializer.toResult(response.getCode(), body, classOfT);
- }
-
- @Override
- public void informationResponse(HttpResponse response, HttpContext context) throws HttpException, IOException {
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/http/builder/HttpApacheClientBuilder.java b/src/main/java/io/weaviate/client/base/http/builder/HttpApacheClientBuilder.java
deleted file mode 100644
index 377982717..000000000
--- a/src/main/java/io/weaviate/client/base/http/builder/HttpApacheClientBuilder.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package io.weaviate.client.base.http.builder;
-
-import io.weaviate.client.Config;
-import io.weaviate.client.base.http.impl.CommonsHttpClientImpl;
-import java.util.concurrent.TimeUnit;
-import org.apache.hc.client5.http.config.RequestConfig;
-import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
-import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.util.Timeout;
-
-public class HttpApacheClientBuilder {
-
- private HttpApacheClientBuilder() {}
-
- public static CommonsHttpClientImpl.CloseableHttpClientBuilder build(Config config) {
- RequestConfig.Builder requestConfigBuilder = RequestConfig.custom()
- .setConnectTimeout(Timeout.of(config.getConnectionTimeout(), TimeUnit.SECONDS))
- .setConnectionRequestTimeout(Timeout.of(config.getConnectionRequestTimeout(), TimeUnit.SECONDS))
- .setResponseTimeout(Timeout.of(config.getSocketTimeout(), TimeUnit.SECONDS));
-
- if (config.getProxyHost() != null) {
- requestConfigBuilder.setProxy(new HttpHost(config.getProxyScheme(), config.getProxyHost(), config.getProxyPort()));
- }
-
- RequestConfig requestConfig = requestConfigBuilder.build();
- return HttpClientBuilder.create().setDefaultRequestConfig(requestConfig)::build;
- }
-}
diff --git a/src/main/java/io/weaviate/client/base/http/impl/CommonsHttpClientImpl.java b/src/main/java/io/weaviate/client/base/http/impl/CommonsHttpClientImpl.java
deleted file mode 100644
index 957bb5e2b..000000000
--- a/src/main/java/io/weaviate/client/base/http/impl/CommonsHttpClientImpl.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package io.weaviate.client.base.http.impl;
-
-import java.io.Closeable;
-import java.io.IOException;
-import java.net.URI;
-import java.nio.charset.StandardCharsets;
-import java.util.Map;
-
-import org.apache.hc.client5.http.classic.methods.HttpDelete;
-import org.apache.hc.client5.http.classic.methods.HttpGet;
-import org.apache.hc.client5.http.classic.methods.HttpHead;
-import org.apache.hc.client5.http.classic.methods.HttpPatch;
-import org.apache.hc.client5.http.classic.methods.HttpPost;
-import org.apache.hc.client5.http.classic.methods.HttpPut;
-import org.apache.hc.client5.http.classic.methods.HttpUriRequestBase;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.apache.hc.core5.http.HttpHeaders;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
-import org.apache.hc.core5.http.io.entity.StringEntity;
-import org.apache.hc.core5.http.message.BasicClassicHttpRequest;
-
-import io.weaviate.client.base.http.HttpClient;
-import io.weaviate.client.base.http.HttpResponse;
-import io.weaviate.client.v1.auth.provider.AccessTokenProvider;
-
-public class CommonsHttpClientImpl implements HttpClient, Closeable {
- private final Map headers;
- private AccessTokenProvider tokenProvider;
- private final CloseableHttpClientBuilder clientBuilder;
-
- public CommonsHttpClientImpl(Map headers, CloseableHttpClientBuilder clientBuilder) {
- this(headers, null, clientBuilder);
- }
-
- public CommonsHttpClientImpl(Map