org.restlet.data
Class Request

java.lang.Object
  extended by org.restlet.data.Message
      extended by org.restlet.data.Request
Direct Known Subclasses:
WrapperRequest

public class Request
extends Message

Generic request sent by client connectors. It is then received by server connectors and processed by Restlets. This request can also be processed by a chain of Restlets, on both client and server sides. Requests are uniform across all types of connectors, protocols and components.

Author:
Jerome Louvel (contact@noelios.com)
See Also:
Response, Uniform

Constructor Summary
Request()
          Constructor.
Request(Method method, Reference resourceRef)
          Constructor.
Request(Method method, Reference resourceRef, Representation entity)
          Constructor.
Request(Method method, String resourceUri)
          Constructor.
Request(Method method, String resourceUri, Representation entity)
          Constructor.
 
Method Summary
 ChallengeResponse getChallengeResponse()
          Returns the authentication response sent by a client to an origin server.
 ClientInfo getClientInfo()
          Returns the client-specific information.
 Conditions getConditions()
          Returns the conditions applying to this call.
 Series<Cookie> getCookies()
          Returns the cookies provided by the client.
 Reference getHostRef()
          Returns the host reference.
 Method getMethod()
          Returns the method.
 Protocol getProtocol()
          Returns the protocol by first returning the baseRef.schemeProtocol property if it is set, or the resourceRef.schemeProtocol property otherwise.
 Reference getReferrerRef()
          Returns the referrer reference if available.
 Reference getResourceRef()
          Returns the reference of the target resource.
 Reference getRootRef()
          Returns the application root reference.
 boolean isConfidential()
          Indicates if the call came over a confidential channel such as an SSL-secured connection.
 boolean isEntityAvailable()
          Indicates if a content is available and can be sent.
 void setChallengeResponse(ChallengeResponse response)
          Sets the authentication response sent by a client to an origin server.
 void setConfidential(boolean confidential)
          Indicates if the call came over a confidential channel such as an SSL-secured connection.
 void setHostRef(Reference hostRef)
          Sets the host reference.
 void setHostRef(String hostUri)
          Sets the host reference using an URI string.
 void setMethod(Method method)
          Sets the method called.
 void setReferrerRef(Reference referrerRef)
          Sets the referrer reference if available.
 void setReferrerRef(String referrerUri)
          Sets the referrer reference if available using an URI string.
 void setResourceRef(Reference resourceRef)
          Sets the target resource reference.
 void setResourceRef(String resourceUri)
          Sets the target resource reference using an URI string.
 void setRootRef(Reference rootRef)
          Sets the application root reference.
 
Methods inherited from class org.restlet.data.Message
getAttributes, getEntity, getEntityAsDom, getEntityAsForm, getEntityAsObject, getEntityAsSax, setEntity, setEntity, setEntity
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request()
Constructor.


Request

public Request(Method method,
               Reference resourceRef)
Constructor.

Parameters:
method - The call's method.
resourceRef - The resource reference.

Request

public Request(Method method,
               Reference resourceRef,
               Representation entity)
Constructor.

Parameters:
method - The call's method.
resourceRef - The resource reference.
entity - The entity.

Request

public Request(Method method,
               String resourceUri)
Constructor.

Parameters:
method - The call's method.
resourceUri - The resource URI.

Request

public Request(Method method,
               String resourceUri,
               Representation entity)
Constructor.

Parameters:
method - The call's method.
resourceUri - The resource URI.
entity - The entity.
Method Detail

getChallengeResponse

public ChallengeResponse getChallengeResponse()
Returns the authentication response sent by a client to an origin server.

Returns:
The authentication response sent by a client to an origin server.

getClientInfo

public ClientInfo getClientInfo()
Returns the client-specific information.

Returns:
The client-specific information.

getConditions

public Conditions getConditions()
Returns the conditions applying to this call.

Returns:
The conditions applying to this call.

getCookies

public Series<Cookie> getCookies()
Returns the cookies provided by the client.

Returns:
The cookies provided by the client.

getHostRef

public Reference getHostRef()
Returns the host reference. This may be different from the resourceRef's host, for example for URNs and other URIs that don't contain host information.

Returns:
The host reference.

getMethod

public Method getMethod()
Returns the method.

Returns:
The method.

getProtocol

public Protocol getProtocol()
Returns the protocol by first returning the baseRef.schemeProtocol property if it is set, or the resourceRef.schemeProtocol property otherwise.

Returns:
The protocol or null if not available.

getReferrerRef

public Reference getReferrerRef()
Returns the referrer reference if available.

Returns:
The referrer reference.

getResourceRef

public Reference getResourceRef()
Returns the reference of the target resource.

Returns:
The reference of the target resource.

getRootRef

public Reference getRootRef()
Returns the application root reference.

Returns:
The application root reference.

isConfidential

public boolean isConfidential()
Indicates if the call came over a confidential channel such as an SSL-secured connection.

Returns:
True if the call came over a confidential channel.

isEntityAvailable

public boolean isEntityAvailable()
Indicates if a content is available and can be sent. Several conditions must be met: the method must allow the sending of content, the content must exists and have some available data.

Overrides:
isEntityAvailable in class Message
Returns:
True if a content is available and can be sent.

setChallengeResponse

public void setChallengeResponse(ChallengeResponse response)
Sets the authentication response sent by a client to an origin server.

Parameters:
response - The authentication response sent by a client to an origin server.

setConfidential

public void setConfidential(boolean confidential)
Indicates if the call came over a confidential channel such as an SSL-secured connection.

Parameters:
confidential - True if the call came over a confidential channel.

setHostRef

public void setHostRef(Reference hostRef)
Sets the host reference.

Parameters:
hostRef - The host reference.

setHostRef

public void setHostRef(String hostUri)
Sets the host reference using an URI string.

Parameters:
hostUri - The host URI.

setMethod

public void setMethod(Method method)
Sets the method called.

Parameters:
method - The method called.

setReferrerRef

public void setReferrerRef(Reference referrerRef)
Sets the referrer reference if available.

Parameters:
referrerRef - The referrer reference.

setReferrerRef

public void setReferrerRef(String referrerUri)
Sets the referrer reference if available using an URI string.

Parameters:
referrerUri - The referrer URI.

setResourceRef

public void setResourceRef(Reference resourceRef)
Sets the target resource reference. If the reference is relative, it will be resolved as an absolute reference. Also, the context's base reference will be reset. Finally, the reference will be normalized to ensure a consistent handling of the call.

Parameters:
resourceRef - The resource reference.

setResourceRef

public void setResourceRef(String resourceUri)
Sets the target resource reference using an URI string. Note that the URI can be either absolute or relative to the context's base reference.

Parameters:
resourceUri - The resource URI.

setRootRef

public void setRootRef(Reference rootRef)
Sets the application root reference.

Parameters:
rootRef - The application root reference.


Copyright © 2005-2007 Noelios Technologies.