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

pack-priv Class ReactorNetty2ClientHttpRequest

extends AbstractClientHttpRequest
implements ZeroCopyHttpOutputMessage
Class Inheritance
All Implemented Interfaces
org.springframework.http.ZeroCopyHttpOutputMessage, org.springframework.http.ReactiveHttpOutputMessage, org.springframework.http.HttpMessage
Imports
java.net.URI, java.nio.file.Path, io.netty5.buffer.Buffer, io.netty5.handler.codec.http.headers.DefaultHttpCookiePair, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, reactor.netty5.NettyOutbound, reactor.netty5.http.client.HttpClientRequest, org.springframework.core.io.buffer.DataBuffer, .DataBufferFactory, .Netty5DataBufferFactory, org.springframework.http.HttpHeaders, .HttpMethod, .ZeroCopyHttpOutputMessage, org.springframework.http.support.Netty5HeadersAdapter

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

This class is based on ReactorClientHttpRequest.

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 HttpMethod
private final NettyOutbound
private final HttpClientRequest
private final URI

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
applyCookies()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyCookies.

Add cookies from getHeaders() to the underlying request.
protected void
applyHeaders()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyHeaders.

Apply header changes from getHeaders() to the underlying request.
public DataBufferFactory
public HttpMethod
getMethod()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getMethod.

Return the HTTP method of the request.
public <T> T
getNativeRequest()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getNativeRequest.

Return the request from the underlying HTTP library.
public URI
protected HttpHeaders
initReadOnlyHeaders()

Overrides org.springframework.http.client.reactive.AbstractClientHttpRequest.initReadOnlyHeaders.

Initialize the read-only headers after the request is committed.
public Mono<Void>
setComplete()

Implements org.springframework.http.ReactiveHttpOutputMessage.setComplete.

Indicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made via getHeaders() to the underlying HTTP message (if not applied already).
private static Publisher<Buffer>
toBuffers(Publisher<? extends DataBuffer> dataBuffers)

public Mono<Void>
writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>>
the body content publisher
body
)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Use the given Publisher of Publishers to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after each Publisher<DataBuffer>.
public Mono<Void>
writeWith(Publisher<? extends DataBuffer>
the body content publisher
body
)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Use the given Publisher to write the body of the message to the underlying HTTP layer.
public Mono<Void>
writeWith(Path
the file to transfer
file
,
long
the position within the file from which the transfer is to begin
position
,
long
the number of bytes to be transferred
count
)

Implements org.springframework.http.ZeroCopyHttpOutputMessage.writeWith.

Use the given Path to write the body of the message to the underlying HTTP layer.
Inherited from org.springframework.http.client.reactive.AbstractClientHttpRequest:
beforeCommitdoCommitdoCommitgetCookiesgetHeadersisCommitted

Field Detail

bufferFactoryback to summary
private final Netty5DataBufferFactory bufferFactory
httpMethodback to summary
private final HttpMethod httpMethod
outboundback to summary
private final NettyOutbound outbound
requestback to summary
private final HttpClientRequest request
uriback to summary
private final URI uri

Constructor Detail

ReactorNetty2ClientHttpRequestback to summary
public ReactorNetty2ClientHttpRequest(HttpMethod method, URI uri, HttpClientRequest request, NettyOutbound outbound)

Method Detail

applyCookiesback to summary
protected void applyCookies()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyCookies.

Doc from org.springframework.http.client.reactive.AbstractClientHttpRequest.applyCookies.

Add cookies from getHeaders() to the underlying request. This method is called once only.

Annotations
@Override
applyHeadersback to summary
protected void applyHeaders()

Implements abstract org.springframework.http.client.reactive.AbstractClientHttpRequest.applyHeaders.

Doc from org.springframework.http.client.reactive.AbstractClientHttpRequest.applyHeaders.

Apply header changes from getHeaders() to the underlying request. This method is called once only.

