Interface ApiInvocation<T>

Type Parameters:
T - Type of the response.
All Known Implementing Classes:
DefaultApiInvocation

@Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator") public interface ApiInvocation<T>
Wraps a prepared API request call and provides different styles of executing the request, both synchronously and asynchronously. Which style you should use depends on your needs and also the potential restrictions of the underlying HTTP client.
  • Method Summary

    Modifier and Type
    Method
    Description
    Invokes the request asynchronously via the AsyncInvoker, without a callback.
    async(javax.ws.rs.client.InvocationCallback<ApiResponse<T>> invocationCallback)
    Invokes the request asynchronously via the AsyncInvoker, with a callback.
    Invokes the request synchronously via Invocation.invoke().
    rx()
    Invokes the request asynchronously via the CompletionStageRxInvoker.
  • Method Details

    • async

      Future<ApiResponse<T>> async()
      Invokes the request asynchronously via the AsyncInvoker, without a callback.
      Returns:
      A future for the result obtained from the response.
      See Also:
      • Invocation.submit()
    • async

      Future<ApiResponse<T>> async(javax.ws.rs.client.InvocationCallback<ApiResponse<T>> invocationCallback)
      Invokes the request asynchronously via the AsyncInvoker, with a callback. Note: You can use the future to wait until the request finishes, but you should not access the response via the future -- use the callback to access the response.
      Parameters:
      invocationCallback - Callback which is invoked with the result of the response.
      Returns:
      A future for the result obtained from the response.
      See Also:
      • Invocation.submit(InvocationCallback)
    • invoke

      ApiResponse<T> invoke() throws ApiException
      Invokes the request synchronously via Invocation.invoke().
      Returns:
      The result obtained from the response.
      Throws:
      ApiException - When the request could not be executed, e.g. when the server could not be reached or the server sent an invalid response. 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.
      See Also:
      • Invocation.invoke()
    • rx

      Invokes the request asynchronously via the CompletionStageRxInvoker.
      Returns:
      A pending stage for the result obtained from the response