@Deprecated public class DefaultRequestDirector extends Object implements RequestDirector
RequestDirector.
 The following parameters can be used to customize the behavior of this class:
CoreProtocolPNames.PROTOCOL_VERSIONCoreProtocolPNames.STRICT_TRANSFER_ENCODINGCoreProtocolPNames.HTTP_ELEMENT_CHARSETCoreProtocolPNames.USE_EXPECT_CONTINUECoreProtocolPNames.WAIT_FOR_CONTINUECoreProtocolPNames.USER_AGENTCoreConnectionPNames.SOCKET_BUFFER_SIZECoreConnectionPNames.MAX_LINE_LENGTHCoreConnectionPNames.MAX_HEADER_COUNTCoreConnectionPNames.SO_TIMEOUTCoreConnectionPNames.SO_LINGERCoreConnectionPNames.SO_REUSEADDRCoreConnectionPNames.TCP_NODELAYCoreConnectionPNames.CONNECTION_TIMEOUTCoreConnectionPNames.STALE_CONNECTION_CHECKConnRoutePNames.FORCED_ROUTEConnRoutePNames.LOCAL_ADDRESSConnRoutePNames.DEFAULT_PROXYCookieSpecPNames.DATE_PATTERNSCookieSpecPNames.SINGLE_COOKIE_HEADERAuthPNames.CREDENTIAL_CHARSETClientPNames.COOKIE_POLICYClientPNames.HANDLE_AUTHENTICATIONClientPNames.HANDLE_REDIRECTSClientPNames.MAX_REDIRECTSClientPNames.ALLOW_CIRCULAR_REDIRECTSClientPNames.VIRTUAL_HOSTClientPNames.DEFAULT_HOSTClientPNames.DEFAULT_HEADERSClientPNames.CONN_MANAGER_TIMEOUT| Modifier and Type | Field and Description | 
|---|---|
| protected ClientConnectionManager | connManagerDeprecated.  The connection manager. | 
| protected org.apache.http.protocol.HttpProcessor | httpProcessorDeprecated.  The HTTP protocol processor. | 
| protected ConnectionKeepAliveStrategy | keepAliveStrategyDeprecated.  The keep-alive duration strategy. | 
| protected ManagedClientConnection | managedConnDeprecated.  The currently allocated connection. | 
| protected org.apache.http.params.HttpParams | paramsDeprecated.  The HTTP parameters. | 
| protected AuthenticationHandler | proxyAuthHandlerDeprecated.  The proxy authentication handler. | 
| protected AuthState | proxyAuthStateDeprecated.  | 
| protected AuthenticationStrategy | proxyAuthStrategyDeprecated.  The proxy authentication handler. | 
| protected RedirectHandler | redirectHandlerDeprecated.  The redirect handler. | 
| protected RedirectStrategy | redirectStrategyDeprecated.  The redirect strategy. | 
| protected org.apache.http.protocol.HttpRequestExecutor | requestExecDeprecated.  The request executor. | 
| protected HttpRequestRetryHandler | retryHandlerDeprecated.  The request retry handler. | 
| protected org.apache.http.ConnectionReuseStrategy | reuseStrategyDeprecated.  The connection re-use strategy. | 
| protected HttpRoutePlanner | routePlannerDeprecated.  The route planner. | 
| protected AuthenticationHandler | targetAuthHandlerDeprecated.  The target authentication handler. | 
| protected AuthState | targetAuthStateDeprecated.  | 
| protected AuthenticationStrategy | targetAuthStrategyDeprecated.  The target authentication handler. | 
| protected UserTokenHandler | userTokenHandlerDeprecated.  The user token handler. | 
| Constructor and Description | 
|---|
| DefaultRequestDirector(org.apache.http.protocol.HttpRequestExecutor requestExec,
                      ClientConnectionManager conman,
                      org.apache.http.ConnectionReuseStrategy reustrat,
                      ConnectionKeepAliveStrategy kastrat,
                      HttpRoutePlanner rouplan,
                      org.apache.http.protocol.HttpProcessor httpProcessor,
                      HttpRequestRetryHandler retryHandler,
                      RedirectHandler redirectHandler,
                      AuthenticationHandler targetAuthHandler,
                      AuthenticationHandler proxyAuthHandler,
                      UserTokenHandler userTokenHandler,
                      org.apache.http.params.HttpParams params)Deprecated.  | 
