|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.message.internal.InboundMessageContext
org.glassfish.jersey.server.JerseyContainerRequestContext
public class JerseyContainerRequestContext
Jersey container request context.
An instance of the request context is passed by the container to the
ApplicationHandler for each incoming client request.
| Field Summary |
|---|
| Fields inherited from interface javax.ws.rs.core.HttpHeaders |
|---|
ACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, ALLOW, 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, LINK, LOCATION, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE |
| Constructor Summary | |
|---|---|
JerseyContainerRequestContext(java.net.URI baseUri,
java.net.URI requestUri,
java.lang.String httpMethod,
SecurityContext securityContext,
PropertiesDelegate propertiesDelegate)
Create new Jersey container request context. |
|
| Method Summary | ||
|---|---|---|
void |
abortWith(Response response)
|
|
Response.ResponseBuilder |
evaluatePreconditions()
|
|
Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified)
|
|
Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified,
EntityTag eTag)
|
|
Response.ResponseBuilder |
evaluatePreconditions(EntityTag eTag)
|
|
Response |
getAbortResponse()
Get the request filter chain aborting response if set, or null otherwise. |
|
java.util.List<java.util.Locale> |
getAcceptableLanguages()
|
|
java.util.List<MediaType> |
getAcceptableMediaTypes()
|
|
java.net.URI |
getBaseUri()
Get base request URI. |
|
java.util.Map<java.lang.String,Cookie> |
getCookies()
|
|
java.lang.String |
getMethod()
|
|
java.lang.String |
getPath(boolean decode)
Get the path of the current request relative to the application root (base) URI as a string. |
|
java.lang.Object |
getProperty(java.lang.String name)
|
|
java.util.Enumeration<java.lang.String> |
getPropertyNames()
|
|
Request |
getRequest()
|
|
java.util.List<java.lang.String> |
getRequestHeader(java.lang.String name)
Get the values of a HTTP request header. |
|
MultivaluedMap<java.lang.String,java.lang.String> |
getRequestHeaders()
Get the values of HTTP request headers. |
|
RequestScopedInitializer |
getRequestScopedInitializer()
Get a custom container extensions initializer for the current request. |
|
java.net.URI |
getRequestUri()
Get request URI. |
|
ContainerResponseWriter |
getResponseWriter()
Get the container response writer for the current request. |
|
SecurityContext |
getSecurityContext()
|
|
UriInfo |
getUriInfo()
|
|
java.lang.String |
getVaryValue()
Get the value of HTTP Vary response header to be set in the response, or null if no value is to be set. |
|
|
readEntity(java.lang.Class<T> rawType)
Read entity from a context entity input stream. |
|
|
readEntity(java.lang.Class<T> rawType,
java.lang.annotation.Annotation[] annotations)
Read entity from a context entity input stream. |
|
|
readEntity(java.lang.Class<T> rawType,
java.lang.reflect.Type type)
Read entity from a context entity input stream. |
|
|
readEntity(java.lang.Class<T> rawType,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations)
Read entity from a context entity input stream. |
|
void |
removeProperty(java.lang.String name)
|
|
Variant |
selectVariant(java.util.List<Variant> variants)
|
|
void |
setMethod(java.lang.String method)
|
|
void |
setProperty(java.lang.String name,
java.lang.Object object)
|
|
void |
setRequestScopedInitializer(RequestScopedInitializer requestScopedInitializer)
Set a custom container extensions initializer for the current request. |
|
void |
setRequestUri(java.net.URI requestUri)
|
|
void |
setRequestUri(java.net.URI baseUri,
java.net.URI requestUri)
|
|
void |
setSecurityContext(SecurityContext context)
|
|
void |
setUriInfo(UriInfo uriInfo)
|
|
void |
setWriter(ContainerResponseWriter responseWriter)
Set the container response writer for the current request. |
|
| Methods inherited from class org.glassfish.jersey.message.internal.InboundMessageContext |
|---|
bufferEntity, getAllowedMethods, getDate, getEntityStream, getEntityTag, getHeaders, getHeaderString, getIfMatch, getIfNoneMatch, getLanguage, getLastModified, getLength, getLink, getLinkBuilder, getLinks, getLocation, getMediaType, getQualifiedAcceptableLanguages, getQualifiedAcceptableMediaTypes, getQualifiedAcceptCharset, getQualifiedAcceptEncoding, getRequestCookies, getResponseCookies, getWorkers, hasEntity, hasLink, header, headers, headers, headers, headers, readEntity, readEntity, readEntity, readEntity, remove, replace, replaceAll, setEntityStream, setWorkers |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.ws.rs.container.ContainerRequestContext |
|---|
getDate, getEntityStream, getHeaders, getLanguage, getLength, getMediaType, hasEntity, setEntityStream |
| Methods inherited from interface javax.ws.rs.core.HttpHeaders |
|---|
getDate, getHeaderString, getLanguage, getLength, getMediaType |
| Constructor Detail |
|---|
public JerseyContainerRequestContext(java.net.URI baseUri,
java.net.URI requestUri,
java.lang.String httpMethod,
SecurityContext securityContext,
PropertiesDelegate propertiesDelegate)
baseUri - base application URI.requestUri - request URI.httpMethod - request HTTP method name.securityContext - security context of the current request. Must not be null.
The SecurityContext.getUserPrincipal() must return
null if the current request has not been authenticated
by the container.propertiesDelegate - custom properties delegate
to be used by the context.| Method Detail |
|---|
public RequestScopedInitializer getRequestScopedInitializer()
null if not
available.public void setRequestScopedInitializer(RequestScopedInitializer requestScopedInitializer)
requestScopedInitializer - custom container extensions initializer.public ContainerResponseWriter getResponseWriter()
public void setWriter(ContainerResponseWriter responseWriter)
responseWriter - container response writer. Must not be null.public <T> T readEntity(java.lang.Class<T> rawType)
T - entity Java object type.rawType - raw Java entity type.
public <T> T readEntity(java.lang.Class<T> rawType,
java.lang.annotation.Annotation[] annotations)
T - entity Java object type.rawType - raw Java entity type.annotations - entity annotations.
public <T> T readEntity(java.lang.Class<T> rawType,
java.lang.reflect.Type type)
T - entity Java object type.rawType - raw Java entity type.type - generic Java entity type.
public <T> T readEntity(java.lang.Class<T> rawType,
java.lang.reflect.Type type,
java.lang.annotation.Annotation[] annotations)
T - entity Java object type.rawType - raw Java entity type.type - generic Java entity type.annotations - entity annotations.
public java.lang.Object getProperty(java.lang.String name)
getProperty in interface ContainerRequestContextpublic java.util.Enumeration<java.lang.String> getPropertyNames()
getPropertyNames in interface ContainerRequestContext
public void setProperty(java.lang.String name,
java.lang.Object object)
setProperty in interface ContainerRequestContextpublic void removeProperty(java.lang.String name)
removeProperty in interface ContainerRequestContextpublic UriInfo getUriInfo()
getUriInfo in interface ContainerRequestContextpublic void setUriInfo(UriInfo uriInfo)
public java.net.URI getBaseUri()
public java.net.URI getRequestUri()
public void setRequestUri(java.net.URI requestUri)
throws java.lang.IllegalStateException
setRequestUri in interface ContainerRequestContextjava.lang.IllegalStateException
public void setRequestUri(java.net.URI baseUri,
java.net.URI requestUri)
throws java.lang.IllegalStateException
setRequestUri in interface ContainerRequestContextjava.lang.IllegalStateExceptionpublic java.lang.String getPath(boolean decode)
decode - controls whether sequences of escaped octets are decoded
(true) or not (false).
public java.lang.String getMethod()
getMethod in interface ContainerRequestContextgetMethod in interface Request
public void setMethod(java.lang.String method)
throws java.lang.IllegalStateException
setMethod in interface ContainerRequestContextjava.lang.IllegalStateExceptionpublic SecurityContext getSecurityContext()
getSecurityContext in interface ContainerRequestContextpublic void setSecurityContext(SecurityContext context)
setSecurityContext in interface ContainerRequestContextpublic Request getRequest()
getRequest in interface ContainerRequestContextpublic void abortWith(Response response)
abortWith in interface ContainerRequestContextpublic Response getAbortResponse()
null otherwise.
null otherwise.public java.util.Map<java.lang.String,Cookie> getCookies()
getCookies in interface ContainerRequestContextgetCookies in interface HttpHeaderspublic java.util.List<MediaType> getAcceptableMediaTypes()
getAcceptableMediaTypes in interface ContainerRequestContextgetAcceptableMediaTypes in interface HttpHeaderspublic java.util.List<java.util.Locale> getAcceptableLanguages()
getAcceptableLanguages in interface ContainerRequestContextgetAcceptableLanguages in interface HttpHeaders
public Variant selectVariant(java.util.List<Variant> variants)
throws java.lang.IllegalArgumentException
selectVariant in interface Requestjava.lang.IllegalArgumentExceptionpublic java.lang.String getVaryValue()
null if no value is to be set.
null otherwise.public Response.ResponseBuilder evaluatePreconditions(EntityTag eTag)
evaluatePreconditions in interface Requestpublic Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
evaluatePreconditions in interface Request
public Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified,
EntityTag eTag)
evaluatePreconditions in interface Requestpublic Response.ResponseBuilder evaluatePreconditions()
evaluatePreconditions in interface Requestpublic java.util.List<java.lang.String> getRequestHeader(java.lang.String name)
getRequestHeaders().get(name).
getRequestHeader in interface HttpHeadersname - the header name, case insensitive.
java.lang.IllegalStateException - if called outside the scope of a request.public MultivaluedMap<java.lang.String,java.lang.String> getRequestHeaders()
null.
getRequestHeaders in interface HttpHeadersjava.lang.IllegalStateException - if called outside the scope of a request.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||