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 TypeMethodDescriptionasync()Invokes the request asynchronously via theAsyncInvoker, without a callback.async(javax.ws.rs.client.InvocationCallback<ApiResponse<T>> invocationCallback) Invokes the request asynchronously via theAsyncInvoker, with a callback.invoke()Invokes the request synchronously viaInvocation.invoke().rx()Invokes the request asynchronously via theCompletionStageRxInvoker.
-
Method Details
-
async
Future<ApiResponse<T>> async()Invokes the request asynchronously via theAsyncInvoker, without a callback.- Returns:
- A future for the result obtained from the response.
- See Also:
-
async
Future<ApiResponse<T>> async(javax.ws.rs.client.InvocationCallback<ApiResponse<T>> invocationCallback) Invokes the request asynchronously via theAsyncInvoker, 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:
-
invoke
Invokes the request synchronously viaInvocation.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:
-
rx
CompletionStage<ApiResponse<T>> rx()Invokes the request asynchronously via theCompletionStageRxInvoker.- Returns:
- A pending stage for the result obtained from the response
-