|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.protocol.BasicHttpProcessor
public class BasicHttpProcessor
Keeps lists of interceptors for processing requests and responses.
Constructor Summary | |
---|---|
BasicHttpProcessor()
|
Method Summary | |
---|---|
void |
addInterceptor(HttpRequestInterceptor interceptor)
Same as addRequestInterceptor . |
void |
addInterceptor(HttpResponseInterceptor interceptor)
Same as addResponseInterceptor . |
void |
addRequestInterceptor(HttpRequestInterceptor itcp)
Appends a request interceptor to this list. |
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. |
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 |
setInterceptors(java.util.List list)
Sets the interceptor lists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicHttpProcessor()
Method Detail |
---|
public void addRequestInterceptor(HttpRequestInterceptor itcp)
HttpRequestInterceptorList
addRequestInterceptor
in interface HttpRequestInterceptorList
itcp
- the request interceptor to add, or
null
to do nothingpublic final void addInterceptor(HttpRequestInterceptor interceptor)
addRequestInterceptor
.
interceptor
- the interceptor to addpublic int getRequestInterceptorCount()
HttpRequestInterceptorList
getRequestInterceptorCount
in interface HttpRequestInterceptorList
public HttpRequestInterceptor getRequestInterceptor(int index)
HttpRequestInterceptorList
getRequestInterceptor
in interface HttpRequestInterceptorList
index
- the index of the interceptor to obtain,
0 for first
null
if the index is out of rangepublic void clearRequestInterceptors()
HttpRequestInterceptorList
clearRequestInterceptors
in interface HttpRequestInterceptorList
public void addResponseInterceptor(HttpResponseInterceptor itcp)
HttpResponseInterceptorList
addResponseInterceptor
in interface HttpResponseInterceptorList
itcp
- the response interceptor to add, or
null
to do nothingpublic final void addInterceptor(HttpResponseInterceptor interceptor)
addResponseInterceptor
.
interceptor
- the interceptor to addpublic int getResponseInterceptorCount()
HttpResponseInterceptorList
getResponseInterceptorCount
in interface HttpResponseInterceptorList
public HttpResponseInterceptor getResponseInterceptor(int index)
HttpResponseInterceptorList
getResponseInterceptor
in interface HttpResponseInterceptorList
index
- the index of the interceptor to obtain,
0 for first
null
if the index is out of rangepublic void clearResponseInterceptors()
HttpResponseInterceptorList
clearResponseInterceptors
in interface HttpResponseInterceptorList
public void setInterceptors(java.util.List list)
setInterceptors
in interface HttpRequestInterceptorList
setInterceptors
in interface HttpResponseInterceptorList
list
- the list of request and response interceptors
from which to initializepublic void clearInterceptors()
public void process(HttpRequest request, HttpContext context) throws java.io.IOException, HttpException
HttpRequestInterceptor
process
in interface HttpRequestInterceptor
request
- the request to preprocesscontext
- the context for the request
java.io.IOException
- in case of an IO problem
HttpException
- in case of a protocol or other problempublic void process(HttpResponse response, HttpContext context) throws java.io.IOException, HttpException
HttpResponseInterceptor
process
in interface HttpResponseInterceptor
response
- the response to postprocesscontext
- the context for the request
java.io.IOException
- in case of an IO problem
HttpException
- in case of a protocol or other problempublic BasicHttpProcessor copy()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |