|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.http.protocol.BasicHttpProcessor
public final class BasicHttpProcessor
Keeps lists of interceptors for processing requests and responses.
| Field Summary | |
|---|---|
protected List |
requestInterceptors
|
protected List |
responseInterceptors
|
| Constructor Summary | |
|---|---|
BasicHttpProcessor()
|
|
| Method Summary | |
|---|---|
void |
addInterceptor(HttpRequestInterceptor interceptor)
Same as addRequestInterceptor. |
void |
addInterceptor(HttpRequestInterceptor interceptor,
int index)
|
void |
addInterceptor(HttpResponseInterceptor interceptor)
Same as addResponseInterceptor. |
void |
addInterceptor(HttpResponseInterceptor interceptor,
int index)
|
void |
addRequestInterceptor(HttpRequestInterceptor itcp)
Appends a request interceptor to this list. |
void |
addRequestInterceptor(HttpRequestInterceptor itcp,
int index)
Inserts a request interceptor at the specified index. |
void |
addResponseInterceptor(HttpResponseInterceptor itcp)
Appends a response interceptor to this list. |
void |
addResponseInterceptor(HttpResponseInterceptor itcp,
int index)
Inserts a response interceptor at the specified index. |
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 |
protected void |
copyInterceptors(BasicHttpProcessor target)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List requestInterceptors
protected List responseInterceptors
| Constructor Detail |
|---|
public BasicHttpProcessor()
| Method Detail |
|---|
public void addRequestInterceptor(HttpRequestInterceptor itcp)
HttpRequestInterceptorList
addRequestInterceptor in interface HttpRequestInterceptorListitcp - the request interceptor to add
public void addRequestInterceptor(HttpRequestInterceptor itcp,
int index)
HttpRequestInterceptorList
addRequestInterceptor in interface HttpRequestInterceptorListitcp - the request interceptor to addindex - the index to insert the interceptor at
public void addResponseInterceptor(HttpResponseInterceptor itcp,
int index)
HttpResponseInterceptorList
addResponseInterceptor in interface HttpResponseInterceptorListitcp - the response interceptor to addindex - the index to insert the interceptor atpublic void removeRequestInterceptorByClass(Class clazz)
HttpRequestInterceptorList
removeRequestInterceptorByClass in interface HttpRequestInterceptorListclazz - the class of the instances to be removed.public void removeResponseInterceptorByClass(Class clazz)
HttpResponseInterceptorList
removeResponseInterceptorByClass in interface HttpResponseInterceptorListclazz - the class of the instances to be removed.public final void addInterceptor(HttpRequestInterceptor interceptor)
addRequestInterceptor.
interceptor - the interceptor to add
public final void addInterceptor(HttpRequestInterceptor interceptor,
int index)
public int getRequestInterceptorCount()
HttpRequestInterceptorList
getRequestInterceptorCount in interface HttpRequestInterceptorListpublic HttpRequestInterceptor getRequestInterceptor(int index)
HttpRequestInterceptorList
getRequestInterceptor in interface HttpRequestInterceptorListindex - the index of the interceptor to obtain,
0 for first
null if the index is out of rangepublic void clearRequestInterceptors()
HttpRequestInterceptorList
clearRequestInterceptors in interface HttpRequestInterceptorListpublic void addResponseInterceptor(HttpResponseInterceptor itcp)
HttpResponseInterceptorList
addResponseInterceptor in interface HttpResponseInterceptorListitcp - the response interceptor to addpublic final void addInterceptor(HttpResponseInterceptor interceptor)
addResponseInterceptor.
interceptor - the interceptor to add
public final void addInterceptor(HttpResponseInterceptor interceptor,
int index)
public int getResponseInterceptorCount()
HttpResponseInterceptorList
getResponseInterceptorCount in interface HttpResponseInterceptorListpublic HttpResponseInterceptor getResponseInterceptor(int index)
HttpResponseInterceptorList
getResponseInterceptor in interface HttpResponseInterceptorListindex - the index of the interceptor to obtain,
0 for first
null if the index is out of rangepublic void clearResponseInterceptors()
HttpResponseInterceptorList
clearResponseInterceptors in interface HttpResponseInterceptorListpublic void setInterceptors(List list)
setInterceptors in interface HttpRequestInterceptorListsetInterceptors in interface HttpResponseInterceptorListlist - the list of request and response interceptors
from which to initializepublic void clearInterceptors()
public void process(HttpRequest request,
HttpContext context)
throws IOException,
HttpException
HttpRequestInterceptor
process in interface HttpRequestInterceptorrequest - the request to preprocesscontext - the context for the request
IOException - in case of an IO problem
HttpException - in case of a protocol or other problem
public void process(HttpResponse response,
HttpContext context)
throws IOException,
HttpException
HttpResponseInterceptor
process in interface HttpResponseInterceptorresponse - the response to postprocesscontext - the context for the request
IOException - in case of an IO problem
HttpException - in case of a protocol or other problemprotected void copyInterceptors(BasicHttpProcessor target)
public BasicHttpProcessor copy()
public Object clone()
throws CloneNotSupportedException
ObjectClasses which wish to support cloning must specify that they implement the Cloneable interface, since the implementation checks for this.
clone in class ObjectCloneNotSupportedException - if the receiver's class does not
implement the interface Cloneable.
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||