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

pack-priv Class ReactorServerHttpRequest

extends AbstractServerHttpRequest
Class Inheritance
Imports
java.net.InetSocketAddress, .URISyntaxException, java.util.concurrent.atomic.AtomicLong, javax.net.ssl.SSLSession, io.netty.channel.Channel, io.netty.handler.codec.http.cookie.Cookie, io.netty.handler.ssl.SslHandler, org.apache.commons.logging.Log, reactor.core.publisher.Flux, reactor.netty.ChannelOperationsId, .Connection, reactor.netty.http.server.HttpServerRequest, org.springframework.core.io.buffer.DataBuffer, .NettyDataBufferFactory, org.springframework.http.HttpCookie, .HttpLogging, .HttpMethod, org.springframework.http.support.Netty4HeadersAdapter, org.springframework.lang.Nullable, org.springframework.util.Assert, .LinkedMultiValueMap, .MultiValueMap

Adapt ServerHttpRequest to the Reactor HttpServerRequest.
Authors
Stephane Maldini, Rossen Stoyanchev
Since
5.0

Field Summary

Modifier and TypeField and Description
private final NettyDataBufferFactory
private static final Log
private static final AtomicLong
private final HttpServerRequest

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 InetSocketAddress
getLocalAddress()

Overrides default org.springframework.http.server.reactive.ServerHttpRequest.getLocalAddress.

Return the local address the request was accepted on, if available.
public <T> T
public InetSocketAddress
getRemoteAddress()

Overrides default org.springframework.http.server.reactive.ServerHttpRequest.getRemoteAddress.

Return the remote address where this request is connected to, if available.
protected MultiValueMap<String, HttpCookie>
initCookies()

Implements abstract org.springframework.http.server.reactive.AbstractServerHttpRequest.initCookies.

Obtain the cookies from the underlying "native" request and adapt those to an HttpCookie map.
protected String
initId()

Overrides org.springframework.http.server.reactive.AbstractServerHttpRequest.initId.

Obtain the request id to use, or null in which case the Object identity of this request instance is used.
protected String
initLogPrefix()

Overrides org.springframework.http.server.reactive.AbstractServerHttpRequest.initLogPrefix.

Subclasses can override this to provide the prefix to use for log messages.
protected SslInfo
initSslInfo()

Implements abstract org.springframework.http.server.reactive.AbstractServerHttpRequest.initSslInfo.

Obtain SSL session information from the underlying "native" request.
Inherited from org.springframework.http.server.reactive.AbstractServerHttpRequest:
getCookiesgetHeadersgetIdgetLogPrefixgetMethodgetPathgetQueryParamsgetSslInfogetURIinitQueryParams

Field Detail

bufferFactoryback to summary
private final NettyDataBufferFactory bufferFactory
loggerback to summary
private static final Log logger
logPrefixIndexback to summary
private static final AtomicLong logPrefixIndex
requestback to summary
private final HttpServerRequest request

Constructor Detail

ReactorServerHttpRequestback to summary
public ReactorServerHttpRequest(HttpServerRequest request, NettyDataBufferFactory bufferFactory) throws URISyntaxException

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
getLocalAddressback to summary
public InetSocketAddress getLocalAddress()

Overrides default org.springframework.http.server.reactive.ServerHttpRequest.getLocalAddress.

Doc from org.springframework.http.server.reactive.ServerHttpRequest.getLocalAddress.

Return the local address the request was accepted on, if available.

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

Implements abstract org.springframework.http.server.reactive.AbstractServerHttpRequest.getNativeRequest.

Doc from org.springframework.http.server.reactive.AbstractServerHttpRequest.getNativeRequest.

Return the underlying server response.

Note

This is exposed mainly for internal framework use such as WebSocket upgrades in the spring-webflux module.

Annotations
@SuppressWarnings:unchecked
@Override
getRemoteAddressback to summary
public InetSocketAddress getRemoteAddress()

Overrides default org.springframework.http.server.reactive.ServerHttpRequest.getRemoteAddress.

Doc from org.springframework.http.server.reactive.ServerHttpRequest.getRemoteAddress.

Return the remote address where this request is connected to, if available.

Annotations
@Override
@Nullable
initCookiesback to summary
protected MultiValueMap<String, HttpCookie> initCookies()

Implements abstract org.springframework.http.server.reactive.AbstractServerHttpRequest.initCookies.

Doc from org.springframework.http.server.reactive.AbstractServerHttpRequest.initCookies.

Obtain the cookies from the underlying "native" request and adapt those to an HttpCookie map. The return value is turned into an immutable map and cached.

Note that this method is invoked lazily on access to getCookies(). Subclasses should synchronize cookie initialization if the underlying "native" request does not provide thread-safe access to cookie data.

Annotations
@Override
initIdback to summary
protected String initId()

Overrides org.springframework.http.server.reactive.AbstractServerHttpRequest.initId.

Doc from org.springframework.http.server.reactive.AbstractServerHttpRequest.initId.

Obtain the request id to use, or null in which case the Object identity of this request instance is used.

Annotations
@Override
@Nullable
initLogPrefixback to summary
protected String initLogPrefix()

Overrides org.springframework.http.server.reactive.AbstractServerHttpRequest.initLogPrefix.

Doc from org.springframework.http.server.reactive.AbstractServerHttpRequest.initLogPrefix.

Subclasses can override this to provide the prefix to use for log messages.

By default, this is getId().

Annotations
@Override
initSslInfoback to summary
protected SslInfo initSslInfo()

Implements abstract org.springframework.http.server.reactive.AbstractServerHttpRequest.initSslInfo.

Doc from org.springframework.http.server.reactive.AbstractServerHttpRequest.initSslInfo.

Obtain SSL session information from the underlying "native" request.

Returns:SslInfo

the session information, or null if none available

Annotations
@Override
@Nullable