Annotations
@Override
bufferFactoryback to summary
public DataBufferFactory bufferFactory()

Implements org.springframework.http.ReactiveHttpOutputMessage.bufferFactory.

Doc from org.springframework.http.ReactiveHttpOutputMessage.bufferFactory.

Return a DataBufferFactory that can be used to create the body.

Returns:DataBufferFactory

a buffer factory

Annotations
@Override
getMethodback to summary
public HttpMethod getMethod()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getMethod.

Doc from org.springframework.http.client.reactive.ClientHttpRequest.getMethod.

Return the HTTP method of the request.

Annotations
@Override
getNativeRequestback to summary
public <T> T getNativeRequest()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getNativeRequest.

Doc from org.springframework.http.client.reactive.ClientHttpRequest.getNativeRequest.

Return the request from the underlying HTTP library.

Parameters
<T>
the expected type of the request to cast to
Annotations
@Override
@SuppressWarnings:unchecked
getURIback to summary
public URI getURI()

Implements org.springframework.http.client.reactive.ClientHttpRequest.getURI.

Doc from org.springframework.http.client.reactive.ClientHttpRequest.getURI.

Return the URI of the request.

Annotations
@Override
initReadOnlyHeadersback to summary
protected HttpHeaders initReadOnlyHeaders()

Overrides org.springframework.http.client.reactive.AbstractClientHttpRequest.initReadOnlyHeaders.

Doc from org.springframework.http.client.reactive.AbstractClientHttpRequest.initReadOnlyHeaders.

Initialize the read-only headers after the request is committed.

By default, this method simply applies a read-only wrapper. Subclasses can do the same for headers from the native request.

Annotations
@Override
setCompleteback to summary
public Mono<Void> setComplete()

Implements org.springframework.http.ReactiveHttpOutputMessage.setComplete.

Doc from org.springframework.http.ReactiveHttpOutputMessage.setComplete.

Indicate that message handling is complete, allowing for any cleanup or end-of-processing tasks to be performed such as applying header changes made via getHeaders() to the underlying HTTP message (if not applied already).

This method should be automatically invoked at the end of message processing so typically applications should not have to invoke it. If invoked multiple times it should have no side effects.

Returns:Mono<Void>

a Mono that indicates completion or error

Annotations
@Override
toBuffersback to summary
private static Publisher<Buffer> toBuffers(Publisher<? extends DataBuffer> dataBuffers)
writeAndFlushWithback to summary
public Mono<Void> writeAndFlushWith(Publisher<? extends Publisher<? extends DataBuffer>> body)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeAndFlushWith.

Use the given Publisher of Publishers to write the body of the HttpOutputMessage to the underlying HTTP layer, flushing after each Publisher<DataBuffer>.

Parameters
body:Publisher<? extends Publisher<? extends DataBuffer>>

the body content publisher

Returns:Mono<Void>

a Mono that indicates completion or error

Annotations
@Override
writeWithback to summary
public Mono<Void> writeWith(Publisher<? extends DataBuffer> body)

Implements org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Doc from org.springframework.http.ReactiveHttpOutputMessage.writeWith.

Use the given Publisher to write the body of the message to the underlying HTTP layer.

Parameters
body:Publisher<? extends DataBuffer>

the body content publisher

Returns:Mono<Void>

a Mono that indicates completion or error

Annotations
@Override
writeWithback to summary
public Mono<Void> writeWith(Path file, long position, long count)

Implements org.springframework.http.ZeroCopyHttpOutputMessage.writeWith.

Doc from org.springframework.http.ZeroCopyHttpOutputMessage.writeWith.

Use the given Path to write the body of the message to the underlying HTTP layer.

Parameters
file:Path

the file to transfer

position:long

the position within the file from which the transfer is to begin

count:long

the number of bytes to be transferred

Returns:Mono<Void>

a publisher that indicates completion or error.

Annotations
@Override