Class BaseController

    • Field Detail

      • config

        protected final Configuration config
        Protected variables to hold an instance of Configuration.
      • httpCallback

        protected final HttpCallback httpCallback
        Protected variable to hold an instance of HttpCallback if the user provides it.
    • Method Detail

      • getHttpCallback

        public HttpCallback getHttpCallback()
        Get httpCallback associated with this controller.
        Returns:
        HttpCallback
      • getClientInstance

        public HttpClient getClientInstance()
        Shared instance of the Http client.
        Returns:
        The shared instance of the http client
      • validateResponse

        protected void validateResponse​(HttpResponse response,
                                        HttpContext context)
                                 throws ApiException
        Validates the response against HTTP errors defined at the API level.
        Parameters:
        response - The response recieved
        context - Context of the request and the recieved response
        Throws:
        ApiException - Represents error response from the server.
      • makeHttpCallAsync

        public <T> CompletableFuture<ApiResponse<T>> makeHttpCallAsync​(BaseController.RequestSupplier requestSupplier,
                                                                       BaseController.RequestExecutor requestExecutor,
                                                                       BaseController.ResponseHandler<T> responseHandler)
        Make an asynchronous HTTP endpoint call.
        Type Parameters:
        T - The type of the object for response
        Parameters:
        requestSupplier - An object of RequestSupplier to supply an instance of HttpRequest
        requestExecutor - An object of RequestExecutor to execute the given request
        responseHandler - An object of ResponseHandler to handle the endpoint response
        Returns:
        An object of type CompletableFuture of T