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

public Class ClientHttpRequestDecorator

extends Object
implements ClientHttpRequest
Class Inheritance
All Implemented Interfaces
org.springframework.http.client.reactive.ClientHttpRequest, org.springframework.http.ReactiveHttpOutputMessage, org.springframework.http.HttpMessage
Imports
java.net.URI, java.util.function.Supplier, org.reactivestreams.Publisher, reactor.core.publisher.Mono, org.springframework.core.io.buffer.DataBuffer, .DataBufferFactory, org.springframework.http.HttpCookie, .HttpHeaders, .HttpMethod, org.springframework.util.Assert, .MultiValueMap

Wraps another ClientHttpRequest and delegates all methods to it. Subclasses can override specific methods selectively.
Author
Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final ClientHttpRequest

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
beforeCommit(Supplier<? extends Mono<Void>>
the action to apply
action
)

Implements org.springframework.http.ReactiveHttpOutputMessage.beforeCommit.

Register an action to apply just before the HttpOutputMessage is committed.

public DataBufferFactory
public MultiValueMap<String, HttpCookie>
getCookies()

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

Return a mutable map of request cookies to send to the server.

public ClientHttpRequest
public HttpHeaders
getHeaders()

Implements org.springframework.http.HttpMessage.getHeaders.

Return the headers of this message.

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
public boolean
isCommitted()

Implements org.springframework.http.ReactiveHttpOutputMessage.isCommitted.

Whether the HttpOutputMessage 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).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

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.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

delegateback to summary
private final ClientHttpRequest delegate

Constructor Detail

ClientHttpRequestDecoratorback to summary
public ClientHttpRequestDecorator(ClientHttpRequest delegate)

Method Detail

beforeCommitback to summary
public void beforeCommit(Supplier<? extends Mono<Void>> action)

Implements org.springframework.http.ReactiveHttpOutputMessage.beforeCommit.

Doc from org.springframework.http.ReactiveHttpOutputMessage.beforeCommit.

Register an action to apply just before the HttpOutputMessage is committed.

Note

the supplied action must be properly deferred, e.g. via Mono#defer or Mono#fromRunnable, to ensure it's executed in the right order, relative to other actions.

Parameters
action:Supplier<? extends Mono<Void>>

the action to apply

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
getCookiesback to summary
public MultiValueMap<String, HttpCookie> getCookies()

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

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

Return a mutable map of request cookies to send to the server.

Annotations
@Override
getDelegateback to summary
public ClientHttpRequest getDelegate()
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
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
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
isCommittedback to summary
public boolean isCommitted()

Implements org.springframework.http.ReactiveHttpOutputMessage.isCommitted.

Doc from org.springframework.http.ReactiveHttpOutputMessage.isCommitted.

Whether the HttpOutputMessage is committed.

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