Class WebClientAdapter
java.lang.Object
org.springframework.web.reactive.function.client.support.WebClientAdapter
- All Implemented Interfaces:
org.springframework.web.service.invoker.HttpClientAdapter
public final class WebClientAdapter
extends Object
implements org.springframework.web.service.invoker.HttpClientAdapter
HttpClientAdapter
that enables an HttpServiceProxyFactory
to
use WebClient
for request execution.
Use static factory methods in this class to create an
HttpServiceProxyFactory
configured with a given WebClient
.
- Since:
- 6.0
- Author:
- Rossen Stoyanchev
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebClientAdapter
Create aWebClientAdapter
for the givenWebClient
instance.reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>>
requestToBodilessEntity
(org.springframework.web.service.invoker.HttpRequestValues requestValues) <T> reactor.core.publisher.Mono<T>
requestToBody
(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Flux<T>
requestToBodyFlux
(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<T>>
requestToEntity
(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<T>>>
requestToEntityFlux
(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) reactor.core.publisher.Mono<org.springframework.http.HttpHeaders>
requestToHeaders
(org.springframework.web.service.invoker.HttpRequestValues requestValues) reactor.core.publisher.Mono<Void>
requestToVoid
(org.springframework.web.service.invoker.HttpRequestValues requestValues)
-
Method Details
-
requestToVoid
public reactor.core.publisher.Mono<Void> requestToVoid(org.springframework.web.service.invoker.HttpRequestValues requestValues) - Specified by:
requestToVoid
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToHeaders
public reactor.core.publisher.Mono<org.springframework.http.HttpHeaders> requestToHeaders(org.springframework.web.service.invoker.HttpRequestValues requestValues) - Specified by:
requestToHeaders
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToBody
public <T> reactor.core.publisher.Mono<T> requestToBody(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToBody
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToBodyFlux
public <T> reactor.core.publisher.Flux<T> requestToBodyFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToBodyFlux
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToBodilessEntity
public reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<Void>> requestToBodilessEntity(org.springframework.web.service.invoker.HttpRequestValues requestValues) - Specified by:
requestToBodilessEntity
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToEntity
public <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<T>> requestToEntity(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToEntity
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
requestToEntityFlux
public <T> reactor.core.publisher.Mono<org.springframework.http.ResponseEntity<reactor.core.publisher.Flux<T>>> requestToEntityFlux(org.springframework.web.service.invoker.HttpRequestValues requestValues, org.springframework.core.ParameterizedTypeReference<T> bodyType) - Specified by:
requestToEntityFlux
in interfaceorg.springframework.web.service.invoker.HttpClientAdapter
-
forClient
Create aWebClientAdapter
for the givenWebClient
instance.- Parameters:
webClient
- the client to use- Returns:
- the created adapter instance
-