|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Request
An injectable helper for request processing, all methods throw
java.lang.IllegalStateException if called outside the scope of a request
(e.g. from a provider constructor).
Precondition processing (see the evaluatePreconditions
methods)
can result in either a null
return value to indicate that
preconditions have been met and that the request should continue, or
a non-null return value to indicate that preconditions were not met. In the
event that preconditions were not met, the returned ResponseBuilder
instance will have an appropriate status and will also include a Vary
header if the selectVariant(java.util.List
method was called prior to to calling
evaluatePreconditions
. It is the responsibility of the caller
to check the status and add additional metadata if required. E.g., see
HTTP/1.1, section 10.3.5
for details of the headers that are expected to accompany a 304 Not Modified
response.
Method Summary | |
---|---|
Response.ResponseBuilder |
evaluatePreconditions()
Evaluate request preconditions for a resource that does not currently exist. |
Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified)
Evaluate request preconditions based on the passed in value. |
Response.ResponseBuilder |
evaluatePreconditions(java.util.Date lastModified,
EntityTag eTag)
Evaluate request preconditions based on the passed in value. |
Response.ResponseBuilder |
evaluatePreconditions(EntityTag eTag)
Evaluate request preconditions based on the passed in value. |
java.lang.String |
getMethod()
Get the request method, e.g. |
Variant |
selectVariant(java.util.List<Variant> variants)
Select the representation variant that best matches the request. |
Method Detail |
---|
java.lang.String getMethod()
HttpMethod
Variant selectVariant(java.util.List<Variant> variants) throws java.lang.IllegalArgumentException
variants
- a list of Variant that describe all of the
available representation variants.
java.lang.IllegalArgumentException
- if variants is empty or null
java.lang.IllegalStateException
- if called outside the scope of a requestVariant.VariantListBuilder
Response.ResponseBuilder evaluatePreconditions(EntityTag eTag)
eTag
- an ETag for the current state of the resource
java.lang.IllegalArgumentException
- if eTag is null
java.lang.IllegalStateException
- if called outside the scope of a requestResponse.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
lastModified
- a date that specifies the modification date of the resource
java.lang.IllegalArgumentException
- if lastModified is null
java.lang.IllegalStateException
- if called outside the scope of a requestResponse.ResponseBuilder evaluatePreconditions(java.util.Date lastModified, EntityTag eTag)
lastModified
- a date that specifies the modification date of the resourceeTag
- an ETag for the current state of the resource
java.lang.IllegalArgumentException
- if lastModified or eTag is null
java.lang.IllegalStateException
- if called outside the scope of a requestResponse.ResponseBuilder evaluatePreconditions()
Note that both preconditions If-None-Match: *
and
If-None-Match: something
will always be considered to
have been met and it is the applications responsibility
to enforce any additional method-specific semantics. E.g. a
PUT
on a resource that does not exist might succeed whereas
a GET
on a resource that does not exist would likely result
in a 404 response. It would be the responsibility of the application to
generate the 404 response.
java.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 |
Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.
Generated on 10-February-2011 12:41