public class AdaptingContainerRequest extends ContainerRequest
ContainerRequest.| Modifier and Type | Field and Description |
|---|---|
protected ContainerRequest |
acr
The adapted container request.
|
VARY_HEADERACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, AUTHORIZATION, CACHE_CONTROL, CONTENT_ENCODING, CONTENT_LANGUAGE, CONTENT_LENGTH, CONTENT_LOCATION, CONTENT_TYPE, COOKIE, DATE, ETAG, EXPIRES, HOST, IF_MATCH, IF_MODIFIED_SINCE, IF_NONE_MATCH, IF_UNMODIFIED_SINCE, LAST_MODIFIED, LOCATION, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE| Modifier | Constructor and Description |
|---|---|
protected |
AdaptingContainerRequest(ContainerRequest acr)
Create the adapting container request.
|
| Modifier and Type | Method and Description |
|---|---|
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions() |
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified) |
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified,
javax.ws.rs.core.EntityTag eTag) |
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions(javax.ws.rs.core.EntityTag eTag) |
java.net.URI |
getAbsolutePath()
Get the absolute path of the request.
|
javax.ws.rs.core.UriBuilder |
getAbsolutePathBuilder()
Get the absolute path of the request in the form of a UriBuilder.
|
java.util.List<java.util.Locale> |
getAcceptableLanguages() |
javax.ws.rs.core.MediaType |
getAcceptableMediaType(java.util.List<javax.ws.rs.core.MediaType> mediaTypes)
Select the first media type, from a list of media types, that is most
acceptable according to the requested acceptable media types.
|
java.util.List<javax.ws.rs.core.MediaType> |
getAcceptableMediaTypes() |
java.util.List<javax.ws.rs.core.MediaType> |
getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
Get a list of media types that are acceptable for the response.
|
java.lang.String |
getAuthenticationScheme() |
java.net.URI |
getBaseUri()
Get the base URI of the application.
|
javax.ws.rs.core.UriBuilder |
getBaseUriBuilder()
Get the base URI of the application in the form of a UriBuilder.
|
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> |
getCookieNameValueMap()
Get the cookie name value map.
|
java.util.Map<java.lang.String,javax.ws.rs.core.Cookie> |
getCookies() |
<T> T |
getEntity(java.lang.Class<T> type)
Get the request entity, returns null if the request does not
contain an entity body.
|
<T> T |
getEntity(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] as)
Get the request entity, returns null if the request does not
contain an entity body.
|
java.io.InputStream |
getEntityInputStream()
Get the input stream of the entity.
|
Form |
getFormParameters()
Get the form parameters of the request entity.
|
java.lang.String |
getHeaderValue(java.lang.String name)
Get a HTTP header value.
|
java.util.Locale |
getLanguage() |
javax.ws.rs.core.MediaType |
getMediaType() |
MessageBodyWorkers |
getMessageBodyWorkers()
Get the message body workers.
|
java.lang.String |
getMethod() |
java.lang.String |
getPath()
Get the path of the current request relative to the base URI as
a string.
|
java.lang.String |
getPath(boolean decode)
Get the path of the current request relative to the base URI as
a string.
|
java.util.List<javax.ws.rs.core.PathSegment> |
getPathSegments()
Get the path of the current request relative to the base URI as a
list of
PathSegment. |
java.util.List<javax.ws.rs.core.PathSegment> |
getPathSegments(boolean decode)
Get the path of the current request relative to the base URI as a
list of
PathSegment. |
java.util.Map<java.lang.String,java.lang.Object> |
getProperties()
Get the mutable properties.
|
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> |
getQueryParameters()
Get the URI query parameters of the current request.
|
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> |
getQueryParameters(boolean decode)
Get the URI query parameters of the current request.
|
java.util.List<java.lang.String> |
getRequestHeader(java.lang.String name) |
javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> |
getRequestHeaders() |
java.net.URI |
getRequestUri()
Get the absolute request URI.
|
javax.ws.rs.core.UriBuilder |
getRequestUriBuilder()
Get the absolute request URI in the form of a UriBuilder.
|
javax.ws.rs.core.SecurityContext |
getSecurityContext()
Get the security context.
|
java.security.Principal |
getUserPrincipal() |
boolean |
isSecure() |
boolean |
isTracingEnabled()
Check if tracing is enabled.
|
boolean |
isUserInRole(java.lang.String role) |
javax.ws.rs.core.Variant |
selectVariant(java.util.List<javax.ws.rs.core.Variant> variants) |
void |
setEntityInputStream(java.io.InputStream entity)
Set the input stream of the entity.
|
void |
setHeaders(InBoundHeaders headers)
Set the request headers.
|
void |
setMethod(java.lang.String method)
Set the HTTP method.
|
void |
setSecurityContext(javax.ws.rs.core.SecurityContext securityContext)
Set the security context.
|
void |
setUris(java.net.URI baseUri,
java.net.URI requestUri)
Set the base and request URI.
|
void |
trace(java.lang.String message)
Add a trace message.
|
setEntityprotected final ContainerRequest acr
protected AdaptingContainerRequest(ContainerRequest acr)
acr - the container request to adapt.public java.util.Map<java.lang.String,java.lang.Object> getProperties()
ContainerRequestgetProperties in class ContainerRequestpublic void setMethod(java.lang.String method)
ContainerRequestsetMethod in class ContainerRequestmethod - the method.public void setUris(java.net.URI baseUri,
java.net.URI requestUri)
ContainerRequestsetUris in class ContainerRequestbaseUri - the base URI.requestUri - the (complete) request URI.public java.io.InputStream getEntityInputStream()
ContainerRequestgetEntityInputStream in class ContainerRequestpublic void setEntityInputStream(java.io.InputStream entity)
ContainerRequestsetEntityInputStream in class ContainerRequestentity - the input stream of the entity.public void setHeaders(InBoundHeaders headers)
ContainerRequestsetHeaders in class ContainerRequestheaders - the request headers.public void setSecurityContext(javax.ws.rs.core.SecurityContext securityContext)
ContainerRequestsetSecurityContext in class ContainerRequestsecurityContext - the security context.public javax.ws.rs.core.SecurityContext getSecurityContext()
ContainerRequestgetSecurityContext in class ContainerRequestpublic MessageBodyWorkers getMessageBodyWorkers()
ContainerRequestgetMessageBodyWorkers in class ContainerRequestpublic boolean isTracingEnabled()
TraceableisTracingEnabled in interface TraceableisTracingEnabled in class ContainerRequestpublic void trace(java.lang.String message)
Traceable
A trace message will be added if Traceable.isTracingEnabled() returns
true and tracing contraints are satisfied.
trace in interface Traceabletrace in class ContainerRequestmessage - the trace message to add.public java.net.URI getBaseUri()
HttpRequestContextgetBaseUri in interface HttpRequestContextgetBaseUri in class ContainerRequestpublic javax.ws.rs.core.UriBuilder getBaseUriBuilder()
HttpRequestContextgetBaseUriBuilder in interface HttpRequestContextgetBaseUriBuilder in class ContainerRequestpublic java.net.URI getRequestUri()
HttpRequestContextgetRequestUri in interface HttpRequestContextgetRequestUri in class ContainerRequestpublic javax.ws.rs.core.UriBuilder getRequestUriBuilder()
HttpRequestContextgetRequestUriBuilder in interface HttpRequestContextgetRequestUriBuilder in class ContainerRequestpublic java.net.URI getAbsolutePath()
HttpRequestContexturiInfo.getBase().resolve(uriInfo.getPath()).getAbsolutePath in interface HttpRequestContextgetAbsolutePath in class ContainerRequestpublic javax.ws.rs.core.UriBuilder getAbsolutePathBuilder()
HttpRequestContextgetAbsolutePathBuilder in interface HttpRequestContextgetAbsolutePathBuilder in class ContainerRequestpublic java.lang.String getPath()
HttpRequestContextgetPath(true).getPath in interface HttpRequestContextgetPath in class ContainerRequestpublic java.lang.String getPath(boolean decode)
HttpRequestContextgetPath in interface HttpRequestContextgetPath in class ContainerRequestdecode - controls whether sequences of escaped octets are decoded
(true) or not (false).public java.util.List<javax.ws.rs.core.PathSegment> getPathSegments()
HttpRequestContextPathSegment. This method is useful when the
path needs to be parsed, particularly when matrix parameters may be
present in the path. All sequences of escaped octets in path segments
and matrix parameter names and values are decoded,
equivalent to getPathSegments(true).getPathSegments in interface HttpRequestContextgetPathSegments in class ContainerRequestPathSegment. The matrix parameter
map of each path segment is also unmodifiable.PathSegment,
Matrix URIspublic java.util.List<javax.ws.rs.core.PathSegment> getPathSegments(boolean decode)
HttpRequestContextPathSegment. This method is useful when the
path needs to be parsed, particularly when matrix parameters may be
present in the path.getPathSegments in interface HttpRequestContextgetPathSegments in class ContainerRequestdecode - controls whether sequences of escaped octets in path segments
and matrix parameter names and values are decoded (true) or not (false).PathSegment. The matrix parameter
map of each path segment is also unmodifiable.PathSegment,
Matrix URIspublic javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters()
HttpRequestContextgetQueryParameters(true).getQueryParameters in interface HttpRequestContextgetQueryParameters in class ContainerRequestpublic javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters(boolean decode)
HttpRequestContextgetQueryParameters in interface HttpRequestContextgetQueryParameters in class ContainerRequestdecode - controls whether sequences of escaped octets in parameter
names and values are decoded (true) or not (false).public java.lang.String getHeaderValue(java.lang.String name)
HttpRequestContextgetHeaderValue in interface HttpRequestContextgetHeaderValue in class ContainerRequestname - the HTTP headerpublic javax.ws.rs.core.MediaType getAcceptableMediaType(java.util.List<javax.ws.rs.core.MediaType> mediaTypes)
HttpRequestContextgetAcceptableMediaType in interface HttpRequestContextgetAcceptableMediaType in class ContainerRequestmediaTypes - the list of media typespublic java.util.List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
HttpRequestContextgetAcceptableMediaTypes in interface HttpRequestContextgetAcceptableMediaTypes in class ContainerRequestpriorityMediaTypes - the list of media types that take priority,
ordered according to the quality source parameter, "qs" as the
primary key.public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getCookieNameValueMap()
HttpRequestContextgetCookieNameValueMap in interface HttpRequestContextgetCookieNameValueMap in class ContainerRequestpublic <T> T getEntity(java.lang.Class<T> type)
throws javax.ws.rs.WebApplicationException
HttpRequestContextgetEntity in interface HttpRequestContextgetEntity in class ContainerRequesttype - the type of entityjavax.ws.rs.WebApplicationException - if the content of the request
cannot be mapped to an entity of the requested typepublic <T> T getEntity(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] as)
throws javax.ws.rs.WebApplicationException
HttpRequestContextgetEntity in interface HttpRequestContextgetEntity in class ContainerRequesttype - the type of entitygenericType - type the generic type of entity, it is the responsibility
of the callee to ensure that the type and generic type are
consistent otherwise the behaviour of this method is undefined.as - the annotations associated with the typejavax.ws.rs.WebApplicationException - if the content of the request
cannot be mapped to an entity of the requested typepublic Form getFormParameters()
HttpRequestContextThis method will ensure that the request entity is buffered such that it may be consumed by the application.
getFormParameters in interface HttpRequestContextgetFormParameters in class ContainerRequestpublic java.util.List<java.lang.String> getRequestHeader(java.lang.String name)
getRequestHeader in interface javax.ws.rs.core.HttpHeadersgetRequestHeader in class ContainerRequestpublic javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getRequestHeaders()
getRequestHeaders in interface javax.ws.rs.core.HttpHeadersgetRequestHeaders in class ContainerRequestpublic java.util.List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
getAcceptableMediaTypes in interface javax.ws.rs.core.HttpHeadersgetAcceptableMediaTypes in class ContainerRequestpublic java.util.List<java.util.Locale> getAcceptableLanguages()
getAcceptableLanguages in interface javax.ws.rs.core.HttpHeadersgetAcceptableLanguages in class ContainerRequestpublic javax.ws.rs.core.MediaType getMediaType()
getMediaType in interface javax.ws.rs.core.HttpHeadersgetMediaType in class ContainerRequestpublic java.util.Locale getLanguage()
getLanguage in interface javax.ws.rs.core.HttpHeadersgetLanguage in class ContainerRequestpublic java.util.Map<java.lang.String,javax.ws.rs.core.Cookie> getCookies()
getCookies in interface javax.ws.rs.core.HttpHeadersgetCookies in class ContainerRequestpublic java.lang.String getMethod()
getMethod in interface javax.ws.rs.core.RequestgetMethod in class ContainerRequestpublic javax.ws.rs.core.Variant selectVariant(java.util.List<javax.ws.rs.core.Variant> variants)
throws java.lang.IllegalArgumentException
selectVariant in interface javax.ws.rs.core.RequestselectVariant in class ContainerRequestjava.lang.IllegalArgumentExceptionpublic javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(javax.ws.rs.core.EntityTag eTag)
evaluatePreconditions in interface javax.ws.rs.core.RequestevaluatePreconditions in class ContainerRequestpublic javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
evaluatePreconditions in interface javax.ws.rs.core.RequestevaluatePreconditions in class ContainerRequestpublic javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified,
javax.ws.rs.core.EntityTag eTag)
evaluatePreconditions in interface javax.ws.rs.core.RequestevaluatePreconditions in class ContainerRequestpublic javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions()
evaluatePreconditions in interface javax.ws.rs.core.RequestevaluatePreconditions in class ContainerRequestpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface javax.ws.rs.core.SecurityContextgetUserPrincipal in class ContainerRequestpublic boolean isUserInRole(java.lang.String role)
isUserInRole in interface javax.ws.rs.core.SecurityContextisUserInRole in class ContainerRequestpublic boolean isSecure()
isSecure in interface javax.ws.rs.core.SecurityContextisSecure in class ContainerRequestpublic java.lang.String getAuthenticationScheme()
getAuthenticationScheme in interface javax.ws.rs.core.SecurityContextgetAuthenticationScheme in class ContainerRequestCopyright © 2016 Oracle Corporation. All Rights Reserved.