public abstract class ExchangeFilterFunctions extends Object
ExchangeFilterFunction
for basic authentication, error handling, etc.Modifier and Type | Class and Description |
---|---|
static class |
ExchangeFilterFunctions.Credentials
Deprecated.
as of Spring 5.1 in favor of using
HttpHeaders.setBasicAuth(String, String) while building the request. |
Modifier and Type | Field and Description |
---|---|
static String |
BASIC_AUTHENTICATION_CREDENTIALS_ATTRIBUTE
Deprecated.
as of Spring 5.1 in favor of using
HttpHeaders.setBasicAuth(String, String) while building the request. |
Constructor and Description |
---|
ExchangeFilterFunctions() |
Modifier and Type | Method and Description |
---|---|
static ExchangeFilterFunction |
basicAuthentication()
Deprecated.
as of Spring 5.1 in favor of using
HttpHeaders.setBasicAuth(String, String) while building the request. |
static ExchangeFilterFunction |
basicAuthentication(String user,
String password)
Return a filter that applies HTTP Basic Authentication to the request
headers via
HttpHeaders.setBasicAuth(String, String) . |
static ExchangeFilterFunction |
limitResponseSize(long maxByteCount)
Consume up to the specified number of bytes from the response body and
cancel if any more data arrives.
|
static ExchangeFilterFunction |
statusError(Predicate<HttpStatus> statusPredicate,
Function<ClientResponse,? extends Throwable> exceptionFunction)
Return a filter that generates an error signal when the given
HttpStatus predicate matches. |
@Deprecated public static final String BASIC_AUTHENTICATION_CREDENTIALS_ATTRIBUTE
HttpHeaders.setBasicAuth(String, String)
while building the request.ExchangeFilterFunctions.Credentials
for basicAuthentication()
.public static ExchangeFilterFunction limitResponseSize(long maxByteCount)
Internally delegates to DataBufferUtils.takeUntilByteCount(org.reactivestreams.Publisher<org.springframework.core.io.buffer.DataBuffer>, long)
.
maxByteCount
- the limit as number of bytespublic static ExchangeFilterFunction statusError(Predicate<HttpStatus> statusPredicate, Function<ClientResponse,? extends Throwable> exceptionFunction)
HttpStatus
predicate matches.statusPredicate
- the predicate to check the HTTP status withexceptionFunction
- the function that to create the exceptionpublic static ExchangeFilterFunction basicAuthentication(String user, String password)
HttpHeaders.setBasicAuth(String, String)
.user
- the userpassword
- the passwordHttpHeaders.setBasicAuth(String, String)
,
HttpHeaders.setBasicAuth(String, String, Charset)
@Deprecated public static ExchangeFilterFunction basicAuthentication()
HttpHeaders.setBasicAuth(String, String)
while building the request.basicAuthentication(String, String)
that looks up
the Credentials
in a
request attribute
.ExchangeFilterFunctions.Credentials