Top Description Fields Constructors Methods
org.apache.http.protocol

public final Class BasicHttpProcessor

extends Object
implements HttpProcessor, HttpRequestInterceptorList, HttpResponseInterceptorList, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, org.apache.http.protocol.HttpResponseInterceptorList, org.apache.http.protocol.HttpRequestInterceptorList, org.apache.http.protocol.HttpProcessor, org.apache.http.HttpResponseInterceptor, org.apache.http.HttpRequestInterceptor
Annotations
@Deprecated
Imports
java.io.IOException, java.util.ArrayList, .Iterator, .List, org.apache.http.HttpException, .HttpRequest, .HttpRequestInterceptor, .HttpResponse, .HttpResponseInterceptor, org.apache.http.util.Args

Deprecated

(4.3)

Default implementation of HttpProcessor.

Please note access to the internal structures of this class is not synchronized and therefore this class may be thread-unsafe.

Since
4.0

Field Summary

Modifier and TypeField and Description
protected final List<HttpRequestInterceptor>
protected final List<HttpResponseInterceptor>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
addInterceptor(final HttpRequestInterceptor interceptor, final int index)

public void
public void
addInterceptor(final HttpResponseInterceptor interceptor, final int index)

public void
addRequestInterceptor(final HttpRequestInterceptor
the request interceptor to add
itcp
)

Implements org.apache.http.protocol.HttpRequestInterceptorList.addRequestInterceptor.

Appends a request interceptor to this list.
public void
addRequestInterceptor(final HttpRequestInterceptor
the request interceptor to add
itcp
,
final int
the index to insert the interceptor at
index
)

Implements org.apache.http.protocol.HttpRequestInterceptorList.addRequestInterceptor.

Inserts a request interceptor at the specified index.
public void
addResponseInterceptor(final HttpResponseInterceptor
the response interceptor to add
itcp
,
final int
the index to insert the interceptor at
index
)

Implements org.apache.http.protocol.HttpResponseInterceptorList.addResponseInterceptor.

Inserts a response interceptor at the specified index.
public void
addResponseInterceptor(final HttpResponseInterceptor
the response interceptor to add
itcp
)

Implements org.apache.http.protocol.HttpResponseInterceptorList.addResponseInterceptor.

Appends a response interceptor to this list.
public void
clearInterceptors()

Clears both interceptor lists maintained by this processor.

public void
public void
public Object
clone()

Overrides java.lang.Object.clone.

Creates and returns a copy of this object.
public BasicHttpProcessor

Returns:

new instance of the BasicHttpProcessor
copy
()

Deprecated as a consequence of BasicHttpProcessor being deprecated.
Creates a copy of this instance
protected void
copyInterceptors(final BasicHttpProcessor
object to be initialised
target
)

Deprecated as a consequence of BasicHttpProcessor being deprecated.
Sets up the target to have the same list of interceptors as the current instance.
public HttpRequestInterceptor
getRequestInterceptor(final int
the index of the interceptor to obtain, 0 for first
index
)

Implements org.apache.http.protocol.HttpRequestInterceptorList.getRequestInterceptor.

Obtains a request interceptor from this list.
public int
public HttpResponseInterceptor
getResponseInterceptor(final int
the index of the interceptor to obtain, 0 for first
index
)

Implements org.apache.http.protocol.HttpResponseInterceptorList.getResponseInterceptor.

Obtains a response interceptor from this list.
public int
public void
process(final HttpRequest
the request to preprocess
request
,
final HttpContext
the context for the request
context
)

Implements org.apache.http.HttpRequestInterceptor.process.

Processes a request.
public void
process(final HttpResponse
the response to postprocess
response
,
final HttpContext
the context for the request
context
)

Implements org.apache.http.HttpResponseInterceptor.process.

Processes a response.
public void
removeRequestInterceptorByClass(final Class<? extends HttpRequestInterceptor>
the class of the instances to be removed.
clazz
)

Implements org.apache.http.protocol.HttpRequestInterceptorList.removeRequestInterceptorByClass.

Removes all request interceptor of the specified class
public void
removeResponseInterceptorByClass(final Class<? extends HttpResponseInterceptor>
the class of the instances to be removed.
clazz
)

Implements org.apache.http.protocol.HttpResponseInterceptorList.removeResponseInterceptorByClass.

Removes all response interceptor of the specified class
public void
setInterceptors(final List<?>
the list of request and response interceptors from which to initialize
list
)

Implements org.apache.http.protocol.HttpRequestInterceptorList.setInterceptors, org.apache.http.protocol.HttpResponseInterceptorList.setInterceptors.

