Class HttpTransport


  • public class HttpTransport
    extends Object
    The transport layer is responsible of the serialization/deserialization and 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 endpoint
        callType - The Algolia call type of the request : read or write
        returnClass - The type that will be returned
        requestOptions - Requests options to add to the request (if so)
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an error
        AlgoliaRuntimeException - 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 result
        TData - 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 endpoint
        callType - The Algolia call type of the request : read or write
        data - The data to send if any
        returnClazz - The type that will be returned
        requestOptions - Requests options to add to the request (if so)
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an error
        AlgoliaRuntimeException - 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 result
        TInnerResult - The type of the nested class
        TData - 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 endpoint
        callType - The Algolia call type of the request : read or write
        data - The data to send if any
        returnClazz - The type that will be returned
        requestOptions - Requests options to add to the request (if so)
        Throws:
        AlgoliaRetryException - When the retry has failed on all hosts
        AlgoliaApiException - When the API sends an error
        AlgoliaRuntimeException - When an error occurred during the serialization.