@FunctionalInterface public interface ExchangeFilterFunction
The filter is executed when a Subscriber
subscribes to the
Publisher
returned by the WebClient
.
Modifier and Type | Method and Description |
---|---|
default ExchangeFilterFunction |
andThen(ExchangeFilterFunction afterFilter)
Return a composed filter function that first applies this filter, and
then applies the given
"after" filter. |
default ExchangeFunction |
apply(ExchangeFunction exchange)
Apply this filter to the given ExchangeFunction, resulting
in a filtered exchange function.
|
reactor.core.publisher.Mono<ClientResponse> |
filter(ClientRequest request,
ExchangeFunction next)
Apply this filter to the given request and exchange function.
|
static ExchangeFilterFunction |
ofRequestProcessor(Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
Adapt the given request processor function to a filter function that only
operates on the
ClientRequest . |
static ExchangeFilterFunction |
ofResponseProcessor(Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
Adapt the given response processor function to a filter function that
only operates on the
ClientResponse . |
reactor.core.publisher.Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next)
The given ExchangeFunction represents the next entity in the chain, to be invoked via invoked in order to proceed with the exchange, or not invoked to shortcut the chain.
request
- the current requestnext
- the next exchange function in the chaindefault ExchangeFilterFunction andThen(ExchangeFilterFunction afterFilter)
"after"
filter.afterFilter
- the filter to apply after this filterdefault ExchangeFunction apply(ExchangeFunction exchange)
exchange
- the exchange function to filterstatic ExchangeFilterFunction ofRequestProcessor(Function<ClientRequest,reactor.core.publisher.Mono<ClientRequest>> processor)
ClientRequest
.processor
- the request processorstatic ExchangeFilterFunction ofResponseProcessor(Function<ClientResponse,reactor.core.publisher.Mono<ClientResponse>> processor)
ClientResponse
.processor
- the response processor