Sets the interceptor lists.
Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

requestInterceptorsback to summary
protected final List<HttpRequestInterceptor> requestInterceptors
responseInterceptorsback to summary
protected final List<HttpResponseInterceptor> responseInterceptors

Constructor Detail

BasicHttpProcessorback to summary
public BasicHttpProcessor()

Method Detail

addInterceptorback to summary
public void addInterceptor(final HttpRequestInterceptor interceptor)
addInterceptorback to summary
public void addInterceptor(final HttpRequestInterceptor interceptor, final int index)
addInterceptorback to summary
public void addInterceptor(final HttpResponseInterceptor interceptor)
addInterceptorback to summary
public void addInterceptor(final HttpResponseInterceptor interceptor, final int index)
addRequestInterceptorback to summary
public void addRequestInterceptor(final HttpRequestInterceptor itcp)

Implements org.apache.http.protocol.HttpRequestInterceptorList.addRequestInterceptor.

Doc from org.apache.http.protocol.HttpRequestInterceptorList.addRequestInterceptor.

Appends a request interceptor to this list.

Parameters
itcp:HttpRequestInterceptor

the request interceptor to add

Annotations
@Override
addRequestInterceptorback to summary
public void addRequestInterceptor(final HttpRequestInterceptor itcp, final int index)

Implements org.apache.http.protocol.HttpRequestInterceptorList.addRequestInterceptor.

Doc from org.apache.http.protocol.HttpRequestInterceptorList.addRequestInterceptor.

Inserts a request interceptor at the specified index.

Parameters
itcp:HttpRequestInterceptor

the request interceptor to add

index:int

the index to insert the interceptor at

Annotations
@Override
addResponseInterceptorback to summary
public void addResponseInterceptor(final HttpResponseInterceptor itcp, final int index)

Implements org.apache.http.protocol.HttpResponseInterceptorList.addResponseInterceptor.

Doc from org.apache.http.protocol.HttpResponseInterceptorList.addResponseInterceptor.

Inserts a response interceptor at the specified index.

Parameters
itcp:HttpResponseInterceptor

the response interceptor to add

index:int

the index to insert the interceptor at

Annotations
@Override
addResponseInterceptorback to summary
public void addResponseInterceptor(final HttpResponseInterceptor itcp)

Implements org.apache.http.protocol.HttpResponseInterceptorList.addResponseInterceptor.

Doc from org.apache.http.protocol.HttpResponseInterceptorList.addResponseInterceptor.

Appends a response interceptor to this list.

Parameters
itcp:HttpResponseInterceptor

the response interceptor to add

Annotations
@Override
clearInterceptorsback to summary
public void clearInterceptors()

Clears both interceptor lists maintained by this processor.

clearRequestInterceptorsback to summary
public void clearRequestInterceptors()

Implements org.apache.http.protocol.HttpRequestInterceptorList.clearRequestInterceptors.

Doc from org.apache.http.protocol.HttpRequestInterceptorList.clearRequestInterceptors.

Removes all request interceptors from this list.

Annotations
@Override
clearResponseInterceptorsback to summary
public void clearResponseInterceptors()

Implements org.apache.http.protocol.HttpResponseInterceptorList.clearResponseInterceptors.

Doc from org.apache.http.protocol.HttpResponseInterceptorList.clearResponseInterceptors.

Removes all response interceptors from this list.

Annotations
@Override
cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides java.lang.Object.clone.

Doc from java.lang.Object.clone.

Creates and returns a copy of this object. The precise meaning of "copy" may depend on the class of the object. The general intent is that, for any object x, the expression:

x.clone() != x
will be true, and that the expression:
x.clone().getClass() == x.getClass()
will be true, but these are not absolute requirements. While it is typically the case that:
x.clone().equals(x)
will be true, this is not an absolute requirement.

By convention, the returned object should be obtained by calling super.clone. If a class and all of its superclasses (except Object) obey this convention, it will be the case that x.clone().getClass() == x.getClass().

By convention, the object returned by this method should be independent of this object (which is being cloned). To achieve this independence, it may be necessary to modify one or more fields of the object returned by super.clone before returning it. Typically, this means copying any mutable objects that comprise the internal "deep structure" of the object being cloned and replacing the references to these objects with references to the copies. If a class contains only primitive fields or references to immutable objects, then it is usually the case that no fields in the object returned by super.clone need to be modified.

Returns:Object

a clone of this instance.

Annotations
@Override
Exceptions
CloneNotSupportedException:
if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.
copyback to summary
public BasicHttpProcessor copy()

