Default implementation of com.good.gd.apache.http.client.RequestDirector. More...
This class replaces the HttpMethodDirector
in HttpClient 3.
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
HttpResponse | execute (HttpHost target, HttpRequest request, HttpContext context) throws HttpException, IOException |
Executes a request. More... | |
Protected Member Functions | |
void | releaseConnection () |
Returns the connection back to the connection manager and prepares for retrieving a new connection during the next request. | |
HttpRoute | determineRoute (HttpHost target, HttpRequest request, HttpContext context) throws HttpException |
Determines the route for a request. More... | |
void | establishRoute (HttpRoute route, HttpContext context) throws HttpException, IOException |
Establishes the target route. More... | |
boolean | createTunnelToTarget (HttpRoute route, HttpContext context) throws HttpException, IOException |
Creates a tunnel to the target server. More... | |
boolean | createTunnelToProxy (HttpRoute route, int hop, HttpContext context) throws HttpException, IOException |
Creates a tunnel to an intermediate proxy. More... | |
HttpRequest | createConnectRequest (HttpRoute route, HttpContext context) |
Creates the CONNECT request for tunnelling. More... | |
RoutedRequest | handleResponse (RoutedRequest roureq, HttpResponse response, HttpContext context) throws HttpException, IOException |
Analyzes a response to check need for a followup. More... | |
Protected Attributes | |
final ClientConnectionManager | connManager |
The connection manager. More... | |
final HttpRoutePlanner | routePlanner |
The route planner. More... | |
final ConnectionReuseStrategy | reuseStrategy |
The connection re-use strategy. More... | |
final ConnectionKeepAliveStrategy | keepAliveStrategy |
The keep-alive duration strategy. More... | |
final HttpRequestExecutor | requestExec |
The request executor. More... | |
final HttpProcessor | httpProcessor |
The HTTP protocol processor. More... | |
final HttpRequestRetryHandler | retryHandler |
The request retry handler. More... | |
final RedirectHandler | redirectHandler |
The redirect handler. More... | |
final HttpParams | params |
The HTTP parameters. More... | |
ManagedClientConnection | managedConn |
The currently allocated connection. More... | |
HttpResponse execute | ( | HttpHost | target, |
HttpRequest | request, | ||
HttpContext | context | ||
) | throws HttpException, IOException |
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 | in case of a problem |
IOException | in case of an IO problem or if the connection was aborted |
Implements RequestDirector.
|
protected |
Called by execute 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 |
|
protected |
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 |
|
protected |
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 |
|
protected |
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 |
|
protected |
Called by createTunnelToTarget .
route | the route to establish |
context | the context for request execution |
|
protected |
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 |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |