java.lang.Object | |
↳ | org.apache.http.impl.client.DefaultRequestDirector |
Default implementation of RequestDirector
.
This class replaces the HttpMethodDirector
in HttpClient 3.
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
connManager | The connection manager. | ||||||||||
httpProcessor | The HTTP protocol processor. | ||||||||||
keepAliveStrategy | The keep-alive duration strategy. | ||||||||||
managedConn | The currently allocated connection. | ||||||||||
params | The HTTP parameters. | ||||||||||
redirectHandler | The redirect handler. | ||||||||||
requestExec | The request executor. | ||||||||||
retryHandler | The request retry handler. | ||||||||||
reuseStrategy | The connection re-use strategy. | ||||||||||
routePlanner | The route planner. |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Executes a request.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates the CONNECT request for tunnelling.
| |||||||||||
Creates a tunnel to an intermediate proxy.
| |||||||||||
Creates a tunnel to the target server.
| |||||||||||
Determines the route for a request.
| |||||||||||
Establishes the target route.
| |||||||||||
Analyzes a response to check need for a followup.
| |||||||||||
Returns the connection back to the connection manager
and prepares for retrieving a new connection during
the next request.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.apache.http.client.RequestDirector
|
The keep-alive duration strategy.
The currently allocated connection.
The connection re-use strategy.
Executes a request.
Note:
For the time being, a new director is instantiated for each request.
This is the same behavior as for HttpMethodDirector
in HttpClient 3.
target | the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request. |
---|---|
request | the request to execute |
context | the context for executing the request |
HttpException | |
---|---|
IOException |
Creates the CONNECT request for tunnelling.
Called by createTunnelToTarget
.
route | the route to establish |
---|---|
context | the context for request execution |
Creates a tunnel to an intermediate proxy. This method is not implemented in this class. It just throws an exception here.
route | the route to establish |
---|---|
hop | the hop in the route to establish now.
route.getHopTarget(hop)
will return the proxy to tunnel to. |
context | the context for request execution |
true
if the partially tunnelled connection
is secure, false
otherwise.HttpException | in case of a problem |
---|---|
IOException | in case of an IO problem |
Creates a tunnel to the target server. The connection must be established to the (last) proxy. A CONNECT request for tunnelling through the proxy will be created and sent, the response received and checked. This method does not update the connection with information about the tunnel, that is left to the caller.
route | the route to establish |
---|---|
context | the context for request execution |
true
if the tunnelled route is secure,
false
otherwise.
The implementation here always returns false
,
but derived classes may override.HttpException | in case of a problem |
---|---|
IOException | in case of an IO problem |
Determines the route for a request.
Called by execute(HttpHost, HttpRequest, HttpContext)
to determine the route for either the original or a followup request.
target | the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request. |
---|---|
request | the request to execute |
context | the context to use for the execution,
never null |
HttpException | in case of a problem |
---|
Establishes the target route.
route | the route to establish |
---|---|
context | the context for the request execution |
HttpException | in case of a problem |
---|---|
IOException | in case of an IO problem |
Analyzes a response to check need for a followup.
roureq | the request and route. |
---|---|
response | the response to analayze |
context | the context used for the current request execution |
null
if the response should be returned as isHttpException | in case of a problem |
---|---|
IOException | in case of an IO problem |
Returns the connection back to the connection manager and prepares for retrieving a new connection during the next request.
ProtocolException |
---|