Deprecated

as a consequence of BasicHttpProcessor being deprecated. See corresponding docs for further information.

Creates a copy of this instance

Returns:BasicHttpProcessor

new instance of the BasicHttpProcessor

copyInterceptorsback to summary
protected void copyInterceptors(final BasicHttpProcessor target)

Deprecated

as a consequence of BasicHttpProcessor being deprecated. See corresponding docs for further information.

Sets up the target to have the same list of interceptors as the current instance.

Parameters
target:BasicHttpProcessor

object to be initialised

getRequestInterceptorback to summary
public HttpRequestInterceptor getRequestInterceptor(final int index)

Implements org.apache.http.protocol.HttpRequestInterceptorList.getRequestInterceptor.

Doc from org.apache.http.protocol.HttpRequestInterceptorList.getRequestInterceptor.

Obtains a request interceptor from this list.

Parameters
index:int

the index of the interceptor to obtain, 0 for first

Returns:HttpRequestInterceptor

the interceptor at the given index, or null if the index is out of range

Annotations
@Override
getRequestInterceptorCountback to summary
public int getRequestInterceptorCount()

Implements org.apache.http.protocol.HttpRequestInterceptorList.getRequestInterceptorCount.

Doc from org.apache.http.protocol.HttpRequestInterceptorList.getRequestInterceptorCount.

Obtains the current size of this list.

Returns:int

the number of request interceptors in this list

Annotations
@Override
getResponseInterceptorback to summary
public HttpResponseInterceptor getResponseInterceptor(final int index)

Implements org.apache.http.protocol.HttpResponseInterceptorList.getResponseInterceptor.

Doc from org.apache.http.protocol.HttpResponseInterceptorList.getResponseInterceptor.

Obtains a response interceptor from this list.

Parameters
index:int

the index of the interceptor to obtain, 0 for first

Returns:HttpResponseInterceptor

the interceptor at the given index, or null if the index is out of range

Annotations
@Override
getResponseInterceptorCountback to summary
public int getResponseInterceptorCount()

Implements org.apache.http.protocol.HttpResponseInterceptorList.getResponseInterceptorCount.

Doc from org.apache.http.protocol.HttpResponseInterceptorList.getResponseInterceptorCount.

Obtains the current size of this list.

Returns:int

the number of response interceptors in this list

Annotations
@Override
processback to summary
public void process(final HttpRequest request, final HttpContext context) throws IOException, HttpException

Implements org.apache.http.HttpRequestInterceptor.process.

Doc from org.apache.http.HttpRequestInterceptor.process.

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.

Parameters
request:HttpRequest

the request to preprocess

context:HttpContext

the context for the request

Annotations
@Override
Exceptions
IOException:
in case of an I/O error
HttpException:
in case of an HTTP protocol violation
processback to summary
public void process(final HttpResponse response, final HttpContext context) throws IOException, HttpException

Implements org.apache.http.HttpResponseInterceptor.process.

Doc from org.apache.http.HttpResponseInterceptor.process.

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.

Parameters
response:HttpResponse

the response to postprocess

context:HttpContext

the context for the request

Annotations
@Override
Exceptions
IOException:
in case of an I/O error
HttpException:
in case of an HTTP protocol violation
removeRequestInterceptorByClassback to summary
public void removeRequestInterceptorByClass(final Class<? extends HttpRequestInterceptor> clazz)

Implements org.apache.http.protocol.HttpRequestInterceptorList.removeRequestInterceptorByClass.

Doc from org.apache.http.protocol.HttpRequestInterceptorList.removeRequestInterceptorByClass.

Removes all request interceptor of the specified class

Parameters
clazz:Class<? extends HttpRequestInterceptor>

the class of the instances to be removed.

Annotations
@Override
removeResponseInterceptorByClassback to summary
public void removeResponseInterceptorByClass(final Class<? extends HttpResponseInterceptor> clazz)

Implements org.apache.http.protocol.HttpResponseInterceptorList.removeResponseInterceptorByClass.

Doc from org.apache.http.protocol.HttpResponseInterceptorList.removeResponseInterceptorByClass.

Removes all response interceptor of the specified class

Parameters
clazz:Class<? extends HttpResponseInterceptor>

the class of the instances to be removed.

Annotations
@Override
setInterceptorsback to summary
public void setInterceptors(final List<?> list)

Implements org.apache.http.protocol.HttpRequestInterceptorList.setInterceptors, org.apache.http.protocol.HttpResponseInterceptorList.setInterceptors.

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:List<?>

the list of request and response interceptors from which to initialize

Annotations
@Override