Interface WebRouteInterceptor<A extends ExchangeContext>
- Type Parameters:
A
- the exchange context type
- All Known Subinterfaces:
WebClient<A>
,WebClient.Intercepted<A>
Entry point for configuring the Web exchange interceptors to apply when processing Web exchange in an intercepted Web client.
It is implemented by the WebClient
. Interceptors are defined using a WebRouteInterceptorManager
which allows to specify the criteria a Web exchange to be intercepted by an
exchange interceptor.
When defining an interceptor on a Web client, a new intercepted Web client instance shall be created containing the interceptor definition. It can then be used to define more interceptors resulting in the creation of hierarchies of intercepted Web clients with different interceptor definitions with the root Web client at the top.
Web exchanges that are expected to be intercepted must then be processed by the intercepted Web client chain containing the desired interceptor definitions.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
A configurer used to configure Web route interceptors in a Web client. -
Method Summary
Modifier and TypeMethodDescriptionconfigureInterceptors
(WebRouteInterceptor.Configurer<? super A> configurer) Configures multiple Web route interceptors.configureInterceptors
(List<WebRouteInterceptor.Configurer<? super A>> configurers) Configures multiple Web route interceptors.WebRouteInterceptorManager
<A, ? extends WebRouteInterceptor<A>> Returns a new interceptor manager for defining a Web route interceptor.default WebRouteInterceptor
<A> intercept
(Function<WebRouteInterceptorManager<A, ? extends WebRouteInterceptor<A>>, ? extends WebRouteInterceptor<A>> configurer) Configures a Web route interceptor.
-
Method Details
-
intercept
WebRouteInterceptorManager<A,? extends WebRouteInterceptor<A>> intercept()Returns a new interceptor manager for defining a Web route interceptor.
- Returns:
- a new Web route interceptor manager
-
intercept
default WebRouteInterceptor<A> intercept(Function<WebRouteInterceptorManager<A, ? extends WebRouteInterceptor<A>>, ? extends WebRouteInterceptor<A>> configurer) Configures a Web route interceptor.
The result returned by the specified configurer function must be the Web route interceptor returned by the input interceptor manager after defining the interceptor and which contains the configured interceptor. If that requirement is not met, invoking this method will most likely result in a no-op operation since the resulting intercepted Web client instance would be lost.
- Parameters:
configurer
- a Web route interceptor configurer function- Returns:
- the Web route interceptor containing the configured interceptor
-
configureInterceptors
Configures multiple Web route interceptors.
- Parameters:
configurer
- a Web route interceptor configurer- Returns:
- the Web route interceptor containing the configured interceptors
-
configureInterceptors
WebRouteInterceptor<A> configureInterceptors(List<WebRouteInterceptor.Configurer<? super A>> configurers) Configures multiple Web route interceptors.
- Parameters:
configurers
- a list of Web route interceptor configurers- Returns:
- the Web route interceptor containing the configured interceptors
-