Package org.jboss.resteasy.specimpl
Class RequestImpl
java.lang.Object
org.jboss.resteasy.specimpl.RequestImpl
- All Implemented Interfaces:
Request
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionconvertEtag(List<String> tags) Evaluate request preconditions for a resource that does not currently exist.Evaluate request preconditions based on the passed in value.evaluatePreconditions(Date lastModified) Evaluate request preconditions based on the passed in value.evaluatePreconditions(Date lastModified, EntityTag eTag) Evaluate request preconditions based on the passed in value.Get the request method, e.g.ifModifiedSince(String strDate, Date lastModified) ifNoneMatch(List<EntityTag> ifMatch, EntityTag eTag) ifUnmodifiedSince(String strDate, Date lastModified) selectVariant(List<Variant> variants) Select the representation variant that best matches the request.
-
Constructor Details
-
RequestImpl
-
-
Method Details
-
getMethod
Description copied from interface:RequestGet the request method, e.g. GET, POST, etc. -
getFormParameters
-
selectVariant
Description copied from interface:RequestSelect the representation variant that best matches the request. Returnsnullin case there is no matching variant in the list.More explicit variants are chosen ahead of less explicit ones. A vary header is computed from the supplied list and automatically added to the response.
- Specified by:
selectVariantin interfaceRequest- Parameters:
variants- a list of Variant that describe all of the available representation variants.- Returns:
- the variant that best matches the request or
nullif there's no match. - Throws:
IllegalArgumentException- if variants is empty ornull.- See Also:
-
convertEtag
-
ifMatch
-
ifNoneMatch
-
evaluatePreconditions
Description copied from interface:RequestEvaluate request preconditions based on the passed in value.- Specified by:
evaluatePreconditionsin interfaceRequest- Parameters:
eTag- an ETag for the current state of the resource- Returns:
nullif the preconditions are met or aResponseBuilderset with the appropriate status if the preconditions are not met. A returnedResponseBuilderwill include an ETag header set with the value of eTag, provided none of the precondition evaluation has failed, in which case the ETag header would not be included and the status code of the returnedResponseBuilderwould be set toResponse.Status.PRECONDITION_FAILED.
-
ifModifiedSince
-
ifUnmodifiedSince
-
evaluatePreconditions
Description copied from interface:RequestEvaluate request preconditions based on the passed in value.- Specified by:
evaluatePreconditionsin interfaceRequest- Parameters:
lastModified- a date that specifies the modification date of the resource- Returns:
nullif the preconditions are met or aResponseBuilderset with the appropriate status if the preconditions are not met.
-
evaluatePreconditions
Description copied from interface:RequestEvaluate request preconditions based on the passed in value.- Specified by:
evaluatePreconditionsin interfaceRequest- Parameters:
lastModified- a date that specifies the modification date of the resourceeTag- an ETag for the current state of the resource- Returns:
nullif the preconditions are met or aResponseBuilderset with the appropriate status if the preconditions are not met. A returnedResponseBuilderwill include an ETag header set with the value of eTag, provided none of the precondition evaluation has failed, in which case the ETag header would not be included and the status code of the returnedResponseBuilderwould be set toResponse.Status.PRECONDITION_FAILED.
-
evaluatePreconditions
Description copied from interface:RequestEvaluate request preconditions for a resource that does not currently exist. The primary use of this method is to support the If-Match: * and If-None-Match: * preconditions.Note that precondition
If-None-Match: somethingwill never be considered to have been met, and it is the application's responsibility to enforce any additional method-specific semantics. E.g. aPUTon a resource that does not exist might succeed whereas aGETon 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.- Specified by:
evaluatePreconditionsin interfaceRequest- Returns:
nullif the preconditions are met or aResponseBuilderset with the appropriate status if the preconditions are not met.
-