| DefaultRequestDirector(org.apache.commons.logging.Log log,
                      org.apache.http.protocol.HttpRequestExecutor requestExec,
                      ClientConnectionManager conman,
                      org.apache.http.ConnectionReuseStrategy reustrat,
                      ConnectionKeepAliveStrategy kastrat,
                      HttpRoutePlanner rouplan,
                      org.apache.http.protocol.HttpProcessor httpProcessor,
                      HttpRequestRetryHandler retryHandler,
                      RedirectStrategy redirectStrategy,
                      AuthenticationHandler targetAuthHandler,
                      AuthenticationHandler proxyAuthHandler,
                      UserTokenHandler userTokenHandler,
                      org.apache.http.params.HttpParams params)Deprecated.  | 
| DefaultRequestDirector(org.apache.commons.logging.Log log,
                      org.apache.http.protocol.HttpRequestExecutor requestExec,
                      ClientConnectionManager conman,
                      org.apache.http.ConnectionReuseStrategy reustrat,
                      ConnectionKeepAliveStrategy kastrat,
                      HttpRoutePlanner rouplan,
                      org.apache.http.protocol.HttpProcessor httpProcessor,
                      HttpRequestRetryHandler retryHandler,
                      RedirectStrategy redirectStrategy,
                      AuthenticationStrategy targetAuthStrategy,
                      AuthenticationStrategy proxyAuthStrategy,
                      UserTokenHandler userTokenHandler,
                      org.apache.http.params.HttpParams params)Deprecated.  | 
| Modifier and Type | Method and Description | 
|---|---|
| protected org.apache.http.HttpRequest | createConnectRequest(HttpRoute route,
                    org.apache.http.protocol.HttpContext context)Deprecated.  Creates the CONNECT request for tunnelling. | 
| protected boolean | createTunnelToProxy(HttpRoute route,
                   int hop,
                   org.apache.http.protocol.HttpContext context)Deprecated.  Creates a tunnel to an intermediate proxy. | 
| protected boolean | createTunnelToTarget(HttpRoute route,
                    org.apache.http.protocol.HttpContext context)Deprecated.  Creates a tunnel to the target server. | 
| protected HttpRoute | determineRoute(org.apache.http.HttpHost targetHost,
              org.apache.http.HttpRequest request,
              org.apache.http.protocol.HttpContext context)Deprecated.  Determines the route for a request. | 
| protected void | establishRoute(HttpRoute route,
              org.apache.http.protocol.HttpContext context)Deprecated.  Establishes the target route. | 
| org.apache.http.HttpResponse | execute(org.apache.http.HttpHost targetHost,
       org.apache.http.HttpRequest request,
       org.apache.http.protocol.HttpContext context)Deprecated.  Executes a request. | 
| protected RoutedRequest | handleResponse(RoutedRequest roureq,
              org.apache.http.HttpResponse response,
              org.apache.http.protocol.HttpContext context)Deprecated.  Analyzes a response to check need for a followup. | 
| protected void | releaseConnection()Deprecated.  Returns the connection back to the connection manager
 and prepares for retrieving a new connection during
 the next request. | 
| protected void | rewriteRequestURI(RequestWrapper request,
                 HttpRoute route)Deprecated.  | 
protected final ClientConnectionManager connManager
protected final HttpRoutePlanner routePlanner
protected final org.apache.http.ConnectionReuseStrategy reuseStrategy
protected final ConnectionKeepAliveStrategy keepAliveStrategy
protected final org.apache.http.protocol.HttpRequestExecutor requestExec
protected final org.apache.http.protocol.HttpProcessor httpProcessor
protected final HttpRequestRetryHandler retryHandler
protected final RedirectHandler redirectHandler
protected final RedirectStrategy redirectStrategy
protected final AuthenticationHandler targetAuthHandler
protected final AuthenticationStrategy targetAuthStrategy
protected final AuthenticationHandler proxyAuthHandler
protected final AuthenticationStrategy proxyAuthStrategy
protected final UserTokenHandler userTokenHandler
protected final org.apache.http.params.HttpParams params
protected ManagedClientConnection managedConn
protected final AuthState targetAuthState
protected final AuthState proxyAuthState
public DefaultRequestDirector(org.apache.http.protocol.HttpRequestExecutor requestExec,
                      ClientConnectionManager conman,
                      org.apache.http.ConnectionReuseStrategy reustrat,
                      ConnectionKeepAliveStrategy kastrat,
                      HttpRoutePlanner rouplan,
                      org.apache.http.protocol.HttpProcessor httpProcessor,
                      HttpRequestRetryHandler retryHandler,
                      RedirectHandler redirectHandler,
                      AuthenticationHandler targetAuthHandler,
                      AuthenticationHandler proxyAuthHandler,
                      UserTokenHandler userTokenHandler,
                      org.apache.http.params.HttpParams params)
