Package com.algolia.search
Class HttpTransport
- java.lang.Object
-
- com.algolia.search.HttpTransport
-
public class HttpTransport extends Object
The transport layer is responsible of the serialization/deserialization and the retry strategy.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <TResult> CompletableFuture<TResult>executeRequestAsync(HttpMethod method, String path, CallType callType, Class<TResult> returnClass, RequestOptions requestOptions)Executes the request to Algolia asynchronously with the retry strategy.<TResult,TData>
CompletableFuture<TResult>executeRequestAsync(HttpMethod method, String path, CallType callType, TData data, Class<TResult> returnClazz, RequestOptions requestOptions)Executes the request to Algolia asynchronously with the retry strategy.<TResult,TInnerResult,TData>
CompletableFuture<TResult>executeRequestAsync(HttpMethod method, String path, CallType callType, TData data, Class<TResult> returnClazz, Class<TInnerResult> innerClazz, RequestOptions requestOptions)Executes the request to Algolia asynchronously with the retry strategy.
-
-
-
Method Detail
-
executeRequestAsync
public <TResult> CompletableFuture<TResult> executeRequestAsync(@Nonnull HttpMethod method, @Nonnull String path, @Nonnull CallType callType, Class<TResult> returnClass, RequestOptions requestOptions)
Executes the request to Algolia asynchronously with the retry strategy.- Type Parameters:
TResult- The type of the result- Parameters:
method- The http method used for the request (Get,Post,etc.)path- The path of the API endpointcallType- The Algolia call type of the request : read or writereturnClass- The type that will be returnedrequestOptions- Requests options to add to the request (if so)- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an errorAlgoliaRuntimeException- When an error occurred during the serialization.
-
executeRequestAsync
public <TResult,TData> CompletableFuture<TResult> executeRequestAsync(@Nonnull HttpMethod method, @Nonnull String path, @Nonnull CallType callType, TData data, Class<TResult> returnClazz, RequestOptions requestOptions)
Executes the request to Algolia asynchronously with the retry strategy.- Type Parameters:
TResult- The type of the resultTData- The type of the data to send (if so)- Parameters:
method- The http method used for the request (Get,Post,etc.)path- The path of the API endpointcallType- The Algolia call type of the request : read or writedata- The data to send if anyreturnClazz- The type that will be returnedrequestOptions- Requests options to add to the request (if so)- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an errorAlgoliaRuntimeException- When an error occurred during the serialization.
-
executeRequestAsync
public <TResult,TInnerResult,TData> CompletableFuture<TResult> executeRequestAsync(@Nonnull HttpMethod method, @Nonnull String path, @Nonnull CallType callType, TData data, Class<TResult> returnClazz, Class<TInnerResult> innerClazz, RequestOptions requestOptions)
Executes the request to Algolia asynchronously with the retry strategy.- Type Parameters:
TResult- The type of the resultTInnerResult- The type of the nested classTData- The type of the data to send (if so)- Parameters:
method- The http method used for the request (Get,Post,etc.)path- The path of the API endpointcallType- The Algolia call type of the request : read or writedata- The data to send if anyreturnClazz- The type that will be returnedrequestOptions- Requests options to add to the request (if so)- Throws:
AlgoliaRetryException- When the retry has failed on all hostsAlgoliaApiException- When the API sends an errorAlgoliaRuntimeException- When an error occurred during the serialization.
-
-