Request wrapper. Useful for application developer who need to enrich the
request with application related properties and behavior.
See Also:The decorator (aka
* wrapper) pattern author: Jerome Louvel (contact@noelios.com)
getEntityAsDom() Returns the entity as a DOM representation. Note that this triggers
the parsing of the entity into a reusable DOM document stored in memory.
This method and the related getEntity*() methods can only be invoked
once.
getEntityAsForm() Returns the entity as a DOM representation. Note that this triggers
the parsing of the entity into a reusable DOM document stored in memory.
This method and the related getEntity*() methods can only be invoked
once.
Returns the set of methods allowed on the requested resource. This
property only has to be updated when a status
CLIENT_ERROR_METHOD_NOT_ALLOWED is set.
The list of allowed methods.
Returns a modifiable attributes map that can be used by developers to
save information relative to the message. This is an easier alternative
to the creation of a wrapper instance around the whole message.
In addition, this map is a shared space between the developer and the
connectors. In this case, it is used to exchange information that is not
uniform across all protocols and couldn't therefore be directly included
in the API. For this purpose, all attribute names starting with
"org.restlet" are reserved. Currently the following attributes are used:
Attribute name
Class name
Description
org.restlet.http.headers
org.restlet.data.Form
Server HTTP connectors must provide all request headers and client
HTTP connectors must provide all response headers, exactly as they were
received. In addition, developers can also use this attribute to specify
non-standard headers that should be added to the request or to
the response.
Adding standard HTTP headers is forbidden because it could
conflict with the connector's internal behavior, limit portability or
prevent future optimizations.
Returns the set of selecting dimensions on which the response entity may
vary. If some server-side content negotiation is done, this set should be
properly updated, other it can be left empty.
The set of dimensions on which the response entity may vary.
Returns the entity as a DOM representation. Note that this triggers
the parsing of the entity into a reusable DOM document stored in memory.
This method and the related getEntity*() methods can only be invoked
once.
The entity as a DOM representation.
Returns the entity as a DOM representation. Note that this triggers
the parsing of the entity into a reusable DOM document stored in memory.
This method and the related getEntity*() methods can only be invoked
once.
The entity as a DOM representation.
Returns the entity as a higher-level object. This object is created by
the Application's converter service. If you want to use this method to
facilitate the processing of request entities, you need to provide a
custom implementation of the ConverterService class, overriding the
toObject(Representation) method. Note that this triggers the
parsing of the entity. This method and the related getEntity*()
methods can only be invoked once.
The entity as a higher-level object.
Returns the entity as a SAX representation. Note that this kind of
representation can only be parsed once. If you evaluate an XPath
expression, it can also only be done once. If you need to reuse the
entity multiple times, consider using the getEntityAsDom() method
instead.
The entity as a SAX representation.
Indicates if a content is available and can be sent. Several conditions
must be met: the content must exists and have some available data.
True if a content is available and can be sent.
Permanently redirects the client to a target URI. The client is expected
to reuse the same method for the new request.
Parameters: targetRef - The target URI reference.
redirectPermanent
public void redirectPermanent(String targetUri)(Code)
Permanently redirects the client to a target URI. The client is expected
to reuse the same method for the new request.
Parameters: targetUri - The target URI.
Redirects the client to a different URI that SHOULD be retrieved using a
GET method on that resource. This method exists primarily to allow the
output of a POST-activated script to redirect the user agent to a
selected resource. The new URI is not a substitute reference for the
originally requested resource.
Parameters: targetRef - The target reference.
redirectSeeOther
public void redirectSeeOther(String targetUri)(Code)
Redirects the client to a different URI that SHOULD be retrieved using a
GET method on that resource. This method exists primarily to allow the
output of a POST-activated script to redirect the user agent to a
selected resource. The new URI is not a substitute reference for the
originally requested resource.
Parameters: targetUri - The target URI.
Temporarily redirects the client to a target URI. The client is expected
to reuse the same method for the new request.
Parameters: targetRef - The target reference.
redirectTemporary
public void redirectTemporary(String targetUri)(Code)
Temporarily redirects the client to a target URI. The client is expected
to reuse the same method for the new request.
Parameters: targetUri - The target URI.
Sets the authentication request sent by an origin server to a client.
Parameters: request - The authentication request sent by an origin server to aclient.
Sets the entity from a higher-level object. This object is converted to a
representation using the Application's converter service. If you want to
use this method to facilitate the setting of entities, you need to
provide a custom implementation of the ConverterService class, overriding
the toRepresentation(Object) method.
Parameters: object - The higher-level object.