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

pack-priv Class ReactorNetty2ServerHttpRequest

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

Adapt ServerHttpRequest to the Reactor HttpServerRequest.

This class is based on ReactorServerHttpRequest.

Authors
Violeta Georgieva, Sebastien Deleuze
Since
6.0

Field Summary

Modifier and TypeField and Description
private final Netty5DataBufferFactory
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.
private static String
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.
private static URI
private static URI
private static String
Inherited from org.springframework.http.server.reactive.AbstractServerHttpRequest:
getCookiesgetHeadersgetIdgetLogPrefixgetMethodgetPathgetQueryParamsgetSslInfogetURIinitQueryParams

Field Detail

bufferFactoryback to summary
private final Netty5DataBufferFactory 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

ReactorNetty2ServerHttpRequestback to summary
public ReactorNetty2ServerHttpRequest(HttpServerRequest request, Netty5DataBufferFactory 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
getSchemeback to summary
private static String getScheme(HttpServerRequest request)
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
initUriback to summary
private static URI initUri(HttpServerRequest request) throws URISyntaxException
resolveBaseUrlback to summary
private static URI resolveBaseUrl(HttpServerRequest request) throws URISyntaxException
resolveRequestUriback to summary
private static String resolveRequestUri(HttpServerRequest request)