org.apache.http.impl.client
Class DefaultHttpClient

java.lang.Object
  extended by org.apache.http.impl.client.AbstractHttpClient
      extended by org.apache.http.impl.client.DefaultHttpClient
All Implemented Interfaces:
HttpClient, org.apache.http.protocol.HttpRequestInterceptorList, org.apache.http.protocol.HttpResponseInterceptorList

public class DefaultHttpClient
extends AbstractHttpClient

Default implementation of an HTTP client.
This class replaces HttpClient in HttpClient 3.

Since:
4.0
Version:
$Revision: 585984 $
Author:
Roland Weber, Oleg Kalnichevski

Constructor Summary
DefaultHttpClient()
           
DefaultHttpClient(ClientConnectionManager conman, org.apache.http.params.HttpParams params)
          Creates a new HTTP client from parameters and a connection manager.
DefaultHttpClient(org.apache.http.params.HttpParams params)
           
 
Method Summary
protected  AuthSchemeRegistry createAuthSchemeRegistry()
           
protected  ClientConnectionManager createClientConnectionManager()
           
protected  org.apache.http.ConnectionReuseStrategy createConnectionReuseStrategy()
           
protected  CookieSpecRegistry createCookieSpecRegistry()
           
protected  CookieStore createCookieStore()
           
protected  CredentialsProvider createCredentialsProvider()
           
protected  org.apache.http.protocol.HttpContext createHttpContext()
           
protected  org.apache.http.params.HttpParams createHttpParams()
           
protected  org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
           
protected  HttpRequestRetryHandler createHttpRequestRetryHandler()
           
protected  HttpRoutePlanner createHttpRoutePlanner()
           
protected  AuthenticationHandler createProxyAuthenticationHandler()
           
protected  RedirectHandler createRedirectHandler()
           
protected  AuthenticationHandler createTargetAuthenticationHandler()
           
protected  RoutedRequest determineRoute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context)
          Determines the route for a request.
protected  void populateContext(org.apache.http.protocol.HttpContext context)
           
 
Methods inherited from class org.apache.http.impl.client.AbstractHttpClient
addRequestInterceptor, addRequestInterceptor, addResponseInterceptor, addResponseInterceptor, clearRequestInterceptors, clearResponseInterceptors, determineParams, execute, execute, execute, execute, getAuthSchemes, getConnectionManager, getConnectionReuseStrategy, getCookieSpecs, getCookieStore, getCredentialsProvider, getDefaultContext, getHttpProcessor, getHttpRequestRetryHandler, getParams, getProxyAuthenticationHandler, getRedirectHandler, getRequestInterceptor, getRequestInterceptorCount, getResponseInterceptor, getResponseInterceptorCount, getRoutePlanner, getTargetAuthenticationHandler, removeRequestInterceptorByClass, removeResponseInterceptorByClass, setAuthSchemes, setCookieSpecs, setCookieStore, setCredentialsProvider, setHttpRequestRetryHandler, setInterceptors, setParams, setProxyAuthenticationHandler, setRedirectHandler, setReuseStrategy, setRoutePlanner, setTargetAuthenticationHandler
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultHttpClient

public DefaultHttpClient(ClientConnectionManager conman,
                         org.apache.http.params.HttpParams params)
Creates a new HTTP client from parameters and a connection manager.

Parameters:
params - the parameters
conman - the connection manager

DefaultHttpClient

public DefaultHttpClient(org.apache.http.params.HttpParams params)

DefaultHttpClient

public DefaultHttpClient()
Method Detail

createHttpParams

protected org.apache.http.params.HttpParams createHttpParams()
Specified by:
createHttpParams in class AbstractHttpClient

createClientConnectionManager

protected ClientConnectionManager createClientConnectionManager()
Specified by:
createClientConnectionManager in class AbstractHttpClient

createHttpContext

protected org.apache.http.protocol.HttpContext createHttpContext()
Specified by:
createHttpContext in class AbstractHttpClient

createConnectionReuseStrategy

protected org.apache.http.ConnectionReuseStrategy createConnectionReuseStrategy()
Specified by:
createConnectionReuseStrategy in class AbstractHttpClient

createAuthSchemeRegistry

protected AuthSchemeRegistry createAuthSchemeRegistry()
Specified by:
createAuthSchemeRegistry in class AbstractHttpClient

createCookieSpecRegistry

protected CookieSpecRegistry createCookieSpecRegistry()
Specified by:
createCookieSpecRegistry in class AbstractHttpClient

createHttpProcessor

protected org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
Specified by:
createHttpProcessor in class AbstractHttpClient

createHttpRequestRetryHandler

protected HttpRequestRetryHandler createHttpRequestRetryHandler()
Specified by:
createHttpRequestRetryHandler in class AbstractHttpClient

createRedirectHandler

protected RedirectHandler createRedirectHandler()
Specified by:
createRedirectHandler in class AbstractHttpClient

createTargetAuthenticationHandler

protected AuthenticationHandler createTargetAuthenticationHandler()
Specified by:
createTargetAuthenticationHandler in class AbstractHttpClient

createProxyAuthenticationHandler

protected AuthenticationHandler createProxyAuthenticationHandler()
Specified by:
createProxyAuthenticationHandler in class AbstractHttpClient

createCookieStore

protected CookieStore createCookieStore()
Specified by:
createCookieStore in class AbstractHttpClient

createCredentialsProvider

protected CredentialsProvider createCredentialsProvider()
Specified by:
createCredentialsProvider in class AbstractHttpClient

populateContext

protected void populateContext(org.apache.http.protocol.HttpContext context)
Specified by:
populateContext in class AbstractHttpClient

determineRoute

protected RoutedRequest determineRoute(org.apache.http.HttpHost target,
                                       org.apache.http.HttpRequest request,
                                       org.apache.http.protocol.HttpContext context)
                                throws org.apache.http.HttpException
Description copied from class: AbstractHttpClient
Determines the route for a request. Called by execute(urirequest, context) to map to execute(roureq, context).

Specified by:
determineRoute in class AbstractHttpClient
Parameters:
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
Returns:
the request along with the route it should take
Throws:
org.apache.http.HttpException - in case of a problem

createHttpRoutePlanner

protected HttpRoutePlanner createHttpRoutePlanner()
Specified by:
createHttpRoutePlanner in class AbstractHttpClient


Copyright © 2000-2007 Apache Software Foundation. All Rights Reserved.