Class DefaultApiClient

  • All Implemented Interfaces:
    ApiClient

    @Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator")
    public final class DefaultApiClient
    extends Object
    implements ApiClient
    The default API client that is responsible for sending REST-like calls to an API endpoint and also takes care of serialization and deserialization.
    • Method Detail

      • httpClient

        public javax.ws.rs.client.Client httpClient()
        Description copied from interface: ApiClient
        Accesses the HTTP client that is used for sending HTTP requests. You can use this if you ever need to send requests manually.
        Specified by:
        httpClient in interface ApiClient
        Returns:
        The HTTP client used by this client.
      • config

        public ApiClientConfig config()
        Description copied from interface: ApiClient
        Accesses the configuration that was used to create this client.
        Specified by:
        config in interface ApiClient
        Returns:
        The configuration used by this client.
      • formatter

        public Formatter formatter()
        Specified by:
        formatter in interface ApiClient
        Returns:
        The formatter instance used by this client.
      • createBundle

        public ApiBundle createBundle()
        Specified by:
        createBundle in interface ApiClient
        Returns:
        A bundle with convenience methods to access the individual APIs.
      • invokeApiAsync

        public <T> Future<ApiResponse<T>> invokeApiAsync​(ApiCall<?> call)
        Description copied from interface: ApiClient
        Invoke an API endpoint by sending an HTTP request with the given options. This method always returns an asynchronous Future. That future may throw an execution exception, but this method never throws an exception directly.
        Specified by:
        invokeApiAsync in interface ApiClient
        Type Parameters:
        T - The expected return type of the request.
        Parameters:
        call - API call to send with the data of the requests.
        Returns:
        A future encapsulating the eventual response with the meta data and the body of the response.
      • invokeApiAsync

        public <T> Future<ApiResponse<T>> invokeApiAsync​(ApiCall<?> call,
                                                         javax.ws.rs.client.InvocationCallback<ApiResponse<T>> invocationCallback)
        Description copied from interface: ApiClient
        Invoke an API endpoint by sending an HTTP request with the given options. This method always returns an asynchronous Future. That future may throw an execution exception, but this method never throws an exception directly. You should not read the result of the future, use the callback instead.
        Specified by:
        invokeApiAsync in interface ApiClient
        Type Parameters:
        T - The expected return type of the request.
        Parameters:
        call - API call to send with the data of the requests.
        invocationCallback - Callback which is invoked when the request finishes.
        Returns:
        A future encapsulating the eventual response with the meta data and the body of the response.
      • invokeApiRx

        public <T> CompletionStage<ApiResponse<T>> invokeApiRx​(ApiCall<?> call)
        Description copied from interface: ApiClient
        Invoke an API endpoint by sending an HTTP request with the given options. This method always returns an asynchronous CompletionStage. That stage may be completed exceptionally, but this method never throws an exception directly.
        Specified by:
        invokeApiRx in interface ApiClient
        Type Parameters:
        T - The expected return type of the request.
        Parameters:
        call - API call to send with the data of the requests.
        Returns:
        A completion stage that resolves with the meta data and the body of the response.
      • invokeApiSync

        public <T> ApiResponse<T> invokeApiSync​(ApiCall<?> call)
                                         throws ApiException
        Description copied from interface: ApiClient
        Invoke an API endpoint by sending an HTTP request with the given options. This method always returns the result synchronously.
        Specified by:
        invokeApiSync in interface ApiClient
        Type Parameters:
        T - The expected return type of the request.
        Parameters:
        call - API call to send with the data of the requests.
        Returns:
        The response with the meta data and the body of the response.
        Throws:
        ApiException - When the request could not be executed. No exception is thrown if the server simply sends a 4xx or 5xx status code and that status code was defined in the API specification.