public 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 |
protected Log |
logger |
private HttpServletRequest |
request |
Constructor and Description |
---|
ServletServerHttpRequest(HttpServletRequest request,
AsyncContext asyncContext,
DataBufferFactory bufferFactory,
int bufferSize) |
Modifier and Type | Method and Description |
---|---|
<any> |
getBody()
Return the body of the message as a
Publisher . |
java.lang.String |
getContextPath()
Returns the portion of the URL path that represents the context path for
the current
HttpHandler . |
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
java.util.Optional<java.net.InetSocketAddress> |
getRemoteAddress()
Returns the remote address where this request is connected to.
|
HttpServletRequest |
getServletRequest() |
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(HttpServletRequest request) |
private static java.net.URI |
initUri(HttpServletRequest request) |
protected DataBuffer |
readFromInputStream()
Read from the request body InputStream and return a DataBuffer.
|
getCookies, getHeaders, getQueryParams, getURI, initQueryParams
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
mutate
protected final Log logger
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, DataBufferFactory bufferFactory, int bufferSize) throws java.io.IOException
java.io.IOException
private static java.net.URI initUri(HttpServletRequest request)
private static HttpHeaders initHeaders(HttpServletRequest request)
public HttpServletRequest getServletRequest()
public HttpMethod getMethod()
HttpRequest
null
if not resolvable (e.g. in case of a non-standard HTTP method)public java.lang.String getContextPath()
ServerHttpRequest
HttpHandler
. The context path is always at the
beginning of the request path. It starts with "/" but but does not end
with "/". This method may return an empty string if no context path is
configured.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.util.Optional<java.net.InetSocketAddress> getRemoteAddress()
ServerHttpRequest
public <any> getBody()
ReactiveHttpInputMessage
Publisher
.protected DataBuffer readFromInputStream() throws java.io.IOException
ServletInputStream#isReady()
returns "true".java.io.IOException