public class ContainerRequest extends Object implements GenericContainerRequest
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTHACCEPT_RANGES, ALLOW, AUTHORIZATION, CONTENTLENGTH, CONTENTRANGE, CONTENTTYPE, DASL, DAV, DEPTH, DESTINATION, FORWARDED_HOST, FORWARDED_PROTO, IF, JAXRS_BODY_PROVIDED, LOCKTOKEN, MSAUTHORVIA, MULTIPART_BYTERANGES, OVERWRITE, RANGE, TIMEOUT, TRANSFER_ENCODING, USERAGENT, X_HTTP_METHOD_OVERRIDEACCEPT, ACCEPT_CHARSET, ACCEPT_ENCODING, ACCEPT_LANGUAGE, 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 and Description |
|---|
ContainerRequest(String method,
URI requestUri,
URI baseUri,
InputStream entityStream,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
javax.ws.rs.core.SecurityContext securityContext)
Constructs new instance of ContainerRequest.
|
| Modifier and Type | Method and Description |
|---|---|
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) |
List<Locale> |
getAcceptableLanguages()
If accept-language header does not present or its length is null then default language list will be returned.
|
javax.ws.rs.core.MediaType |
getAcceptableMediaType(List<javax.ws.rs.core.MediaType> mediaTypes)
Select the first media type, from a given list of media types, that is most acceptable according to the requested acceptable media
types.
|
List<javax.ws.rs.core.MediaType> |
getAcceptableMediaTypes()
If accept header does not presents or its length is null then list with one element will be returned.
|
String |
getAuthenticationScheme() |
URI |
getBaseUri() |
List<String> |
getCookieHeaders()
Get read-only list of cookie header.
|
Map<String,javax.ws.rs.core.Cookie> |
getCookies() |
Date |
getDate() |
InputStream |
getEntityStream()
Get entity body represented by InputStream.
|
String |
getHeaderString(String name) |
Locale |
getLanguage() |
int |
getLength() |
javax.ws.rs.core.MediaType |
getMediaType() |
String |
getMethod() |
List<String> |
getRequestHeader(String name) |
javax.ws.rs.core.MultivaluedMap<String,String> |
getRequestHeaders() |
URI |
getRequestUri() |
Principal |
getUserPrincipal() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
javax.ws.rs.core.Variant |
selectVariant(List<javax.ws.rs.core.Variant> variants) |
void |
setCookieHeaders(List<String> cookieHeaders)
Set list of cookie headers.
|
void |
setEntityStream(InputStream entityStream)
Set entity body InputStream.
|
void |
setMethod(String method)
Set HTTP method.
|
void |
setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders)
Set HTTP request headers.
|
void |
setUris(URI requestUri,
URI baseUri)
Set new request URI and base URI.
|
public ContainerRequest(String method, URI requestUri, URI baseUri, InputStream entityStream, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, javax.ws.rs.core.SecurityContext securityContext)
method - HTTP methodrequestUri - full request URIbaseUri - base request URIentityStream - request message body as streamhttpHeaders - HTTP headerssecurityContext - SecurityContextpublic javax.ws.rs.core.MediaType getAcceptableMediaType(List<javax.ws.rs.core.MediaType> mediaTypes)
GenericContainerRequestgetAcceptableMediaType in interface GenericContainerRequestmediaTypes - the list of media typespublic List<String> getCookieHeaders()
GenericContainerRequestgetCookieHeaders in interface GenericContainerRequestpublic InputStream getEntityStream()
GenericContainerRequestgetEntityStream in interface GenericContainerRequestpublic URI getRequestUri()
getRequestUri in interface GenericContainerRequestpublic URI getBaseUri()
getBaseUri in interface GenericContainerRequestpublic void setMethod(String method)
GenericContainerRequestsetMethod in interface GenericContainerRequestmethod - HTTP method, i. e. GET, POST, etcpublic void setEntityStream(InputStream entityStream)
GenericContainerRequestsetEntityStream in interface GenericContainerRequestentityStream - request message body as streampublic void setUris(URI requestUri, URI baseUri)
GenericContainerRequestsetUris in interface GenericContainerRequestrequestUri - request URIbaseUri - base URIpublic void setCookieHeaders(List<String> cookieHeaders)
GenericContainerRequestsetCookieHeaders in interface GenericContainerRequestcookieHeaders - list of cookies as sources stringpublic void setRequestHeaders(javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders)
GenericContainerRequestsetRequestHeaders in interface GenericContainerRequesthttpHeaders - read-only case insensitive MultivaluedMappublic String getAuthenticationScheme()
getAuthenticationScheme in interface javax.ws.rs.core.SecurityContextpublic Principal getUserPrincipal()
getUserPrincipal in interface javax.ws.rs.core.SecurityContextpublic boolean isSecure()
isSecure in interface javax.ws.rs.core.SecurityContextpublic boolean isUserInRole(String role)
isUserInRole in interface javax.ws.rs.core.SecurityContextpublic 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.Requestpublic 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 String getMethod()
getMethod in interface javax.ws.rs.core.Requestpublic javax.ws.rs.core.Variant selectVariant(List<javax.ws.rs.core.Variant> variants)
selectVariant in interface javax.ws.rs.core.Requestpublic List<Locale> getAcceptableLanguages()
getAcceptableLanguages in interface javax.ws.rs.core.HttpHeaderspublic List<javax.ws.rs.core.MediaType> getAcceptableMediaTypes()
AcceptMediaType.DEFAULT.
getAcceptableMediaTypes in interface javax.ws.rs.core.HttpHeaderspublic Map<String,javax.ws.rs.core.Cookie> getCookies()
getCookies in interface javax.ws.rs.core.HttpHeaderspublic Date getDate()
getDate in interface javax.ws.rs.core.HttpHeaderspublic int getLength()
getLength in interface javax.ws.rs.core.HttpHeaderspublic Locale getLanguage()
getLanguage in interface javax.ws.rs.core.HttpHeaderspublic javax.ws.rs.core.MediaType getMediaType()
getMediaType in interface javax.ws.rs.core.HttpHeaderspublic List<String> getRequestHeader(String name)
getRequestHeader in interface javax.ws.rs.core.HttpHeaderspublic String getHeaderString(String name)
getHeaderString in interface javax.ws.rs.core.HttpHeadersCopyright © 2015. All rights reserved.