java.lang.Object | |
↳ | org.apache.http.impl.client.DefaultRequestDirector |
Default implementation of RequestDirector
.
The following parameters can be used to customize the behavior of this class:
PROTOCOL_VERSION
STRICT_TRANSFER_ENCODING
HTTP_ELEMENT_CHARSET
USE_EXPECT_CONTINUE
WAIT_FOR_CONTINUE
USER_AGENT
SOCKET_BUFFER_SIZE
MAX_LINE_LENGTH
MAX_HEADER_COUNT
SO_TIMEOUT
SO_LINGER
SO_REUSEADDR
TCP_NODELAY
CONNECTION_TIMEOUT
STALE_CONNECTION_CHECK
FORCED_ROUTE
LOCAL_ADDRESS
DEFAULT_PROXY
DATE_PATTERNS
SINGLE_COOKIE_HEADER
CREDENTIAL_CHARSET
COOKIE_POLICY
HANDLE_AUTHENTICATION
HANDLE_REDIRECTS
MAX_REDIRECTS
ALLOW_CIRCULAR_REDIRECTS
VIRTUAL_HOST
DEFAULT_HOST
DEFAULT_HEADERS
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. | ||||||||||
proxyAuthHandler | The proxy authentication handler. | ||||||||||
proxyAuthState | |||||||||||
redirectHandler | The redirect handler. | ||||||||||
redirectStrategy | The redirect strategy. | ||||||||||
requestExec | The request executor. | ||||||||||
retryHandler | The request retry handler. | ||||||||||
reuseStrategy | The connection re-use strategy. | ||||||||||
routePlanner | The route planner. | ||||||||||
targetAuthHandler | The target authentication handler. | ||||||||||
targetAuthState | |||||||||||
userTokenHandler | The user token handler. |
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 proxy authentication handler.
The connection re-use strategy.
The target authentication handler.
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 |
---|