com.sun.jersey.api.core
Interface HttpRequestContext

All Superinterfaces:
HttpHeaders, Request, SecurityContext, Traceable
All Known Implementing Classes:
AdaptingContainerRequest, CachedEntityContainerRequest, ContainerRequest

public interface HttpRequestContext
extends HttpHeaders, Request, SecurityContext, Traceable

An abstraction of a HTTP request.


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
 
Method Summary
 java.net.URIgetAbsolutePath()
          Get the absolute path of the request.
 UriBuildergetAbsolutePathBuilder()
          Get the absolute path of the request in the form of a UriBuilder.
 MediaTypegetAcceptableMediaType(java.util.List<MediaType> mediaTypes)
          Deprecated. will stay in Jersey 1.x, use Request.selectVariant(java.util.List) as an alternative.
 java.util.List<MediaType>getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
          Deprecated. will stay in Jersey 1.x, use Request.selectVariant(java.util.List) as an alternative.
 java.net.URIgetBaseUri()
          Get the base URI of the application.
 UriBuildergetBaseUriBuilder()
          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.
<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.
 FormgetFormParameters()
          Get the form parameters of the request entity.
 java.lang.StringgetHeaderValue(java.lang.String name)
          Get a HTTP header value.
 java.lang.StringgetPath()
          Get the path of the current request relative to the base URI as a string.
 java.lang.StringgetPath(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.
 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.net.URIgetRequestUri()
          Get the absolute request URI.
 UriBuildergetRequestUriBuilder()
          Get the absolute request URI in the form of a UriBuilder.
 
Methods inherited from interface javax.ws.rs.core.HttpHeaders
getAcceptableLanguages, getAcceptableMediaTypes, getCookies, getLanguage, getMediaType, getRequestHeader, getRequestHeaders
 
Methods inherited from interface javax.ws.rs.core.Request
evaluatePreconditions, evaluatePreconditions, evaluatePreconditions, evaluatePreconditions, getMethod, selectVariant
 
Methods inherited from interface javax.ws.rs.core.SecurityContext
getAuthenticationScheme, getUserPrincipal, isSecure, isUserInRole
 
Methods inherited from interface com.sun.jersey.api.core.Traceable
isTracingEnabled, trace
 

Method Detail

getBaseUri

java.net.URI getBaseUri()
Get the base URI of the application. URIs of root resource classes are all relative to this base URI.

Returns:
the base URI of the application

getBaseUriBuilder

UriBuilder getBaseUriBuilder()
Get the base URI of the application in the form of a UriBuilder.

Returns:
a UriBuilder initialized with the base URI of the application.

getRequestUri

java.net.URI getRequestUri()
Get the absolute request URI. This includes query parameters and any supplied fragment.

Returns:
the absolute request URI
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getRequestUriBuilder

UriBuilder getRequestUriBuilder()
Get the absolute request URI in the form of a UriBuilder.

Returns:
a UriBuilder initialized with the absolute request URI
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getAbsolutePath

java.net.URI getAbsolutePath()
Get the absolute path of the request. This includes everything preceding the path (host, port etc) but excludes query parameters and fragment. This is a shortcut for uriInfo.getBase().resolve(uriInfo.getPath()).

Returns:
the absolute path of the request
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getAbsolutePathBuilder

UriBuilder getAbsolutePathBuilder()
Get the absolute path of the request in the form of a UriBuilder. This includes everything preceding the path (host, port etc) but excludes query parameters and fragment.

Returns:
a UriBuilder initialized with the absolute path of the request
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getPath

java.lang.String getPath()
Get the path of the current request relative to the base URI as a string. All sequences of escaped octets are decoded, equivalent to getPath(true).

Returns:
the relative URI path
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getPath

java.lang.String getPath(boolean decode)
Get the path of the current request relative to the base URI as a string.

Parameters:
decode - controls whether sequences of escaped octets are decoded (true) or not (false).
Returns:
the relative URI path
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getPathSegments

java.util.List<PathSegment> getPathSegments()
Get the path of the current request relative to the base URI as a list of 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 parameter names and values are decoded, equivalent to getPathSegments(true).

Returns:
an unmodifiable list of PathSegment. The matrix parameter map of each path segment is also unmodifiable.
Throws:
java.lang.IllegalStateException - if called outside the scope of a request
See Also:
PathSegment, Matrix URIs

getPathSegments

java.util.List<PathSegment> getPathSegments(boolean decode)
Get the path of the current request relative to the base URI as a list of PathSegment. This method is useful when the path needs to be parsed, particularly when matrix parameters may be present in the path.

Parameters:
decode - controls whether sequences of escaped octets in path segments and matrix parameter names and values are decoded (true) or not (false).
Returns:
an unmodifiable list of PathSegment. The matrix parameter map of each path segment is also unmodifiable.
Throws:
java.lang.IllegalStateException - if called outside the scope of a request
See Also:
PathSegment, Matrix URIs

getQueryParameters

MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters()
Get the URI query parameters of the current request. All sequences of escaped octets in parameter names and values are decoded, equivalent to getQueryParameters(true).

Returns:
an unmodifiable map of query parameter names and values
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getQueryParameters

MultivaluedMap<java.lang.String,java.lang.String> getQueryParameters(boolean decode)
Get the URI query parameters of the current request.

Parameters:
decode - controls whether sequences of escaped octets in parameter names and values are decoded (true) or not (false).
Returns:
an unmodifiable map of query parameter names and values
Throws:
java.lang.IllegalStateException - if called outside the scope of a request

getHeaderValue

java.lang.String getHeaderValue(java.lang.String name)
Get a HTTP header value.

Parameters:
name - the HTTP header
Returns:
the HTTP header value. If the HTTP header is not present then null is returned. If the HTTP header is present but has no value then the empty string is returned. If the HTTP header is present more than once then the values of joined together and separated by a ',' character.

getAcceptableMediaType

@DeprecatedMediaType getAcceptableMediaType(java.util.List<MediaType> mediaTypes)
Deprecated. will stay in Jersey 1.x, use Request.selectVariant(java.util.List) as an alternative.

Select the first media type, from a list of media types, that is most acceptable according to the requested acceptable media types.

Parameters:
mediaTypes - the list of media types
Returns:
the most acceptable media type, or null if no media type was found to be acceptable.

getAcceptableMediaTypes

@Deprecatedjava.util.List<MediaType> getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
Deprecated. will stay in Jersey 1.x, use Request.selectVariant(java.util.List) as an alternative.

Get a list of media types that are acceptable for the response.

Parameters:
priorityMediaTypes - the list of media types that take priority, ordered according to the quality source parameter, "qs" as the primary key.
Returns:
a list of requested response media types sorted according to highest relative quality value, which is product of the quality parameter, q, of an acceptable media type, and the quality source parameter, qs, of matching media type.

getCookieNameValueMap

MultivaluedMap<java.lang.String,java.lang.String> getCookieNameValueMap()
Get the cookie name value map.

Returns:
the cookie name value map.

getEntity

<T> T getEntity(java.lang.Class<T> type)            throws WebApplicationException
Get the request entity, returns null if the request does not contain an entity body.

Parameters:
type - the type of entity
Returns:
the request entity or null
Throws:
WebApplicationException - if the content of the request cannot be mapped to an entity of the requested type

getEntity

<T> T getEntity(java.lang.Class<T> type,                java.lang.reflect.Type genericType,                java.lang.annotation.Annotation[] as)            throws WebApplicationException
Get the request entity, returns null if the request does not contain an entity body.

Parameters:
type - the type of entity
genericType - 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 type
Returns:
the request entity or null
Throws:
WebApplicationException - if the content of the request cannot be mapped to an entity of the requested type

getFormParameters

Form getFormParameters()
Get the form parameters of the request entity.

This method will ensure that the request entity is buffered such that it may be consumed by the application.

Returns:
the form parameters, if there is a request entity and the content type is "application/x-www-form-urlencoded", otherwise an instance containing no parameters will be returned.


Copyright © 2013
Oracle Corporation. All Rights Reserved.


NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14