Android
org.apache.http.protocol
public final class

org.apache.http.protocol.BasicHttpProcessor

java.lang.Object
org.apache.http.protocol.BasicHttpProcessor Cloneable HttpProcessor HttpRequestInterceptorList HttpResponseInterceptorList

Keeps lists of interceptors for processing requests and responses.

Summary

Fields

protected      List  requestInterceptors   
protected      List  responseInterceptors   

Public Constructors

            BasicHttpProcessor()

Public Methods

    final      void  addInterceptor(HttpRequestInterceptor interceptor, int index)
    final      void  addInterceptor(HttpRequestInterceptor interceptor)
Same as addRequestInterceptor.
    final      void  addInterceptor(HttpResponseInterceptor interceptor, int index)
    final      void  addInterceptor(HttpResponseInterceptor interceptor)
Same as addResponseInterceptor.
          void  addRequestInterceptor(HttpRequestInterceptor itcp, int index)
Inserts a request interceptor at the specified index.
          void  addRequestInterceptor(HttpRequestInterceptor itcp)
Appends a request interceptor to this list.
          void  addResponseInterceptor(HttpResponseInterceptor itcp, int index)
Inserts a response interceptor at the specified index.
          void  addResponseInterceptor(HttpResponseInterceptor itcp)
Appends a response interceptor to this list.
          void  clearInterceptors()
Clears both interceptor lists maintained by this processor.
          void  clearRequestInterceptors()
Removes all request interceptors from this list.
          void  clearResponseInterceptors()
Removes all response interceptors from this list.
          Object  clone()
Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.
          BasicHttpProcessor  copy()
Creates a copy of this instance
          HttpRequestInterceptor  getRequestInterceptor(int index)
Obtains a request interceptor from this list.
          int  getRequestInterceptorCount()
Obtains the current size of this list.
          HttpResponseInterceptor  getResponseInterceptor(int index)
Obtains a response interceptor from this list.
          int  getResponseInterceptorCount()
Obtains the current size of this list.
          void  process(HttpRequest request, HttpContext context)
Processes a request.
          void  process(HttpResponse response, HttpContext context)
Processes a response.
          void  removeRequestInterceptorByClass(Class clazz)
Removes all request interceptor of the specified class
          void  removeResponseInterceptorByClass(Class clazz)
Removes all response interceptor of the specified class
          void  setInterceptors(List list)
Sets the interceptor lists.

Protected Methods

          void  copyInterceptors(BasicHttpProcessor target)
Methods inherited from class java.lang.Object
Methods inherited from interface org.apache.http.HttpRequestInterceptor
Methods inherited from interface org.apache.http.HttpResponseInterceptor
Methods inherited from interface org.apache.http.protocol.HttpRequestInterceptorList
Methods inherited from interface org.apache.http.protocol.HttpResponseInterceptorList

Details

Fields

protected List requestInterceptors

protected List responseInterceptors

Public Constructors

public BasicHttpProcessor()

Public Methods

public final void addInterceptor(HttpRequestInterceptor interceptor, int index)

public final void addInterceptor(HttpRequestInterceptor interceptor)

Same as addRequestInterceptor.

Parameters

interceptor the interceptor to add

public final void addInterceptor(HttpResponseInterceptor interceptor, int index)

public final void addInterceptor(HttpResponseInterceptor interceptor)

Same as addResponseInterceptor.

Parameters

interceptor the interceptor to add

public void addRequestInterceptor(HttpRequestInterceptor itcp, int index)

Inserts a request interceptor at the specified index.

public void addRequestInterceptor(HttpRequestInterceptor itcp)

Appends a request interceptor to this list.

public void addResponseInterceptor(HttpResponseInterceptor itcp, int index)

Inserts a response interceptor at the specified index.

public void addResponseInterceptor(HttpResponseInterceptor itcp)

Appends a response interceptor to this list.

public void clearInterceptors()

Clears both interceptor lists maintained by this processor.

public void clearRequestInterceptors()

Removes all request interceptors from this list.

public void clearResponseInterceptors()

Removes all response interceptors from this list.

public Object clone()

Returns a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.

Classes which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.

Returns

  • Object a shallow copy of this object.

public BasicHttpProcessor copy()

Creates a copy of this instance

Returns

  • new instance of the BasicHttpProcessor

public HttpRequestInterceptor getRequestInterceptor(int index)

Obtains a request interceptor from this list.

public int getRequestInterceptorCount()

Obtains the current size of this list.

public HttpResponseInterceptor getResponseInterceptor(int index)

Obtains a response interceptor from this list.

public int getResponseInterceptorCount()

Obtains the current size of this list.

public void process(HttpRequest request, HttpContext context)

Processes a request. On the client side, this step is performed before the request is sent to the server. On the server side, this step is performed on incoming messages before the message body is evaluated.

public void process(HttpResponse response, HttpContext context)

Processes a response. On the server side, this step is performed before the response is sent to the client. On the client side, this step is performed on incoming messages before the message body is evaluated.

public void removeRequestInterceptorByClass(Class clazz)

Removes all request interceptor of the specified class

public void removeResponseInterceptorByClass(Class clazz)

Removes all response interceptor of the specified class

public void setInterceptors(List list)

Sets the interceptor lists. First, both interceptor lists maintained by this processor will be cleared. Subsequently, elements of the argument list that are request interceptors will be added to the request interceptor list. Elements that are response interceptors will be added to the response interceptor list. Elements that are both request and response interceptor will be added to both lists. Elements that are neither request nor response interceptor will be ignored.

Parameters

list the list of request and response interceptors from which to initialize

Protected Methods

protected void copyInterceptors(BasicHttpProcessor target)

Copyright 2007 Google Inc. Build 0.9_r1-98467 - 14 Aug 2008 18:56