Class AbstractHttpClient

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable, HttpClient
    Direct Known Subclasses:
    DefaultHttpClient

    @Contract(threading=SAFE_CONDITIONAL)
    @Deprecated
    public abstract class AbstractHttpClient
    extends CloseableHttpClient
    Deprecated.
    Base class for HttpClient implementations. This class acts as a facade to a number of special purpose handler or strategy implementations responsible for handling of a particular aspect of the HTTP protocol such as redirect or authentication handling or making decision about connection persistence and keep alive duration. This enables the users to selectively replace default implementation of those aspects with custom, application specific ones. This class also provides factory methods to instantiate those objects:

    This class also maintains a list of protocol interceptors intended for processing outgoing requests and incoming responses and provides methods for managing those interceptors. New protocol interceptors can be introduced to the protocol processor chain or removed from it if needed. Internally protocol interceptors are stored in a simple ArrayList. They are executed in the same natural order as they are added to the list.

    AbstractHttpClient is thread safe. It is recommended that the same instance of this class is reused for multiple request executions. When an instance of DefaultHttpClient is no longer needed and is about to go out of scope the connection manager associated with it must be shut down by calling ClientConnectionManager.shutdown()!

    Since:
    4.0
    • Method Detail

      • getParams

        public final HttpParams getParams()
        Deprecated.
        Description copied from interface: HttpClient
        Obtains the parameters for this client. These parameters will become defaults for all requests being executed with this client, and for the parameters of dependent objects in this client.
        Returns:
        the default parameters
      • setParams

        public void setParams​(HttpParams params)
        Deprecated.
        Replaces the parameters. The implementation here does not update parameters of dependent objects.
        Parameters:
        params - the new default parameters
      • getConnectionManager

        public final ClientConnectionManager getConnectionManager()
        Deprecated.
        Description copied from interface: HttpClient
        Obtains the connection manager used by this client.
        Returns:
        the connection manager
      • setAuthSchemes

        public void setAuthSchemes​(AuthSchemeRegistry registry)
        Deprecated.
      • setConnectionBackoffStrategy

        public void setConnectionBackoffStrategy​(ConnectionBackoffStrategy strategy)
        Deprecated.
      • getBackoffManager

        public final BackoffManager getBackoffManager()
        Deprecated.
      • setBackoffManager

        public void setBackoffManager​(BackoffManager manager)
        Deprecated.
      • setCookieSpecs

        public void setCookieSpecs​(CookieSpecRegistry registry)
        Deprecated.
      • setHttpRequestRetryHandler

        public void setHttpRequestRetryHandler​(HttpRequestRetryHandler handler)
        Deprecated.
      • getRedirectHandler

        @Deprecated
        public final RedirectHandler getRedirectHandler()
        Deprecated.
        (4.1) do not use
      • setRedirectHandler

        @Deprecated
        public void setRedirectHandler​(RedirectHandler handler)
        Deprecated.
        (4.1) do not use
      • getRedirectStrategy

        public final RedirectStrategy getRedirectStrategy()
        Deprecated.
        Since:
        4.1
      • setRedirectStrategy

        public void setRedirectStrategy​(RedirectStrategy strategy)
        Deprecated.
        Since:
        4.1
      • getTargetAuthenticationHandler

        @Deprecated
        public final AuthenticationHandler getTargetAuthenticationHandler()
        Deprecated.
        (4.2) do not use
      • setTargetAuthenticationHandler

        @Deprecated
        public void setTargetAuthenticationHandler​(AuthenticationHandler handler)
        Deprecated.
        (4.2) do not use
      • getTargetAuthenticationStrategy

        public final AuthenticationStrategy getTargetAuthenticationStrategy()
        Deprecated.
        Since:
        4.2
      • setTargetAuthenticationStrategy

        public void setTargetAuthenticationStrategy​(AuthenticationStrategy strategy)
        Deprecated.
        Since:
        4.2
      • getProxyAuthenticationHandler

        @Deprecated
        public final AuthenticationHandler getProxyAuthenticationHandler()
        Deprecated.
        (4.2) do not use
      • setProxyAuthenticationHandler

        @Deprecated
        public void setProxyAuthenticationHandler​(AuthenticationHandler handler)
        Deprecated.
        (4.2) do not use
      • getProxyAuthenticationStrategy

        public final AuthenticationStrategy getProxyAuthenticationStrategy()
        Deprecated.
        Since:
        4.2
      • setProxyAuthenticationStrategy

        public void setProxyAuthenticationStrategy​(AuthenticationStrategy strategy)
        Deprecated.
        Since:
        4.2
      • getCookieStore

        public final CookieStore getCookieStore()
        Deprecated.
      • setCookieStore

        public void setCookieStore​(CookieStore cookieStore)
        Deprecated.
      • getCredentialsProvider

        public final CredentialsProvider getCredentialsProvider()
        Deprecated.
      • setCredentialsProvider

        public void setCredentialsProvider​(CredentialsProvider credsProvider)
        Deprecated.
      • setRoutePlanner

        public void setRoutePlanner​(HttpRoutePlanner routePlanner)
        Deprecated.
      • getUserTokenHandler

        public final UserTokenHandler getUserTokenHandler()
        Deprecated.
      • setUserTokenHandler

        public void setUserTokenHandler​(UserTokenHandler handler)
        Deprecated.
      • getResponseInterceptorCount

        public int getResponseInterceptorCount()
        Deprecated.
      • getRequestInterceptorCount

        public int getRequestInterceptorCount()
        Deprecated.
      • addResponseInterceptor

        public void addResponseInterceptor​(HttpResponseInterceptor itcp,
                                           int index)
        Deprecated.
      • clearResponseInterceptors

        public void clearResponseInterceptors()
        Deprecated.
      • removeResponseInterceptorByClass

        public void removeResponseInterceptorByClass​(java.lang.Class<? extends HttpResponseInterceptor> clazz)
        Deprecated.
      • addRequestInterceptor

        public void addRequestInterceptor​(HttpRequestInterceptor itcp,
                                          int index)
        Deprecated.
      • clearRequestInterceptors

        public void clearRequestInterceptors()
        Deprecated.
      • removeRequestInterceptorByClass

        public void removeRequestInterceptorByClass​(java.lang.Class<? extends HttpRequestInterceptor> clazz)
        Deprecated.
      • close

        public void close()
        Deprecated.