|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.restlet.util.Helper
com.noelios.restlet.ConnectorHelper
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.
,
Networking
FeaturesConstructor 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. |
int |
getStopIdleTimeout()
Returns the minimum idle time, in milliseconds, for connections to be closed when stopping the connector. |
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 |
---|
getClient, getContext, getLogger, getParameters |
Methods inherited from class com.noelios.restlet.ConnectorHelper |
---|
createContext, getProtocols |
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 HttpClient getHttpClient()
public void start() throws Exception
start
in class ConnectorHelper
Exception
public void stop() throws Exception
stop
in class ConnectorHelper
Exception
public HttpClientCall create(Request request)
create
in class HttpClientHelper
request
- The high-level request.
public boolean isFollowRedirects()
public int getMaxConnectionsPerHost()
public int getMaxTotalConnections()
public int getConnectionManagerTimeout()
public int getStopIdleTimeout()
public int getReadTimeout()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |