Interface ApiCallInterceptor
@Generated("de.xima.openapi.codegen.java_jaxrs.XimaJavaJaxrsGenerator")
public interface ApiCallInterceptor
An interceptor that can be used to react to and modify calls to REST API endpoints. All
methods are optonal and have a no-op default implementation.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ApiCallInterceptorcombined(ApiCallInterceptor... interceptors) static ApiCallInterceptorcombined(Iterable<ApiCallInterceptor> interceptors) default voidonBeginApiCall(ApiCall<?> call) When an API call is about to begin, before it was processed in any way.default Optional<javax.ws.rs.client.Entity<?>> onEntitySerialized(ApiCall<?> call, javax.ws.rs.client.Entity<?> entity) When theEntitywas created from the data of the API call.default Optional<javax.ws.rs.client.Invocation.Builder> onInvocationBuilderConfigured(ApiCall<?> call, javax.ws.rs.client.Invocation.Builder builder) When theInvocation.Builderwas created and configured with the data of the API call.default Optional<javax.ws.rs.client.WebTarget> onWebTargetConfigured(ApiCall<?> call, javax.ws.rs.client.WebTarget target) When theWebTargetwas created and configured with the data of the API call.
-
Method Details
-
onBeginApiCall
When an API call is about to begin, before it was processed in any way.- Parameters:
call- The current API call.
-
onWebTargetConfigured
default Optional<javax.ws.rs.client.WebTarget> onWebTargetConfigured(ApiCall<?> call, javax.ws.rs.client.WebTarget target) When theWebTargetwas created and configured with the data of the API call.- Parameters:
call- The current API call.target- The created web target.- Returns:
- When not empty, a replacement for the web target to use.
-
onInvocationBuilderConfigured
default Optional<javax.ws.rs.client.Invocation.Builder> onInvocationBuilderConfigured(ApiCall<?> call, javax.ws.rs.client.Invocation.Builder builder) When theInvocation.Builderwas created and configured with the data of the API call.- Parameters:
call- The current API call.builder- The created invocation builder.- Returns:
- When not empty, a replacement for the invocation builder to use.
-
onEntitySerialized
default Optional<javax.ws.rs.client.Entity<?>> onEntitySerialized(ApiCall<?> call, javax.ws.rs.client.Entity<?> entity) When theEntitywas created from the data of the API call.- Parameters:
call- The current API call.entity- The serialized entity.- Returns:
- When not empty, a replacement for the entity to use.
-
combined
- Parameters:
interceptors- List of interceptors to combine. When an interceptor isnull, it is ignored.- Returns:
- A new interceptor that combines the given interceptors. Each interceptor is invoked in order, starting with the first one.
-
combined
- Parameters:
interceptors- List of interceptors to combine. When an interceptor isnull, it is ignored.- Returns:
- A new interceptor that combines the given interceptors. Each interceptor is invoked in order, starting with the first one.
-