|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface HttpRequestContext
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.URI |
getAbsolutePath()
Get the absolute path of the request. |
|
UriBuilder |
getAbsolutePathBuilder()
Get the absolute path of the request in the form of a UriBuilder. |
|
MediaType |
getAcceptableMediaType(java.util.List<MediaType> mediaTypes)
Deprecated. |
|
java.util.List<MediaType> |
getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
Deprecated. |
|
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. |
|
|
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. |
|
Form |
getFormParameters()
Get the form parameters of the request entity. |
|
java.lang.String |
getHeaderValue(java.lang.String name)
Get a HTTP header value. |
|
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 . |
|
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.URI |
getRequestUri()
Get the absolute request URI. |
|
UriBuilder |
getRequestUriBuilder()
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 |
---|
java.net.URI getBaseUri()
UriBuilder getBaseUriBuilder()
java.net.URI getRequestUri()
java.lang.IllegalStateException
- if called outside the scope of a requestUriBuilder getRequestUriBuilder()
java.lang.IllegalStateException
- if called outside the scope of a requestjava.net.URI getAbsolutePath()
uriInfo.getBase().resolve(uriInfo.getPath()).
java.lang.IllegalStateException
- if called outside the scope of a requestUriBuilder getAbsolutePathBuilder()
java.lang.IllegalStateException
- if called outside the scope of a requestjava.lang.String getPath()
getPath(true)
.
java.lang.IllegalStateException
- if called outside the scope of a requestjava.lang.String getPath(boolean decode)
decode
- controls whether sequences of escaped octets are decoded
(true) or not (false).
java.lang.IllegalStateException
- if called outside the scope of a requestjava.util.List<PathSegment> getPathSegments()
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)
.
PathSegment
. The matrix parameter
map of each path segment is also unmodifiable.
java.lang.IllegalStateException
- if called outside the scope of a requestPathSegment
,
Matrix URIsjava.util.List<PathSegment> getPathSegments(boolean decode)
PathSegment
. This method is useful when the
path needs to be parsed, particularly when matrix parameters may be
present in the path.
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.
java.lang.IllegalStateException
- if called outside the scope of a requestPathSegment
,
Matrix URIsMultivaluedMap<java.lang.String,java.lang.String> getQueryParameters()
getQueryParameters(true)
.
java.lang.IllegalStateException
- if called outside the scope of a requestMultivaluedMap<java.lang.String,java.lang.String> getQueryParameters(boolean decode)
decode
- controls whether sequences of escaped octets in parameter
names and values are decoded (true) or not (false).
java.lang.IllegalStateException
- if called outside the scope of a requestjava.lang.String getHeaderValue(java.lang.String name)
name
- the HTTP header
@Deprecated MediaType getAcceptableMediaType(java.util.List<MediaType> mediaTypes)
mediaTypes
- the list of media types
@Deprecated java.util.List<MediaType> getAcceptableMediaTypes(java.util.List<QualitySourceMediaType> priorityMediaTypes)
priorityMediaTypes
- the list of media types that take priority,
ordered according to the quality source parameter, "qs" as the
primary key.
MultivaluedMap<java.lang.String,java.lang.String> getCookieNameValueMap()
<T> T getEntity(java.lang.Class<T> type) throws WebApplicationException
type
- the type of entity
WebApplicationException
- if the content of the request
cannot be mapped to an entity of the requested type<T> T getEntity(java.lang.Class<T> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] as) throws WebApplicationException
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
WebApplicationException
- if the content of the request
cannot be mapped to an entity of the requested typeForm getFormParameters()
This method will ensure that the request entity is buffered such that it may be consumed by the applicaton.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |