Class NotFoundWebClientAdapterDecorator
java.lang.Object
org.springframework.web.service.invoker.HttpExchangeAdapterDecorator
org.springframework.web.service.invoker.ReactorHttpExchangeAdapterDecorator
org.springframework.web.reactive.function.client.support.NotFoundWebClientAdapterDecorator
- All Implemented Interfaces:
HttpExchangeAdapter, ReactorHttpExchangeAdapter
HttpExchangeAdapterDecorator that suppresses the
WebClientResponseException.NotFound exception resulting from 404
responses and returns a ResponseEntity with the status set to
HttpStatus.NOT_FOUND status, or an empty
Mono from exchangeForBodyMono(HttpRequestValues, ParameterizedTypeReference).- Since:
- 7.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionVariant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.reactor.core.publisher.Mono<ResponseEntity<Void>> Variant ofReactorHttpExchangeAdapter.exchangeForMono(HttpRequestValues)with additional access to the response status and headers.<T> @Nullable TexchangeForBody(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> reactor.core.publisher.Flux<T> exchangeForBodyFlux(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to a stream with elements of the given type.<T> reactor.core.publisher.Mono<T> exchangeForBodyMono(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> ResponseEntity<T> exchangeForEntity(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Variant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.<T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>> exchangeForEntityFlux(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Variant ofReactorHttpExchangeAdapter.exchangeForBodyFlux(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.<T> reactor.core.publisher.Mono<ResponseEntity<T>> exchangeForEntityMono(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Variant ofReactorHttpExchangeAdapter.exchangeForBodyMono(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.
-
Constructor Details
-
NotFoundWebClientAdapterDecorator
-
-
Method Details
-
exchangeForBody
public <T> @Nullable T exchangeForBody(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpExchangeAdapterPerform the given request and decode the response content to the given type.- Specified by:
exchangeForBodyin interfaceHttpExchangeAdapter- Overrides:
exchangeForBodyin classReactorHttpExchangeAdapterDecorator- Type Parameters:
T- the type the response is decoded to- Parameters:
values- the request to performbodyType- the target type to decode to- Returns:
- the decoded response body.
-
exchangeForBodilessEntity
Description copied from interface:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchange(HttpRequestValues)with additional access to the response status and headers.- Specified by:
exchangeForBodilessEntityin interfaceHttpExchangeAdapter- Overrides:
exchangeForBodilessEntityin classReactorHttpExchangeAdapterDecorator- Returns:
- the response entity with status and headers.
-
exchangeForEntity
public <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Description copied from interface:HttpExchangeAdapterVariant ofHttpExchangeAdapter.exchangeForBody(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
exchangeForEntityin interfaceHttpExchangeAdapter- Overrides:
exchangeForEntityin classReactorHttpExchangeAdapterDecorator- Returns:
- the response entity with status, headers, and body.
-
exchangeForBodyMono
public <T> reactor.core.publisher.Mono<T> exchangeForBodyMono(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Description copied from interface:ReactorHttpExchangeAdapterPerform the given request and decode the response content to the given type.- Specified by:
exchangeForBodyMonoin interfaceReactorHttpExchangeAdapter- Overrides:
exchangeForBodyMonoin classReactorHttpExchangeAdapterDecorator- Type Parameters:
T- the type the response is decoded to- Parameters:
values- the request to performbodyType- the target type to decode to- Returns:
Monothat returns the decoded response.
-
exchangeForBodyFlux
public <T> reactor.core.publisher.Flux<T> exchangeForBodyFlux(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Description copied from interface:ReactorHttpExchangeAdapterPerform the given request and decode the response content to a stream with elements of the given type.- Specified by:
exchangeForBodyFluxin interfaceReactorHttpExchangeAdapter- Overrides:
exchangeForBodyFluxin classReactorHttpExchangeAdapterDecorator- Type Parameters:
T- the type the response is decoded to- Parameters:
values- the request to performbodyType- the target stream element type to decode to- Returns:
Fluxwith decoded stream elements.
-
exchangeForBodilessEntityMono
public reactor.core.publisher.Mono<ResponseEntity<Void>> exchangeForBodilessEntityMono(HttpRequestValues values) Description copied from interface:ReactorHttpExchangeAdapterVariant ofReactorHttpExchangeAdapter.exchangeForMono(HttpRequestValues)with additional access to the response status and headers.- Specified by:
exchangeForBodilessEntityMonoin interfaceReactorHttpExchangeAdapter- Overrides:
exchangeForBodilessEntityMonoin classReactorHttpExchangeAdapterDecorator
-
exchangeForEntityMono
public <T> reactor.core.publisher.Mono<ResponseEntity<T>> exchangeForEntityMono(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Description copied from interface:ReactorHttpExchangeAdapterVariant ofReactorHttpExchangeAdapter.exchangeForBodyMono(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
exchangeForEntityMonoin interfaceReactorHttpExchangeAdapter- Overrides:
exchangeForEntityMonoin classReactorHttpExchangeAdapterDecorator
-
exchangeForEntityFlux
public <T> reactor.core.publisher.Mono<ResponseEntity<reactor.core.publisher.Flux<T>>> exchangeForEntityFlux(HttpRequestValues values, ParameterizedTypeReference<T> bodyType) Description copied from interface:ReactorHttpExchangeAdapterVariant ofReactorHttpExchangeAdapter.exchangeForBodyFlux(HttpRequestValues, ParameterizedTypeReference)with additional access to the response status and headers.- Specified by:
exchangeForEntityFluxin interfaceReactorHttpExchangeAdapter- Overrides:
exchangeForEntityFluxin classReactorHttpExchangeAdapterDecorator
-