|
||||||||||
| 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.ContainerRequest
public class ContainerRequest
Jersey container request context.
An instance of the request context is passed by the container to theApplicationHandler 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_DISPOSITION, CONTENT_ENCODING, CONTENT_ID, 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, RETRY_AFTER, SET_COOKIE, USER_AGENT, VARY, WWW_AUTHENTICATE |
| Constructor Summary | |
|---|---|
ContainerRequest(URI baseUri,
URI requestUri,
String httpMethod,
javax.ws.rs.core.SecurityContext securityContext,
PropertiesDelegate propertiesDelegate)
Create new Jersey container request context. |
|
| Method Summary | ||
|---|---|---|
void |
abortWith(javax.ws.rs.core.Response response)
|
|
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions()
|
|
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions(Date lastModified)
|
|
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions(Date lastModified,
javax.ws.rs.core.EntityTag eTag)
|
|
javax.ws.rs.core.Response.ResponseBuilder |
evaluatePreconditions(javax.ws.rs.core.EntityTag eTag)
|
|
javax.ws.rs.core.Response |
getAbortResponse()
Get the request filter chain aborting response if set, or null otherwise. |
|
List<Locale> |
getAcceptableLanguages()
|
|
List<javax.ws.rs.core.MediaType> |
getAcceptableMediaTypes()
|
|
URI |
getBaseUri()
Get base request URI. |
|
Map<String,javax.ws.rs.core.Cookie> |
getCookies()
|
|
String |
getMethod()
|
|
String |
getPath(boolean decode)
Get the path of the current request relative to the application root (base) URI as a string. |
|
PropertiesDelegate |
getPropertiesDelegate()
Get the underlying properties delegate. |
|
Object |
getProperty(String name)
|
|
Collection<String> |
getPropertyNames()
|
|
javax.ws.rs.core.Request |
getRequest()
|
|
List<String> |
getRequestHeader(String name)
Get the values of a HTTP request header. |
|
javax.ws.rs.core.MultivaluedMap<String,String> |
getRequestHeaders()
Get the values of HTTP request headers. |
|
RequestScopedInitializer |
getRequestScopedInitializer()
Get a custom container extensions initializer for the current request. |
|
URI |
getRequestUri()
Get request URI. |
|
ContainerResponseWriter |
getResponseWriter()
Get the container response writer for the current request. |
|
javax.ws.rs.core.SecurityContext |
getSecurityContext()
|
|
ExtendedUriInfo |
getUriInfo()
|
|
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. |
|
void |
inResponseProcessing()
Notify this request that the response created from this request is already being processed. |
|
|
readEntity(Class<T> rawType)
Read entity from a context entity input stream. |
|
|
readEntity(Class<T> rawType,
Annotation[] annotations)
Read entity from a context entity input stream. |
|
|
readEntity(Class<T> rawType,
Type type)
Read entity from a context entity input stream. |
|
|
readEntity(Class<T> rawType,
Type type,
Annotation[] annotations)
Read entity from a context entity input stream. |
|
void |
removeProperty(String name)
|
|
javax.ws.rs.core.Variant |
selectVariant(List<javax.ws.rs.core.Variant> variants)
|
|
void |
setEntityStream(InputStream input)
|
|
void |
setMethod(String method)
|
|
void |
setMethodWithoutException(String method)
Like setMethod(String) but does not throw IllegalStateException if the method is invoked in other than
pre-matching phase. |
|
void |
setProperty(String name,
Object object)
|
|
void |
setRequestScopedInitializer(RequestScopedInitializer requestScopedInitializer)
Set a custom container extensions initializer for the current request. |
|
void |
setRequestUri(URI requestUri)
|
|
void |
setRequestUri(URI baseUri,
URI requestUri)
|
|
void |
setSecurityContext(javax.ws.rs.core.SecurityContext context)
|
|
void |
setWriter(ContainerResponseWriter responseWriter)
Set the container response writer for the current request. |
|
void |
triggerEvent(RequestEvent.Type requestEventType)
Trigger a new monitoring event for the current request. |
|
| Methods inherited from class org.glassfish.jersey.message.internal.InboundMessageContext |
|---|
bufferEntity, close, 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, setReaderInterceptors, 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, getHeaderString, getLanguage, getLength, getMediaType, hasEntity |
| Methods inherited from interface javax.ws.rs.core.HttpHeaders |
|---|
getDate, getHeaderString, getLanguage, getLength, getMediaType |
| Constructor Detail |
|---|
public ContainerRequest(URI baseUri,
URI requestUri,
String httpMethod,
javax.ws.rs.core.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(Class<T> rawType)
T - entity Java object type.rawType - raw Java entity type.
public <T> T readEntity(Class<T> rawType,
Annotation[] annotations)
T - entity Java object type.rawType - raw Java entity type.annotations - entity annotations.
public <T> T readEntity(Class<T> rawType,
Type type)
T - entity Java object type.rawType - raw Java entity type.type - generic Java entity type.
public <T> T readEntity(Class<T> rawType,
Type type,
Annotation[] annotations)
T - entity Java object type.rawType - raw Java entity type.type - generic Java entity type.annotations - entity annotations.
public Object getProperty(String name)
getProperty in interface javax.ws.rs.container.ContainerRequestContextgetProperty in interface PropertiesDelegatepublic Collection<String> getPropertyNames()
getPropertyNames in interface javax.ws.rs.container.ContainerRequestContextgetPropertyNames in interface PropertiesDelegate
public void setProperty(String name,
Object object)
setProperty in interface javax.ws.rs.container.ContainerRequestContextsetProperty in interface PropertiesDelegatepublic void removeProperty(String name)
removeProperty in interface javax.ws.rs.container.ContainerRequestContextremoveProperty in interface PropertiesDelegatepublic PropertiesDelegate getPropertiesDelegate()
public ExtendedUriInfo getUriInfo()
getUriInfo in interface javax.ws.rs.container.ContainerRequestContextpublic URI getBaseUri()
public URI getRequestUri()
public void setRequestUri(URI requestUri)
throws IllegalStateException
setRequestUri in interface javax.ws.rs.container.ContainerRequestContextIllegalStateException
public void setRequestUri(URI baseUri,
URI requestUri)
throws IllegalStateException
setRequestUri in interface javax.ws.rs.container.ContainerRequestContextIllegalStateExceptionpublic String getPath(boolean decode)
decode - controls whether sequences of escaped octets are decoded
(true) or not (false).
public String getMethod()
getMethod in interface javax.ws.rs.container.ContainerRequestContextgetMethod in interface javax.ws.rs.core.Request
public void setMethod(String method)
throws IllegalStateException
setMethod in interface javax.ws.rs.container.ContainerRequestContextIllegalStateExceptionpublic void triggerEvent(RequestEvent.Type requestEventType)
requestEventType - request event type.public void setMethodWithoutException(String method)
setMethod(String) but does not throw IllegalStateException if the method is invoked in other than
pre-matching phase.
method - HTTP method.public javax.ws.rs.core.SecurityContext getSecurityContext()
getSecurityContext in interface javax.ws.rs.container.ContainerRequestContextpublic void setSecurityContext(javax.ws.rs.core.SecurityContext context)
setSecurityContext in interface javax.ws.rs.container.ContainerRequestContextpublic void setEntityStream(InputStream input)
setEntityStream in interface javax.ws.rs.container.ContainerRequestContextsetEntityStream in class InboundMessageContextpublic javax.ws.rs.core.Request getRequest()
getRequest in interface javax.ws.rs.container.ContainerRequestContextpublic void abortWith(javax.ws.rs.core.Response response)
abortWith in interface javax.ws.rs.container.ContainerRequestContextpublic void inResponseProcessing()
public javax.ws.rs.core.Response getAbortResponse()
null otherwise.
null otherwise.public Map<String,javax.ws.rs.core.Cookie> getCookies()
getCookies in interface javax.ws.rs.container.ContainerRequestContextgetCookies in interface javax.ws.rs.core.HttpHeaderspublic List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
getAcceptableMediaTypes in interface javax.ws.rs.container.ContainerRequestContextgetAcceptableMediaTypes in interface javax.ws.rs.core.HttpHeaderspublic List<Locale> getAcceptableLanguages()
getAcceptableLanguages in interface javax.ws.rs.container.ContainerRequestContextgetAcceptableLanguages in interface javax.ws.rs.core.HttpHeaders
public javax.ws.rs.core.Variant selectVariant(List<javax.ws.rs.core.Variant> variants)
throws IllegalArgumentException
selectVariant in interface javax.ws.rs.core.RequestIllegalArgumentExceptionpublic String getVaryValue()
null if no value is to be set.
null otherwise.public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(javax.ws.rs.core.EntityTag eTag)
evaluatePreconditions in interface javax.ws.rs.core.Requestpublic javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(Date lastModified)
evaluatePreconditions in interface javax.ws.rs.core.Request
public javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions(Date lastModified,
javax.ws.rs.core.EntityTag eTag)
evaluatePreconditions in interface javax.ws.rs.core.Requestpublic javax.ws.rs.core.Response.ResponseBuilder evaluatePreconditions()
evaluatePreconditions in interface javax.ws.rs.core.Requestpublic List<String> getRequestHeader(String name)
getRequestHeaders().get(name).
getRequestHeader in interface javax.ws.rs.core.HttpHeadersname - the header name, case insensitive.
IllegalStateException - if called outside the scope of a request.public javax.ws.rs.core.MultivaluedMap<String,String> getRequestHeaders()
null.
getRequestHeaders in interface javax.ws.rs.core.HttpHeadersIllegalStateException - if called outside the scope of a request.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||