public interface Request
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<javax.ws.rs.core.Variant>) 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.| Modifier and Type | Method and Description |
|---|---|
Response.ResponseBuilder |
evaluatePreconditions(Date lastModified)
Evaluate request preconditions based on the passed in value.
|
Response.ResponseBuilder |
evaluatePreconditions(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.
|
String |
getMethod()
Get the request method, e.g.
|
Variant |
selectVariant(List<Variant> variants)
Select the representation variant that best matches the request.
|
String getMethod()
HttpMethodVariant selectVariant(List<Variant> variants) throws IllegalArgumentException
variants - a list of Variant that describe all of the
available representation variants.IllegalArgumentException - if variants is empty or nullIllegalStateException - if called outside the scope of a requestVariant.VariantListBuilderResponse.ResponseBuilder evaluatePreconditions(EntityTag eTag)
eTag - an ETag for the current state of the resourceIllegalArgumentException - if eTag is nullIllegalStateException - if called outside the scope of a requestResponse.ResponseBuilder evaluatePreconditions(Date lastModified)
lastModified - a date that specifies the modification date of the resourceIllegalArgumentException - if lastModified is nullIllegalStateException - if called outside the scope of a requestResponse.ResponseBuilder evaluatePreconditions(Date lastModified, EntityTag eTag)
lastModified - a date that specifies the modification date of the resourceeTag - an ETag for the current state of the resourceIllegalArgumentException - if lastModified or eTag is nullIllegalStateException - if called outside the scope of a requestCopyright © 2007–2017 The Apache Software Foundation. All rights reserved.