|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.jersey.spi.container.ContainerRequest
public class ContainerRequest
An in-bound HTTP request to be processed by the web application.
Containers instantiate, or inherit, and provide an instance to the
WebApplication
.
Field Summary |
---|
Fields inherited from interface javax.ws.rs.core.HttpHeaders |
---|
ACCEPT, 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 |
Fields inherited from interface javax.ws.rs.core.SecurityContext |
---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
Constructor Summary | |
---|---|
ContainerRequest(WebApplication wa,
java.lang.String method,
java.net.URI baseUri,
java.net.URI requestUri,
InBoundHeaders headers,
java.io.InputStream entity)
Create a new container request. |
Method Summary | ||
---|---|---|
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.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()
|
|
|
getEntity(java.lang.Class<T> type)
Get the request entity, returns null if the request does not contain an entity body. |
|
|
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. |
|
java.lang.String |
getHeaderValue(java.lang.String name)
Get a HTTP header value. |
|
java.util.Locale |
getLanguage()
|
|
javax.ws.rs.core.MediaType |
getMediaType()
|
|
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 . |
|
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. |
|
java.security.Principal |
getUserPrincipal()
|
|
boolean |
isSecure()
|
|
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 |
setUris(java.net.URI baseUri,
java.net.URI requestUri)
Set the base and request URI. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContainerRequest(WebApplication wa, java.lang.String method, java.net.URI baseUri, java.net.URI requestUri, InBoundHeaders headers, java.io.InputStream entity)
The base URI and the request URI must contain the same scheme, user info, host and port components. The base URI must not contain the query and fragment components. The encoded path component of the request URI must start with the encoded path component of the base URI. The encoded path component of the base URI must end in a '/' character.
wa
- the web applicationmethod
- the HTTP methodbaseUri
- the base URI of the requestrequestUri
- the request URIheaders
- the request headersentity
- the InputStream of the request entityMethod Detail |
---|
public void setMethod(java.lang.String method)
method
- the method.public void setUris(java.net.URI baseUri, java.net.URI requestUri)
baseUri
- the base URI.requestUri
- the (complete) request URI.public java.io.InputStream getEntityInputStream()
public void setEntityInputStream(java.io.InputStream entity)
entity
- the input stream of the entity.public void setHeaders(InBoundHeaders headers)
headers
- the request headers.public java.net.URI getBaseUri()
HttpRequestContext
getBaseUri
in interface HttpRequestContext
public javax.ws.rs.core.UriBuilder getBaseUriBuilder()
HttpRequestContext
getBaseUriBuilder
in interface HttpRequestContext
public java.net.URI getRequestUri()
HttpRequestContext
getRequestUri
in interface HttpRequestContext
public javax.ws.rs.core.UriBuilder getRequestUriBuilder()
HttpRequestContext
getRequestUriBuilder
in interface HttpRequestContext
public java.net.URI getAbsolutePath()
HttpRequestContext
uriInfo.getBase().resolve(uriInfo.getPath()).
getAbsolutePath
in interface HttpRequestContext
public javax.ws.rs.core.UriBuilder getAbsolutePathBuilder()
HttpRequestContext
getAbsolutePathBuilder
in interface HttpRequestContext
public java.lang.String getPath()
HttpRequestContext
getPath(true)
.
getPath
in interface HttpRequestContext
public java.lang.String getPath(boolean decode)
HttpRequestContext
getPath
in interface HttpRequestContext
decode
- controls whether sequences of escaped octets are decoded
(true) or not (false).
public java.util.List<javax.ws.rs.core.PathSegment> getPathSegments()
HttpRequestContext
PathSegment
. 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 parmeter names and values are decoded,
equivalent to getPathSegments(true)
.
getPathSegments
in interface HttpRequestContext
PathSegment
. 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)
HttpRequestContext
PathSegment
. This method is useful when the
path needs to be parsed, particularly when matrix parameters may be
present in the path.
getPathSegments
in interface HttpRequestContext
decode
- 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()
HttpRequestContext
getQueryParameters(true)
.
getQueryParameters
in interface HttpRequestContext
public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters(boolean decode)
HttpRequestContext
getQueryParameters
in interface HttpRequestContext
decode
- 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)
HttpRequestContext
getHeaderValue
in interface HttpRequestContext
name
- the HTTP header
public <T> T getEntity(java.lang.Class<T> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] as)
HttpRequestContext
getEntity
in interface HttpRequestContext
type
- 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 behvaiour of this method is undefned.as
- the annoations associated with the type
public <T> T getEntity(java.lang.Class<T> type)
HttpRequestContext
getEntity
in interface HttpRequestContext
type
- the type of entity
public javax.ws.rs.core.MediaType getAcceptableMediaType(java.util.List<javax.ws.rs.core.MediaType> mediaTypes)
HttpRequestContext
getAcceptableMediaType
in interface HttpRequestContext
mediaTypes
- the list of media types
public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getCookieNameValueMap()
HttpRequestContext
getCookieNameValueMap
in interface HttpRequestContext
public javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.String> getRequestHeaders()
getRequestHeaders
in interface javax.ws.rs.core.HttpHeaders
public java.util.List<java.lang.String> getRequestHeader(java.lang.String name)
getRequestHeader
in interface javax.ws.rs.core.HttpHeaders
public java.util.List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
getAcceptableMediaTypes
in interface javax.ws.rs.core.HttpHeaders
public java.util.List<java.util.Locale> getAcceptableLanguages()
getAcceptableLanguages
in interface javax.ws.rs.core.HttpHeaders
public javax.ws.rs.core.MediaType getMediaType()
getMediaType
in interface javax.ws.rs.core.HttpHeaders
public java.util.Locale getLanguage()
getLanguage
in interface javax.ws.rs.core.HttpHeaders
public java.util.Map<java.lang.String,javax.ws.rs.core.Cookie> getCookies()
getCookies
in interface javax.ws.rs.core.HttpHeaders
public java.lang.String getMethod()
getMethod
in interface javax.ws.rs.core.Request
public javax.ws.rs.core.Variant selectVariant(java.util.List<javax.ws.rs.core.Variant> variants)
selectVariant
in interface javax.ws.rs.core.Request
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(javax.ws.rs.core.EntityTag eTag)
evaluatePreconditions
in interface javax.ws.rs.core.Request
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
evaluatePreconditions
in interface javax.ws.rs.core.Request
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified, javax.ws.rs.core.EntityTag eTag)
evaluatePreconditions
in interface javax.ws.rs.core.Request
public java.security.Principal getUserPrincipal()
getUserPrincipal
in interface javax.ws.rs.core.SecurityContext
public boolean isUserInRole(java.lang.String role)
isUserInRole
in interface javax.ws.rs.core.SecurityContext
public boolean isSecure()
isSecure
in interface javax.ws.rs.core.SecurityContext
public java.lang.String getAuthenticationScheme()
getAuthenticationScheme
in interface javax.ws.rs.core.SecurityContext
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |