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)
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.
getProtocol() Returns the protocol by first returning the baseRef.schemeProtocol
property if it is set, or the resourceRef.schemeProtocol property
otherwise.
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 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.
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.
The host reference.
Returns the protocol by first returning the baseRef.schemeProtocol
property if it is set, or the resourceRef.schemeProtocol property
otherwise.
The protocol or null if not available.
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.
True if a content is available and can be sent.
Sets the authentication response sent by a client to an origin server.
Parameters: response - The authentication response sent by a client to an originserver.
setConfidential
public void setConfidential(boolean confidential)(Code)
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.
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.
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)(Code)
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.