org.jboss.resteasy.specimpl
Class RequestImpl

java.lang.Object
  extended by org.jboss.resteasy.specimpl.RequestImpl
All Implemented Interfaces:
Request

public class RequestImpl
extends java.lang.Object
implements Request

Version:
$Revision: 1 $
Author:
Bill Burke

Constructor Summary
RequestImpl(HttpRequest request)
           
 
Method Summary
 java.util.List<EntityTag> convertEtag(java.util.List<java.lang.String> tags)
           
 java.util.List<java.lang.String> convertString(java.util.List<java.lang.String> tags)
           
 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.
 MultivaluedMap<java.lang.String,java.lang.String> getFormParameters()
           
 java.lang.String getMethod()
          Get the request method, e.g.
 Response.ResponseBuilder ifMatch(java.util.List<EntityTag> ifMatch, EntityTag eTag)
           
 Response.ResponseBuilder ifModifiedSince(java.lang.String strDate, java.util.Date lastModified)
           
 Response.ResponseBuilder ifNoneMatch(java.util.List<EntityTag> ifMatch, EntityTag eTag)
           
 Response.ResponseBuilder ifUnmodifiedSince(java.lang.String strDate, java.util.Date lastModified)
           
static Variant pickVariant(java.util.List<Variant> has, java.util.List<MediaType> accepts, java.util.List<java.lang.String> languages, java.util.List<java.lang.String> encodings)
           
 Variant selectVariant(java.util.List<Variant> variants)
          Select the representation variant that best matches the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestImpl

public RequestImpl(HttpRequest request)
Method Detail

getMethod

public java.lang.String getMethod()
Description copied from interface: Request
Get the request method, e.g. GET, POST, etc.

Specified by:
getMethod in interface Request
Returns:
the request method
See Also:
HttpMethod

getFormParameters

public MultivaluedMap<java.lang.String,java.lang.String> getFormParameters()

selectVariant

public Variant selectVariant(java.util.List<Variant> variants)
                      throws java.lang.IllegalArgumentException
Description copied from interface: Request
Select the representation variant that best matches the request. 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:
selectVariant in interface Request
Parameters:
variants - a list of Variant that describe all of the available representation variants.
Returns:
the variant that best matches the request.
Throws:
java.lang.IllegalArgumentException - if variants is empty or null
See Also:
Variant.VariantListBuilder

pickVariant

public static Variant pickVariant(java.util.List<Variant> has,
                                  java.util.List<MediaType> accepts,
                                  java.util.List<java.lang.String> languages,
                                  java.util.List<java.lang.String> encodings)

convertString

public java.util.List<java.lang.String> convertString(java.util.List<java.lang.String> tags)

convertEtag

public java.util.List<EntityTag> convertEtag(java.util.List<java.lang.String> tags)

ifMatch

public Response.ResponseBuilder ifMatch(java.util.List<EntityTag> ifMatch,
                                        EntityTag eTag)

ifNoneMatch

public Response.ResponseBuilder ifNoneMatch(java.util.List<EntityTag> ifMatch,
                                            EntityTag eTag)

evaluatePreconditions

public Response.ResponseBuilder evaluatePreconditions(EntityTag eTag)
Description copied from interface: Request
Evaluate request preconditions based on the passed in value.

Specified by:
evaluatePreconditions in interface Request
Parameters:
eTag - an ETag for the current state of the resource
Returns:
null if the preconditions are met or a ResponseBuilder set with the appropriate status if the preconditions are not met. A returned ResponseBuilder will include an ETag header set with the value of eTag.

ifModifiedSince

public Response.ResponseBuilder ifModifiedSince(java.lang.String strDate,
                                                java.util.Date lastModified)

ifUnmodifiedSince

public Response.ResponseBuilder ifUnmodifiedSince(java.lang.String strDate,
                                                  java.util.Date lastModified)

evaluatePreconditions

public Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified)
Description copied from interface: Request
Evaluate request preconditions based on the passed in value.

Specified by:
evaluatePreconditions in interface Request
Parameters:
lastModified - a date that specifies the modification date of the resource
Returns:
null if the preconditions are met or a ResponseBuilder set with the appropriate status if the preconditions are not met.

evaluatePreconditions

public Response.ResponseBuilder evaluatePreconditions(java.util.Date lastModified,
                                                      EntityTag eTag)
Description copied from interface: Request
Evaluate request preconditions based on the passed in value.

Specified by:
evaluatePreconditions in interface Request
Parameters:
lastModified - a date that specifies the modification date of the resource
eTag - an ETag for the current state of the resource
Returns:
null if the preconditions are met or a ResponseBuilder set with the appropriate status if the preconditions are not met. A returned ResponseBuilder will include an ETag header set with the value of eTag.


Copyright © 2009. All Rights Reserved.