class ServletServerHttpRequest extends AbstractServerHttpRequest
ServerHttpRequest
to the Servlet HttpServletRequest
.Modifier and Type | Class and Description |
---|---|
private class |
ServletServerHttpRequest.RequestAsyncListener |
private class |
ServletServerHttpRequest.RequestBodyPublisher |
ServerHttpRequest.Builder
Modifier and Type | Field and Description |
---|---|
private ServletServerHttpRequest.RequestBodyPublisher |
bodyPublisher |
private byte[] |
buffer |
private DataBufferFactory |
bufferFactory |
private java.lang.Object |
cookieLock |
(package private) static DataBuffer |
EOF_BUFFER |
private HttpServletRequest |
request |
logger
Constructor and Description |
---|
ServletServerHttpRequest(HttpHeaders headers,
HttpServletRequest request,
AsyncContext asyncContext,
java.lang.String servletPath,
DataBufferFactory bufferFactory,
int bufferSize) |
ServletServerHttpRequest(HttpServletRequest request,
AsyncContext asyncContext,
java.lang.String servletPath,
DataBufferFactory bufferFactory,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
private static HttpHeaders |
createDefaultHttpHeaders(HttpServletRequest request) |
<any> |
getBody()
Return the body of the message as a
Publisher . |
java.lang.String |
getMethodValue()
Return the HTTP method of the request as a String value.
|
<T> T |
getNativeRequest()
Return the underlying server response.
|
java.net.InetSocketAddress |
getRemoteAddress()
Return the remote address where this request is connected to, if available.
|
private java.lang.String |
getSslSessionId() |
private java.security.cert.X509Certificate[] |
getX509Certificates() |
protected MultiValueMap<java.lang.String,HttpCookie> |
initCookies()
Obtain the cookies from the underlying "native" request and adapt those to
an
HttpCookie map. |
private static HttpHeaders |
initHeaders(HttpHeaders headers,
HttpServletRequest request) |
protected SslInfo |
initSslInfo()
Obtain SSL session information from the underlying "native" request.
|
private static java.net.URI |
initUri(HttpServletRequest request) |
protected void |
logBytesRead(int read) |
(package private) DataBuffer |
readFromInputStream()
Read from the request body InputStream and return a DataBuffer.
|
getCookies, getHeaders, getId, getLogPrefix, getPath, getQueryParams, getSslInfo, getURI, initId, initQueryParams
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mutate
getMethod
static final DataBuffer EOF_BUFFER
private final HttpServletRequest request
private final ServletServerHttpRequest.RequestBodyPublisher bodyPublisher
private final java.lang.Object cookieLock
private final DataBufferFactory bufferFactory
private final byte[] buffer
public ServletServerHttpRequest(HttpServletRequest request, AsyncContext asyncContext, java.lang.String servletPath, DataBufferFactory bufferFactory, int bufferSize) throws java.io.IOException, java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxException
public ServletServerHttpRequest(HttpHeaders headers, HttpServletRequest request, AsyncContext asyncContext, java.lang.String servletPath, DataBufferFactory bufferFactory, int bufferSize) throws java.io.IOException, java.net.URISyntaxException
java.io.IOException
java.net.URISyntaxException
private static HttpHeaders createDefaultHttpHeaders(HttpServletRequest request)
private static java.net.URI initUri(HttpServletRequest request) throws java.net.URISyntaxException
java.net.URISyntaxException
private static HttpHeaders initHeaders(HttpHeaders headers, HttpServletRequest request)
public java.lang.String getMethodValue()
HttpRequest
HttpRequest.getMethod()
protected MultiValueMap<java.lang.String,HttpCookie> initCookies()
AbstractServerHttpRequest
HttpCookie
map. The return value is turned into an immutable
map and cached.
Note that this method is invoked lazily on access to
AbstractServerHttpRequest.getCookies()
. Sub-classes should synchronize cookie
initialization if the underlying "native" request does not provide
thread-safe access to cookie data.
initCookies
in class AbstractServerHttpRequest
public java.net.InetSocketAddress getRemoteAddress()
ServerHttpRequest
@Nullable protected SslInfo initSslInfo()
AbstractServerHttpRequest
initSslInfo
in class AbstractServerHttpRequest
null
if none available@Nullable private java.lang.String getSslSessionId()
@Nullable private java.security.cert.X509Certificate[] getX509Certificates()
public <any> getBody()
ReactiveHttpInputMessage
Publisher
.@Nullable DataBuffer readFromInputStream() throws java.io.IOException
ServletInputStream#isReady()
returns "true".EOF_BUFFER
if the input
stream returned -1, or null if 0 bytes were read.java.io.IOException
protected final void logBytesRead(int read)
public <T> T getNativeRequest()
AbstractServerHttpRequest
Note: This is exposed mainly for internal framework use such as WebSocket upgrades in the spring-webflux module.
getNativeRequest
in class AbstractServerHttpRequest