Package org.apache.http.protocol
Class BasicHttpProcessor
- java.lang.Object
-
- org.apache.http.protocol.BasicHttpProcessor
-
- All Implemented Interfaces:
java.lang.Cloneable,HttpRequestInterceptor,HttpResponseInterceptor,HttpProcessor,HttpRequestInterceptorList,HttpResponseInterceptorList
@Deprecated public final class BasicHttpProcessor extends java.lang.Object implements HttpProcessor, HttpRequestInterceptorList, HttpResponseInterceptorList, java.lang.Cloneable
Deprecated.(4.3)Default implementation ofHttpProcessor.Please note access to the internal structures of this class is not synchronized and therefore this class may be thread-unsafe.
- Since:
- 4.0
-
-
Constructor Summary
Constructors Constructor Description BasicHttpProcessor()Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddInterceptor(HttpRequestInterceptor interceptor)Deprecated.voidaddInterceptor(HttpRequestInterceptor interceptor, int index)Deprecated.voidaddInterceptor(HttpResponseInterceptor interceptor)Deprecated.voidaddInterceptor(HttpResponseInterceptor interceptor, int index)Deprecated.voidaddRequestInterceptor(HttpRequestInterceptor itcp)Deprecated.Appends a request interceptor to this list.voidaddRequestInterceptor(HttpRequestInterceptor itcp, int index)Deprecated.Inserts a request interceptor at the specified index.voidaddResponseInterceptor(HttpResponseInterceptor itcp)Deprecated.Appends a response interceptor to this list.voidaddResponseInterceptor(HttpResponseInterceptor itcp, int index)Deprecated.Inserts a response interceptor at the specified index.voidclearInterceptors()Deprecated.Clears both interceptor lists maintained by this processor.voidclearRequestInterceptors()Deprecated.Removes all request interceptors from this list.voidclearResponseInterceptors()Deprecated.Removes all response interceptors from this list.java.lang.Objectclone()Deprecated.BasicHttpProcessorcopy()Deprecated.Creates a copy of this instanceHttpRequestInterceptorgetRequestInterceptor(int index)Deprecated.Obtains a request interceptor from this list.intgetRequestInterceptorCount()Deprecated.Obtains the current size of this list.HttpResponseInterceptorgetResponseInterceptor(int index)Deprecated.Obtains a response interceptor from this list.intgetResponseInterceptorCount()Deprecated.Obtains the current size of this list.voidprocess(HttpRequest request, HttpContext context)Deprecated.Processes a request.voidprocess(HttpResponse response, HttpContext context)Deprecated.Processes a response.voidremoveRequestInterceptorByClass(java.lang.Class<? extends HttpRequestInterceptor> clazz)Deprecated.Removes all request interceptor of the specified classvoidremoveResponseInterceptorByClass(java.lang.Class<? extends HttpResponseInterceptor> clazz)Deprecated.Removes all response interceptor of the specified classvoidsetInterceptors(java.util.List<?> list)Deprecated.Sets the interceptor lists.
-
-
-
Method Detail
-
addRequestInterceptor
public void addRequestInterceptor(HttpRequestInterceptor itcp)
Deprecated.Description copied from interface:HttpRequestInterceptorListAppends a request interceptor to this list.- Specified by:
addRequestInterceptorin interfaceHttpRequestInterceptorList- Parameters:
itcp- the request interceptor to add
-
addRequestInterceptor
public void addRequestInterceptor(HttpRequestInterceptor itcp, int index)
Deprecated.Description copied from interface:HttpRequestInterceptorListInserts a request interceptor at the specified index.- Specified by:
addRequestInterceptorin interfaceHttpRequestInterceptorList- Parameters:
itcp- the request interceptor to addindex- the index to insert the interceptor at
-
addResponseInterceptor
public void addResponseInterceptor(HttpResponseInterceptor itcp, int index)
Deprecated.Description copied from interface:HttpResponseInterceptorListInserts a response interceptor at the specified index.- Specified by:
addResponseInterceptorin interfaceHttpResponseInterceptorList- Parameters:
itcp- the response interceptor to addindex- the index to insert the interceptor at
-
removeRequestInterceptorByClass
public void removeRequestInterceptorByClass(java.lang.Class<? extends HttpRequestInterceptor> clazz)
Deprecated.Description copied from interface:HttpRequestInterceptorListRemoves all request interceptor of the specified class- Specified by:
removeRequestInterceptorByClassin interfaceHttpRequestInterceptorList- Parameters:
clazz- the class of the instances to be removed.
-
removeResponseInterceptorByClass
public void removeResponseInterceptorByClass(java.lang.Class<? extends HttpResponseInterceptor> clazz)
Deprecated.Description copied from interface:HttpResponseInterceptorListRemoves all response interceptor of the specified class- Specified by:
removeResponseInterceptorByClassin interfaceHttpResponseInterceptorList- Parameters:
clazz- the class of the instances to be removed.
-
addInterceptor
public final void addInterceptor(HttpRequestInterceptor interceptor)
Deprecated.
-
addInterceptor
public final void addInterceptor(HttpRequestInterceptor interceptor, int index)
Deprecated.
-
getRequestInterceptorCount
public int getRequestInterceptorCount()
Deprecated.Description copied from interface:HttpRequestInterceptorListObtains the current size of this list.- Specified by:
getRequestInterceptorCountin interfaceHttpRequestInterceptorList- Returns:
- the number of request interceptors in this list
-
getRequestInterceptor
public HttpRequestInterceptor getRequestInterceptor(int index)
Deprecated.Description copied from interface:HttpRequestInterceptorListObtains a request interceptor from this list.- Specified by:
getRequestInterceptorin interfaceHttpRequestInterceptorList- Parameters:
index- the index of the interceptor to obtain, 0 for first- Returns:
- the interceptor at the given index, or
nullif the index is out of range
-
clearRequestInterceptors
public void clearRequestInterceptors()
Deprecated.Description copied from interface:HttpRequestInterceptorListRemoves all request interceptors from this list.- Specified by:
clearRequestInterceptorsin interfaceHttpRequestInterceptorList
-
addResponseInterceptor
public void addResponseInterceptor(HttpResponseInterceptor itcp)
Deprecated.Description copied from interface:HttpResponseInterceptorListAppends a response interceptor to this list.- Specified by:
addResponseInterceptorin interfaceHttpResponseInterceptorList- Parameters:
itcp- the response interceptor to add
-
addInterceptor
public final void addInterceptor(HttpResponseInterceptor interceptor)
Deprecated.
-
addInterceptor
public final void addInterceptor(HttpResponseInterceptor interceptor, int index)
Deprecated.
-
getResponseInterceptorCount
public int getResponseInterceptorCount()
Deprecated.Description copied from interface:HttpResponseInterceptorListObtains the current size of this list.- Specified by:
getResponseInterceptorCountin interfaceHttpResponseInterceptorList- Returns:
- the number of response interceptors in this list
-
getResponseInterceptor
public HttpResponseInterceptor getResponseInterceptor(int index)
Deprecated.Description copied from interface:HttpResponseInterceptorListObtains a response interceptor from this list.- Specified by:
getResponseInterceptorin interfaceHttpResponseInterceptorList- Parameters:
index- the index of the interceptor to obtain, 0 for first- Returns:
- the interceptor at the given index, or
nullif the index is out of range
-
clearResponseInterceptors
public void clearResponseInterceptors()
Deprecated.Description copied from interface:HttpResponseInterceptorListRemoves all response interceptors from this list.- Specified by:
clearResponseInterceptorsin interfaceHttpResponseInterceptorList
-
setInterceptors
public void setInterceptors(java.util.List<?> list)
Deprecated.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.- Specified by:
setInterceptorsin interfaceHttpRequestInterceptorList- Specified by:
setInterceptorsin interfaceHttpResponseInterceptorList- Parameters:
list- the list of request and response interceptors from which to initialize
-
clearInterceptors
public void clearInterceptors()
Deprecated.Clears both interceptor lists maintained by this processor.
-
process
public void process(HttpRequest request, HttpContext context) throws java.io.IOException, HttpException
Deprecated.Description copied from interface:HttpRequestInterceptorProcesses 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.- Specified by:
processin interfaceHttpRequestInterceptor- Parameters:
request- the request to preprocesscontext- the context for the request- Throws:
java.io.IOException- in case of an I/O errorHttpException- in case of an HTTP protocol violation
-
process
public void process(HttpResponse response, HttpContext context) throws java.io.IOException, HttpException
Deprecated.Description copied from interface:HttpResponseInterceptorProcesses 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.- Specified by:
processin interfaceHttpResponseInterceptor- Parameters:
response- the response to postprocesscontext- the context for the request- Throws:
java.io.IOException- in case of an I/O errorHttpException- in case of an HTTP protocol violation
-
copy
public BasicHttpProcessor copy()
Deprecated.Creates a copy of this instance- Returns:
- new instance of the BasicHttpProcessor
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionDeprecated.- Throws:
java.lang.CloneNotSupportedException
-
-