Client connectors
Configuration
Here are the commons parameters dedicated to HTTP client connectors.
Here is a sample code showing how to set such a parameter.
Client client = new Client(Protocol.HTTP);
client.getContext().getParameters.add("converter",
"com.noelios.restlet.http.HttpClientConverter");
Apache HTTP Client
This connector is based on Apache Commons HTTP client. It provides an HTTP and HTTPS client connector with advanced multi-threading and connection reuse support.
As pointed out by the Apache HTTPClient tutorial it is crucial to read
entirely each response. It allows to release the underlying connection. Not
doing so may cause future requests to block.
See
Apache
HTTPClient 3.x tutorial.
This connector supports the following protocols: HTTP, HTTPS.
The list of supported specific parameters is available in the javadocs:
Here is the list of dependencies of this connector:
Net
This connector is fully based on the JDK and more precisely on java.net.HttpURLConnection class.
This connector supports the following protocols: HTTP, HTTPS.
The list of supported specific parameters is available in the javadocs:
JavaMail
This connector is based on JavaMail that provides a platform-independent and protocol-independent framework to build mail and messaging applications.
This connector supports the following protocols: SMTP, SMTPS.
The mail and its properties (sender, recipient, subject, content, etc) have to be specified as an XML representation. Please refer to the JavaMail client javadocs for more details.
Here is the list of dependencies of this connector:
JDBC
This connector is a client to a JDBC database. It is based on the JDBC Api developped by Sun Microsystems and shipped with the JDK. Database connections are optionally pooled using Apache Commons DBCP. In this case, a different connection pool is created for each unique combination of JDBC URI and connection properties.
This connector supports the following protocol: JDBC.
The SQL request and other kinds of parameters (such as pooling) are passed to
the client connector via an XML representation. Please refer to the
JDBC
client javadocs for more details.
The Response provides the result of the SQL request as a RowSetRepresentation
which is a kind of XML representation of the ResultSet instance wrapped either
in a JdbcResult or in a WebRowSet instance. See the
RowSetRepresentation
for more details.
Here is the list of dependencies of this connector:
NRE Local client
This internal connector is shipped with the Noelios Restlet Engine distribution and gives access to non-remote resources located on a local file system or managed by a classloader.
This connector supports the following protocols: FILE, CLAP.
FILE is a standard scheme to access to representations stored in the file system (e.g.: "file:///d:/temp/fichier.txt", "file:///tmp/fichier.txt"). CLAP (ClassLoader Access Protocol) is a custom scheme to access to representations via classloaders (e.g.: clap://thread/org/restlet/Restlet.class). This protocol accepts three kinds of authority :
- class: the resources will be resolved from the classloader associated with the local class.
- system: the resources will be resolved from the system's classloader.
- thread: the resources will be resolved from the current thread's classloader.
The "local" Reference instances can be easily created via the
LocalReference
class.
The list of supported parameters is available in the javadocs:

There are no comments.