public class ServletServerHttpRequest extends Object implements ServerHttpRequest
ServerHttpRequest
implementation that is based on a HttpServletRequest
.Modifier and Type | Field and Description |
---|---|
protected static Charset |
FORM_CHARSET |
Constructor and Description |
---|
ServletServerHttpRequest(HttpServletRequest servletRequest)
Construct a new instance of the ServletServerHttpRequest based on the
given
HttpServletRequest . |
Modifier and Type | Method and Description |
---|---|
ServerHttpAsyncRequestControl |
getAsyncRequestControl(ServerHttpResponse response)
Return a control that allows putting the request in asynchronous mode so the
response remains open until closed explicitly from the current or another thread.
|
InputStream |
getBody()
Return the body of the message as an input stream.
|
HttpHeaders |
getHeaders()
Return the headers of this message.
|
InetSocketAddress |
getLocalAddress()
Return the address on which the request was received.
|
HttpMethod |
getMethod()
Return the HTTP method of the request.
|
String |
getMethodValue()
Return the HTTP method of the request as a String value.
|
Principal |
getPrincipal()
Return a
Principal instance containing the name of the
authenticated user. |
InetSocketAddress |
getRemoteAddress()
Return the address of the remote client.
|
HttpServletRequest |
getServletRequest()
Returns the
HttpServletRequest this object is based on. |
URI |
getURI()
Return the URI of the request (including a query string if any,
but only if it is well-formed for a URI representation).
|
protected static final Charset FORM_CHARSET
public ServletServerHttpRequest(HttpServletRequest servletRequest)
HttpServletRequest
.servletRequest
- the servlet requestpublic HttpServletRequest getServletRequest()
HttpServletRequest
this object is based on.@Nullable public HttpMethod getMethod()
HttpRequest
getMethod
in interface HttpRequest
null
if not resolvable (e.g. in case of a non-standard HTTP method)HttpRequest.getMethodValue()
,
HttpMethod.resolve(String)
public String getMethodValue()
HttpRequest
getMethodValue
in interface HttpRequest
HttpRequest.getMethod()
public URI getURI()
HttpRequest
getURI
in interface HttpRequest
null
)public HttpHeaders getHeaders()
HttpMessage
getHeaders
in interface HttpMessage
null
)public Principal getPrincipal()
ServerHttpRequest
Principal
instance containing the name of the
authenticated user.
If the user has not been authenticated, the method returns null
.
getPrincipal
in interface ServerHttpRequest
public InetSocketAddress getLocalAddress()
ServerHttpRequest
getLocalAddress
in interface ServerHttpRequest
public InetSocketAddress getRemoteAddress()
ServerHttpRequest
getRemoteAddress
in interface ServerHttpRequest
public InputStream getBody() throws IOException
HttpInputMessage
getBody
in interface HttpInputMessage
null
)IOException
- in case of I/O errorspublic ServerHttpAsyncRequestControl getAsyncRequestControl(ServerHttpResponse response)
ServerHttpRequest
getAsyncRequestControl
in interface ServerHttpRequest