|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.Helper<T>
com.noelios.restlet.ConnectorHelper<Client>
com.noelios.restlet.ClientHelper
com.noelios.restlet.http.HttpClientHelper
com.noelios.restlet.ext.httpclient.HttpClientHelper
public class HttpClientHelper
HTTP client connector using the HttpMethodCall and Apache HTTP Client project. Note that the response must be fully read in all cases in order to surely release the underlying connection. Not doing so may cause future requests to block. Here is the list of parameters that are supported:
Parameter name | Value type | Default value | Description |
---|---|---|---|
followRedirects | boolean | false | If true, the protocol will automatically follow redirects. If false, the protocol will not automatically follow redirects. |
maxConnectionsPerHost | int | 2 (uses HttpClient's default) | The maximum number of connections that will be created for any particular host. |
maxTotalConnections | int | 20 (uses HttpClient's default) | The maximum number of active connections. |
connectionManagerTimeout | int | 0 | The timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager. |
stopIdleTimeout | int | 1000 | The minimum idle time, in milliseconds, for connections to be closed when stopping the connector. |
readTimeout | int | 0 | Sets the read timeout to a specified timeout, in milliseconds. A timeout of zero is interpreted as an infinite timeout. |
retryHandler | String | null | Class name of the retry handler to use instead of HTTP Client default behavior. The given class name must implement the org.apache.commons.httpclient.HttpMethodRetryHandler interface and have a default constructor |
tcpNoDelay | boolean | false | Indicate if Nagle's TCP_NODELAY algorithm should be used. |
Constructor Summary | |
---|---|
HttpClientHelper(Client client)
Constructor. |
Method Summary | |
---|---|
HttpClientCall |
create(Request request)
Creates a low-level HTTP client call from a high-level uniform call. |
int |
getConnectionManagerTimeout()
Returns the timeout in milliseconds used when retrieving an HTTP connection from the HTTP connection manager. |
HttpClient |
getHttpClient()
|
int |
getMaxConnectionsPerHost()
Returns the maximum number of connections that will be created for any particular host. |
int |
getMaxTotalConnections()
Returns the maximum number of active connections. |
int |
getReadTimeout()
Returns the read timeout value. |
java.lang.String |
getRetryHandler()
Returns the class name of the retry handler to use instead of HTTP Client default behavior. |
int |
getStopIdleTimeout()
Returns the minimum idle time, in milliseconds, for connections to be closed when stopping the connector. |
boolean |
getTcpNoDelay()
Indicates if the protocol will use Nagle's algorithm |
boolean |
isFollowRedirects()
Indicates if the protocol will automatically follow redirects. |
void |
start()
|
void |
stop()
|
Methods inherited from class com.noelios.restlet.http.HttpClientHelper |
---|
getConverter, handle, setConverter |
Methods inherited from class com.noelios.restlet.ClientHelper |
---|
getConnectTimeout |
Methods inherited from class com.noelios.restlet.ConnectorHelper |
---|
getProtocols, update |
Methods inherited from class org.restlet.util.Helper |
---|
getAttributes, getContext, getHelped, getHelpedParameters, getLogger, setHelped |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HttpClientHelper(Client client)
client
- The client to help.Method Detail |
---|
public HttpClientCall create(Request request)
create
in class HttpClientHelper
request
- The high-level request.
public int getConnectionManagerTimeout()
public HttpClient getHttpClient()
public int getMaxConnectionsPerHost()
public int getMaxTotalConnections()
public int getReadTimeout()
public java.lang.String getRetryHandler()
public int getStopIdleTimeout()
public boolean isFollowRedirects()
public boolean getTcpNoDelay()
Socket.setTcpNoDelay(boolean)
public void start() throws java.lang.Exception
start
in class ConnectorHelper<Client>
java.lang.Exception
public void stop() throws java.lang.Exception
stop
in class ConnectorHelper<Client>
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |