Package io.micronaut.http
Class HttpRequestWrapper<B>
java.lang.Object
io.micronaut.http.HttpMessageWrapper<B>
io.micronaut.http.HttpRequestWrapper<B>
- Type Parameters:
B
- The Http body type
- All Implemented Interfaces:
AttributeHolder
,MutableAttributeHolder
,HttpMessage<B>
,HttpRequest<B>
A wrapper around a
HttpRequest
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
Fields inherited from interface io.micronaut.http.HttpRequest
SCHEME_HTTP, SCHEME_HTTPS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaccept()
A list of acceptedMediaType
instances sorted by their quality rating.Retrieves the Certificate used for mutual authentication.getPath()
Get the SSL session used for the connection to the client, if available.getUri()
The user principal stored within the request.getUserPrincipal
(Class<T> principalType) The user principal stored within the request.boolean
isSecure()
setAttribute
(CharSequence name, Object value) Sets an attribute on the message.Methods inherited from class io.micronaut.http.HttpMessageWrapper
getAttributes, getBody, getBody, getBody, getBody, getHeaders
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.attr.AttributeHolder
getAttribute, getAttribute
Methods inherited from interface io.micronaut.http.HttpMessage
getAttributes, getBody, getBody, getBody, getBody, getBodyWriter, getCharacterEncoding, getContentLength, getContentType, getHeaders
Methods inherited from interface io.micronaut.http.HttpRequest
getOrigin, mutate, toMutableRequest
Methods inherited from interface io.micronaut.core.attr.MutableAttributeHolder
removeAttribute
-
Constructor Details
-
HttpRequestWrapper
- Parameters:
delegate
- The Http Request
-
-
Method Details
-
getDelegate
- Overrides:
getDelegate
in classHttpMessageWrapper<B>
- Returns:
- The Http message
-
getHttpVersion
- Specified by:
getHttpVersion
in interfaceHttpRequest<B>
- Returns:
- The http version of the request.
-
accept
Description copied from interface:HttpRequest
A list of acceptedMediaType
instances sorted by their quality rating.- Specified by:
accept
in interfaceHttpRequest<B>
- Returns:
- A list of zero or many
MediaType
instances
-
getUserPrincipal
Description copied from interface:HttpRequest
The user principal stored within the request.- Specified by:
getUserPrincipal
in interfaceHttpRequest<B>
- Returns:
- The principal
-
getUserPrincipal
Description copied from interface:HttpRequest
The user principal stored within the request.- Specified by:
getUserPrincipal
in interfaceHttpRequest<B>
- Type Parameters:
T
- The principal type- Parameters:
principalType
- The principal type- Returns:
- The principal
-
setAttribute
Description copied from interface:MutableAttributeHolder
Sets an attribute on the message.- Specified by:
setAttribute
in interfaceHttpMessage<B>
- Specified by:
setAttribute
in interfaceHttpRequest<B>
- Specified by:
setAttribute
in interfaceMutableAttributeHolder
- Parameters:
name
- The name of the attributevalue
- The value of the attribute- Returns:
- This message
-
getLocale
- Specified by:
getLocale
in interfaceHttpMessage<B>
- Specified by:
getLocale
in interfaceHttpRequest<B>
- Returns:
- The locale of the message
-
getCertificate
Description copied from interface:HttpRequest
Retrieves the Certificate used for mutual authentication.- Specified by:
getCertificate
in interfaceHttpRequest<B>
- Returns:
- A certificate used for authentication, if applicable.
-
getSslSession
Description copied from interface:HttpRequest
Get the SSL session used for the connection to the client, if available.- Specified by:
getSslSession
in interfaceHttpRequest<B>
- Returns:
- The session
-
getCookies
- Specified by:
getCookies
in interfaceHttpRequest<B>
- Returns:
- The
Cookies
instance
-
getParameters
- Specified by:
getParameters
in interfaceHttpRequest<B>
- Returns:
- The HTTP parameters contained with the URI query string
-
getMethod
- Specified by:
getMethod
in interfaceHttpRequest<B>
- Returns:
- The request method
-
getMethodName
- Specified by:
getMethodName
in interfaceHttpRequest<B>
- Returns:
- The name of the method (same as
HttpMethod
value for standard http methods).
-
getUri
- Specified by:
getUri
in interfaceHttpRequest<B>
- Returns:
- The full request URI
-
getPath
- Specified by:
getPath
in interfaceHttpRequest<B>
- Returns:
- Get the raw, percent-encoded path without any parameters
-
getRemoteAddress
- Specified by:
getRemoteAddress
in interfaceHttpRequest<B>
- Returns:
- Obtain the remote address
-
getServerAddress
- Specified by:
getServerAddress
in interfaceHttpRequest<B>
- Returns:
- Obtain the server address
-
getServerName
- Specified by:
getServerName
in interfaceHttpRequest<B>
- Returns:
- The server host name
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfaceHttpRequest<B>
- Returns:
- Is the request an HTTPS request
-