public DefaultRequestDirector(org.apache.commons.logging.Log log,
                      org.apache.http.protocol.HttpRequestExecutor requestExec,
                      ClientConnectionManager conman,
                      org.apache.http.ConnectionReuseStrategy reustrat,
                      ConnectionKeepAliveStrategy kastrat,
                      HttpRoutePlanner rouplan,
                      org.apache.http.protocol.HttpProcessor httpProcessor,
                      HttpRequestRetryHandler retryHandler,
                      RedirectStrategy redirectStrategy,
                      AuthenticationHandler targetAuthHandler,
                      AuthenticationHandler proxyAuthHandler,
                      UserTokenHandler userTokenHandler,
                      org.apache.http.params.HttpParams params)
public DefaultRequestDirector(org.apache.commons.logging.Log log,
                      org.apache.http.protocol.HttpRequestExecutor requestExec,
                      ClientConnectionManager conman,
                      org.apache.http.ConnectionReuseStrategy reustrat,
                      ConnectionKeepAliveStrategy kastrat,
                      HttpRoutePlanner rouplan,
                      org.apache.http.protocol.HttpProcessor httpProcessor,
                      HttpRequestRetryHandler retryHandler,
                      RedirectStrategy redirectStrategy,
                      AuthenticationStrategy targetAuthStrategy,
                      AuthenticationStrategy proxyAuthStrategy,
                      UserTokenHandler userTokenHandler,
                      org.apache.http.params.HttpParams params)
protected void rewriteRequestURI(RequestWrapper request, HttpRoute route) throws org.apache.http.ProtocolException
org.apache.http.ProtocolExceptionpublic org.apache.http.HttpResponse execute(org.apache.http.HttpHost targetHost,
                                   org.apache.http.HttpRequest request,
                                   org.apache.http.protocol.HttpContext context)
                                     throws org.apache.http.HttpException,
                                            IOException
RequestDirector
 Note: For the time being, a new director is instantiated for each request.
 This is the same behavior as for HttpMethodDirector
 in HttpClient 3.
 
execute in interface RequestDirectortargetHost - 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 executecontext - the context for executing the requestorg.apache.http.HttpException - in case of a problemIOException - in case of an IO problem
                                     or if the connection was abortedprotected void releaseConnection()
protected HttpRoute determineRoute(org.apache.http.HttpHost targetHost, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException
execute(org.apache.http.HttpHost, org.apache.http.HttpRequest, org.apache.http.protocol.HttpContext)
 to determine the route for either the original or a followup request.targetHost - 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 executecontext - the context to use for the execution,
                  never nullorg.apache.http.HttpException - in case of a problemprotected void establishRoute(HttpRoute route, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, IOException
route - the route to establishcontext - the context for the request executionorg.apache.http.HttpException - in case of a problemIOException - in case of an IO problemprotected boolean createTunnelToTarget(HttpRoute route, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, IOException
route - the route to establishcontext - the context for request executiontrue if the tunnelled route is secure,
          false otherwise.
          The implementation here always returns false,
          but derived classes may override.org.apache.http.HttpException - in case of a problemIOException - in case of an IO problemprotected boolean createTunnelToProxy(HttpRoute route, int hop, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, IOException
route - the route to establishhop - the hop in the route to establish now.
                  route.getHopTarget(hop)
                  will return the proxy to tunnel to.context - the context for request executiontrue if the partially tunnelled connection
          is secure, false otherwise.org.apache.http.HttpException - in case of a problemIOException - in case of an IO problemprotected org.apache.http.HttpRequest createConnectRequest(HttpRoute route, org.apache.http.protocol.HttpContext context)
createTunnelToTarget.route - the route to establishcontext - the context for request executionprotected RoutedRequest handleResponse(RoutedRequest roureq, org.apache.http.HttpResponse response, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, IOException
roureq - the request and route.response - the response to analayzecontext - the context used for the current request executionnull if the response should be returned as isorg.apache.http.HttpException - in case of a problemIOException - in case of an IO problemCopyright © 1999–2022 The Apache Software Foundation. All rights reserved.