Class ReactorHttpExchangeAdapterDecorator
java.lang.Object
org.springframework.web.service.invoker.HttpExchangeAdapterDecorator
org.springframework.web.service.invoker.ReactorHttpExchangeAdapterDecorator
- All Implemented Interfaces:
HttpExchangeAdapter, ReactorHttpExchangeAdapter
- Direct Known Subclasses:
NotFoundWebClientAdapterDecorator
public class ReactorHttpExchangeAdapterDecorator
extends HttpExchangeAdapterDecorator
implements ReactorHttpExchangeAdapter
ReactorHttpExchangeAdapter that wraps and delegates to another adapter instance.- Since:
- 7.0
- Author:
- Rossen Stoyanchev
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexchange(HttpRequestValues requestValues) Perform the given request, and release the response content, if any.exchangeForBodilessEntity(HttpRequestValues requestValues) Variant 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 requestValues, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> reactor.core.publisher.Flux<T> exchangeForBodyFlux(HttpRequestValues requestValues, 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 requestValues, ParameterizedTypeReference<T> bodyType) Perform the given request and decode the response content to the given type.<T> ResponseEntity<T> exchangeForEntity(HttpRequestValues requestValues, 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.exchangeForHeaders(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.reactor.core.publisher.Mono<HttpHeaders> exchangeForHeadersMono(HttpRequestValues requestValues) Perform the given request, release the response content, and return the response headers.reactor.core.publisher.Mono<Void> exchangeForMono(HttpRequestValues requestValues) Perform the given request, and release the response content, if any.Return the configured time to block for the response from an HTTP service method with a synchronous (blocking) method signature.Return the wrapped delegateHttpExchangeAdapter.Return the configuredReactiveAdapterRegistry.booleanWhether the underlying client supports use of request attributes.
-
Constructor Details
-
ReactorHttpExchangeAdapterDecorator
-
-
Method Details
-
getHttpExchangeAdapter
Return the wrapped delegateHttpExchangeAdapter.- Overrides:
getHttpExchangeAdapterin classHttpExchangeAdapterDecorator
-
supportsRequestAttributes
public boolean supportsRequestAttributes()Description copied from interface:HttpExchangeAdapterWhether the underlying client supports use of request attributes.- Specified by:
supportsRequestAttributesin interfaceHttpExchangeAdapter- Overrides:
supportsRequestAttributesin classHttpExchangeAdapterDecorator
-
exchange
Description copied from interface:HttpExchangeAdapterPerform the given request, and release the response content, if any.- Specified by:
exchangein interfaceHttpExchangeAdapter- Overrides:
exchangein classHttpExchangeAdapterDecorator- Parameters:
requestValues- the request to perform
-
exchangeForHeaders
Description copied from interface:HttpExchangeAdapterPerform the given request, release the response content, and return the response headers.- Specified by:
exchangeForHeadersin interfaceHttpExchangeAdapter- Overrides:
exchangeForHeadersin classHttpExchangeAdapterDecorator- Parameters:
requestValues- the request to perform- Returns:
- the response headers
-
exchangeForBody
public <T> @Nullable T exchangeForBody(HttpRequestValues requestValues, 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 classHttpExchangeAdapterDecorator- Type Parameters:
T- the type the response is decoded to- Parameters:
requestValues- 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 classHttpExchangeAdapterDecorator- Returns:
- the response entity with status and headers.
-
exchangeForEntity
public <T> ResponseEntity<T> exchangeForEntity(HttpRequestValues requestValues, 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 classHttpExchangeAdapterDecorator- Returns:
- the response entity with status, headers, and body.
-
getReactiveAdapterRegistry
Description copied from interface:ReactorHttpExchangeAdapterReturn the configuredReactiveAdapterRegistry.- Specified by:
getReactiveAdapterRegistryin interfaceReactorHttpExchangeAdapter
-
getBlockTimeout
Description copied from interface:ReactorHttpExchangeAdapterReturn the configured time to block for the response from an HTTP service method with a synchronous (blocking) method signature.By default, not set in which case the behavior depends on connection and request timeout settings of the underlying HTTP client. We recommend configuring timeout values directly on the underlying HTTP client, which provides more control over such settings.
- Specified by:
getBlockTimeoutin interfaceReactorHttpExchangeAdapter
-
exchangeForMono
Description copied from interface:ReactorHttpExchangeAdapterPerform the given request, and release the response content, if any.- Specified by:
exchangeForMonoin interfaceReactorHttpExchangeAdapter- Parameters:
requestValues- the request to perform- Returns:
Monothat completes when the request is fully executed and the response content is released.
-
exchangeForHeadersMono
public reactor.core.publisher.Mono<HttpHeaders> exchangeForHeadersMono(HttpRequestValues requestValues) Description copied from interface:ReactorHttpExchangeAdapterPerform the given request, release the response content, and return the response headers.- Specified by:
exchangeForHeadersMonoin interfaceReactorHttpExchangeAdapter- Parameters:
requestValues- the request to perform- Returns:
Monothat returns the response headers the request is fully executed and the response content released.
-
exchangeForBodyMono
public <T> reactor.core.publisher.Mono<T> exchangeForBodyMono(HttpRequestValues requestValues, ParameterizedTypeReference<T> bodyType) Description copied from interface:ReactorHttpExchangeAdapterPerform the given request and decode the response content to the given type.- Specified by:
exchangeForBodyMonoin interfaceReactorHttpExchangeAdapter- Type Parameters:
T- the type the response is decoded to- Parameters:
requestValues- 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 requestValues, 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- Type Parameters:
T- the type the response is decoded to- Parameters:
requestValues- 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
-
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
-
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
-