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 Detail

      • onBeginApiCall

        default void onBeginApiCall​(ApiCall<?> call)
        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 the WebTarget was 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 the Invocation.Builder was 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 the Entity was 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

        static ApiCallInterceptor combined​(ApiCallInterceptor... interceptors)
        Parameters:
        interceptors - List of interceptors to combine. When an interceptor is null, it is ignored.
        Returns:
        A new interceptor that combines the given interceptors. Each interceptor is invoked in order, starting with the first one.
      • combined

        static ApiCallInterceptor combined​(Iterable<ApiCallInterceptor> interceptors)
        Parameters:
        interceptors - List of interceptors to combine. When an interceptor is null, it is ignored.
        Returns:
        A new interceptor that combines the given interceptors. Each interceptor is invoked in order, starting with the first one.