Top Description Fields Constructors Methods
org.springframework.http.client.reactive

pack-priv Class ReactorClientHttpResponse

extends Object
implements ClientHttpResponse
Class Inheritance
All Implemented Interfaces
org.springframework.http.client.reactive.ClientHttpResponse, org.springframework.http.ReactiveHttpInputMessage, org.springframework.http.HttpMessage
Imports
java.util.Collection, java.util.concurrent.atomic.AtomicInteger, java.util.function.BiFunction, io.netty.buffer.ByteBufAllocator, io.netty.handler.codec.http.cookie.Cookie, .DefaultCookie, org.apache.commons.logging.Log, .LogFactory, reactor.core.publisher.Flux, reactor.netty.ChannelOperationsId, .Connection, .NettyInbound, reactor.netty.http.client.HttpClientResponse, org.springframework.core.io.buffer.DataBuffer, .NettyDataBufferFactory, org.springframework.http.HttpHeaders, .HttpMethod, .HttpStatusCode, .ResponseCookie, org.springframework.http.support.Netty4HeadersAdapter, org.springframework.lang.Nullable, org.springframework.util.CollectionUtils, .LinkedMultiValueMap, .MultiValueMap, .ObjectUtils

ClientHttpResponse implementation for the Reactor-Netty HTTP client.
Authors
Brian Clozel, Rossen Stoyanchev
Since
5.0
See Also
reactor.netty.http.client.HttpClient

Field Summary

Modifier and TypeField and Description
private final NettyDataBufferFactory
private final HttpHeaders
private final NettyInbound
private static final Log
private final HttpClientResponse
private final AtomicInteger

Constructor Summary

AccessConstructor and Description
public
public
ReactorClientHttpResponse(HttpClientResponse response, NettyInbound inbound, ByteBufAllocator alloc)
Deprecated as of 5.2.8, in favor of ReactorClientHttpResponse(HttpClientResponse, Connection)

Constructor with inputs extracted from a Connection.

Method Summary

Modifier and TypeMethod and Description
public Flux<DataBuffer>
getBody()

Implements org.springframework.http.ReactiveHttpInputMessage.getBody.

Return the body of the message as a Publisher.

public MultiValueMap<String, ResponseCookie>
getCookies()

Implements org.springframework.http.client.reactive.ClientHttpResponse.getCookies.

Return a read-only map of response cookies received from the server.

public HttpHeaders
getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Return the headers of this message.

public String
getId()

Overrides default org.springframework.http.client.reactive.ClientHttpResponse.getId.

Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.

private static String
public HttpStatusCode
private boolean
pack-priv void
releaseAfterCancel(HttpMethod method)

Called by ReactorClientHttpConnector when a cancellation is detected but the content has not been subscribed to.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

bufferFactoryback to summary
private final NettyDataBufferFactory bufferFactory
headersback to summary
private final HttpHeaders headers
inboundback to summary
private final NettyInbound inbound
loggerback to summary
private static final Log logger
responseback to summary
private final HttpClientResponse response
stateback to summary
private final AtomicInteger state

Constructor Detail

ReactorClientHttpResponseback to summary
public ReactorClientHttpResponse(HttpClientResponse response, Connection connection)

Constructor that matches the inputs from reactor.netty.http.client.HttpClient.ResponseReceiver#responseConnection(BiFunction).

Since
5.2.8
ReactorClientHttpResponseback to summary
public ReactorClientHttpResponse(HttpClientResponse response, NettyInbound inbound, ByteBufAllocator alloc)

Constructor with inputs extracted from a Connection.

Annotations
@Deprecated

Method Detail

getBodyback to summary
public Flux<DataBuffer> getBody()

Implements org.springframework.http.ReactiveHttpInputMessage.getBody.

Doc from org.springframework.http.ReactiveHttpInputMessage.getBody.

Return the body of the message as a Publisher.

Returns:Flux<DataBuffer>

the body content publisher

Annotations
@Override
getCookiesback to summary
public MultiValueMap<String, ResponseCookie> getCookies()

Implements org.springframework.http.client.reactive.ClientHttpResponse.getCookies.

Doc from org.springframework.http.client.reactive.ClientHttpResponse.getCookies.

Return a read-only map of response cookies received from the server.

Annotations
@Override
getHeadersback to summary
public HttpHeaders getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Doc from org.springframework.http.HttpMessage.getHeaders.

Return the headers of this message.

Returns:HttpHeaders

a corresponding HttpHeaders object (never null)

Annotations
@Override
getIdback to summary
public String getId()

Overrides default org.springframework.http.client.reactive.ClientHttpResponse.getId.

Doc from org.springframework.http.client.reactive.ClientHttpResponse.getId.

Return an id that represents the underlying connection, if available, or the request for the purpose of correlating log messages.

Annotations
@Override
getSameSiteback to summary
private static String getSameSite(Cookie cookie)
Annotations
@Nullable
getStatusCodeback to summary
public HttpStatusCode getStatusCode()

Implements org.springframework.http.client.reactive.ClientHttpResponse.getStatusCode.

Doc from org.springframework.http.client.reactive.ClientHttpResponse.getStatusCode.

Return the HTTP status code as an HttpStatusCode.

Returns:HttpStatusCode

the HTTP status as HttpStatusCode value (never null)

Annotations
@Override
mayHaveBodyback to summary
private boolean mayHaveBody(HttpMethod method)
releaseAfterCancelback to summary
pack-priv void releaseAfterCancel(HttpMethod method)

Called by ReactorClientHttpConnector when a cancellation is detected but the content has not been subscribed to. If the subscription never materializes then the content will remain not drained. Or it could still materialize if the cancellation happened very early, or the response reading was delayed for some reason.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object

Annotations
@Override