|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jersey.spi.container.ContainerRequest
com.sun.jersey.spi.container.AdaptingContainerRequest
public class AdaptingContainerRequest
An adapting in-bound HTTP request that may override the behaviour of
ContainerRequest.
| Field Summary | |
|---|---|
protected ContainerRequest |
acr
The adapted container request. |
| 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 | |
|---|---|
protected |
AdaptingContainerRequest(ContainerRequest acr)
Create the adapting container request. |
| Method Summary | ||
|---|---|---|
Response.ResponseBuilder |
evaluatePreconditions()
|
|
Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified)
|
|
Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified,
EntityTag eTag)
|
|
Response.ResponseBuilder |
evaluatePreconditions(EntityTag eTag)
|
|
java.net.URI |
getAbsolutePath()
Get the absolute path of the request. |
|
UriBuilder |
getAbsolutePathBuilder()
Get the absolute path of the request in the form of a UriBuilder. |
|
java.util.List<java.util.Locale> |
getAcceptableLanguages()
|
|
MediaType |
getAcceptableMediaType(java.util.List<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<MediaType> |
getAcceptableMediaTypes()
|
|
java.util.List<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. |
|
UriBuilder |
getBaseUriBuilder()
Get the base URI of the application in the form of a UriBuilder. |
|
MultivaluedMap<java.lang.String,java.lang.String> |
getCookieNameValueMap()
Get the cookie name value map. |
|
java.util.Map<java.lang.String,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. |
|
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()
|
|
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<PathSegment> |
getPathSegments()
Get the path of the current request relative to the base URI as a list of PathSegment. |
|
java.util.List<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. |
|
MultivaluedMap<java.lang.String,java.lang.String> |
getQueryParameters()
Get the URI query parameters of the current request. |
|
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)
|
|
MultivaluedMap<java.lang.String,java.lang.String> |
getRequestHeaders()
|
|
java.net.URI |
getRequestUri()
Get the absolute request URI. |
|
UriBuilder |
getRequestUriBuilder()
Get the absolute request URI in the form of a UriBuilder. |
|
java.security.Principal |
getUserPrincipal()
|
|
boolean |
isSecure()
|
|
boolean |
isTracingEnabled()
Check if tracing is enabled. |
|
boolean |
isUserInRole(java.lang.String role)
|
|
Variant |
selectVariant(java.util.List<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(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. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ContainerRequest acr
| Constructor Detail |
|---|
protected AdaptingContainerRequest(ContainerRequest acr)
acr - the container request to adapt.| Method Detail |
|---|
public java.util.Map<java.lang.String,java.lang.Object> getProperties()
ContainerRequestCare should be taken not to clear the properties or remove properties that are unknown otherwise unspecified behaviour may result.
getProperties in class ContainerRequestpublic void setMethod(java.lang.String method)
ContainerRequest
setMethod in class ContainerRequestmethod - the method.
public void setUris(java.net.URI baseUri,
java.net.URI requestUri)
ContainerRequest
setUris in class ContainerRequestbaseUri - the base URI.requestUri - the (complete) request URI.public java.io.InputStream getEntityInputStream()
ContainerRequest
getEntityInputStream in class ContainerRequestpublic void setEntityInputStream(java.io.InputStream entity)
ContainerRequest
setEntityInputStream in class ContainerRequestentity - the input stream of the entity.public void setHeaders(InBoundHeaders headers)
ContainerRequest
setHeaders in class ContainerRequestheaders - the request headers.public void setSecurityContext(SecurityContext securityContext)
ContainerRequest
setSecurityContext in class ContainerRequestsecurityContext - the security context.public MessageBodyWorkers getMessageBodyWorkers()
ContainerRequest
getMessageBodyWorkers in class ContainerRequestpublic boolean isTracingEnabled()
Traceable
isTracingEnabled 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()
HttpRequestContext
getBaseUri in interface HttpRequestContextgetBaseUri in class ContainerRequestpublic UriBuilder getBaseUriBuilder()
HttpRequestContext
getBaseUriBuilder in interface HttpRequestContextgetBaseUriBuilder in class ContainerRequestpublic java.net.URI getRequestUri()
HttpRequestContext
getRequestUri in interface HttpRequestContextgetRequestUri in class ContainerRequestpublic UriBuilder getRequestUriBuilder()
HttpRequestContext
getRequestUriBuilder in interface HttpRequestContextgetRequestUriBuilder in class ContainerRequestpublic java.net.URI getAbsolutePath()
HttpRequestContexturiInfo.getBase().resolve(uriInfo.getPath()).
getAbsolutePath in interface HttpRequestContextgetAbsolutePath in class ContainerRequestpublic UriBuilder getAbsolutePathBuilder()
HttpRequestContext
getAbsolutePathBuilder 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)
HttpRequestContext
getPath in interface HttpRequestContextgetPath in class ContainerRequestdecode - controls whether sequences of escaped octets are decoded
(true) or not (false).
public java.util.List<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 parmeter 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<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 MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters()
HttpRequestContextgetQueryParameters(true).
getQueryParameters in interface HttpRequestContextgetQueryParameters in class ContainerRequestpublic MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters(boolean decode)
HttpRequestContext
getQueryParameters 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)
HttpRequestContext
getHeaderValue in interface HttpRequestContextgetHeaderValue in class ContainerRequestname - the HTTP header
public MediaType getAcceptableMediaType(java.util.List<MediaType> mediaTypes)
HttpRequestContext
getAcceptableMediaType in interface HttpRequestContextgetAcceptableMediaType in class ContainerRequestmediaTypes - the list of media types
public java.util.List<MediaType> getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
HttpRequestContext
getAcceptableMediaTypes 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 MultivaluedMap<java.lang.String,java.lang.String> getCookieNameValueMap()
HttpRequestContext
getCookieNameValueMap in interface HttpRequestContextgetCookieNameValueMap in class ContainerRequest
public <T> T getEntity(java.lang.Class<T> type)
throws WebApplicationException
HttpRequestContext
getEntity in interface HttpRequestContextgetEntity in class ContainerRequesttype - the type of entity
WebApplicationException - if the content of the request
cannot be mapped to an entity of the requested type
public <T> T getEntity(java.lang.Class<T> type,
java.lang.reflect.Type genericType,
java.lang.annotation.Annotation[] as)
throws WebApplicationException
HttpRequestContext
getEntity 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 behvaiour of this method is undefned.as - the annoations associated with the type
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 applicaton.
getFormParameters in interface HttpRequestContextgetFormParameters in class ContainerRequestpublic java.util.List<java.lang.String> getRequestHeader(java.lang.String name)
getRequestHeader in interface HttpHeadersgetRequestHeader in class ContainerRequestpublic MultivaluedMap<java.lang.String,java.lang.String> getRequestHeaders()
getRequestHeaders in interface HttpHeadersgetRequestHeaders in class ContainerRequestpublic java.util.List<MediaType> getAcceptableMediaTypes()
getAcceptableMediaTypes in interface HttpHeadersgetAcceptableMediaTypes in class ContainerRequestpublic java.util.List<java.util.Locale> getAcceptableLanguages()
getAcceptableLanguages in interface HttpHeadersgetAcceptableLanguages in class ContainerRequestpublic MediaType getMediaType()
getMediaType in interface HttpHeadersgetMediaType in class ContainerRequestpublic java.util.Locale getLanguage()
getLanguage in interface HttpHeadersgetLanguage in class ContainerRequestpublic java.util.Map<java.lang.String,Cookie> getCookies()
getCookies in interface HttpHeadersgetCookies in class ContainerRequestpublic java.lang.String getMethod()
getMethod in interface RequestgetMethod in class ContainerRequest
public Variant selectVariant(java.util.List<Variant> variants)
throws java.lang.IllegalArgumentException
selectVariant in interface RequestselectVariant in class ContainerRequestjava.lang.IllegalArgumentExceptionpublic Response.ResponseBuilder evaluatePreconditions(EntityTag eTag)
evaluatePreconditions in interface RequestevaluatePreconditions in class ContainerRequestpublic Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
evaluatePreconditions in interface RequestevaluatePreconditions in class ContainerRequest
public Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified,
EntityTag eTag)
evaluatePreconditions in interface RequestevaluatePreconditions in class ContainerRequestpublic Response.ResponseBuilder evaluatePreconditions()
evaluatePreconditions in interface RequestevaluatePreconditions in class ContainerRequestpublic java.security.Principal getUserPrincipal()
getUserPrincipal in interface SecurityContextgetUserPrincipal in class ContainerRequestpublic boolean isUserInRole(java.lang.String role)
isUserInRole in interface SecurityContextisUserInRole in class ContainerRequestpublic boolean isSecure()
isSecure in interface SecurityContextisSecure in class ContainerRequestpublic java.lang.String getAuthenticationScheme()
getAuthenticationScheme in interface SecurityContextgetAuthenticationScheme in class ContainerRequest
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||