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

pack-priv Class ReactorNetty2ClientHttpResponse

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.netty5.handler.codec.http.headers.DefaultHttpSetCookie, .HttpSetCookie, org.apache.commons.logging.Log, .LogFactory, reactor.core.publisher.Flux, reactor.netty5.ChannelOperationsId, .Connection, .NettyInbound, reactor.netty5.http.client.HttpClientResponse, org.springframework.core.io.buffer.DataBuffer, .Netty5DataBufferFactory, org.springframework.http.HttpHeaders, .HttpMethod, .HttpStatusCode, .ResponseCookie, org.springframework.http.support.Netty5HeadersAdapter, org.springframework.lang.Nullable, org.springframework.util.CollectionUtils, .LinkedMultiValueMap, .MultiValueMap, .ObjectUtils

ClientHttpResponse implementation for the Reactor Netty 2 (Netty 5) HTTP client.

This class is based on ReactorClientHttpResponse.

Author
Violeta Georgieva
Since
6.0
See Also
reactor.netty5.http.client.HttpClient

Field Summary

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

Constructor Summary

AccessConstructor and Description
public

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 ReactorNetty2ClientHttpConnector 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 Netty5DataBufferFactory 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

ReactorNetty2ClientHttpResponseback to summary
public ReactorNetty2ClientHttpResponse(HttpClientResponse response, Connection connection)

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

Since
5.2.8

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(HttpSetCookie 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 ReactorNetty2ClientHttpConnector 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