|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.protocol.AbstractHttpProcessor
org.apache.http.protocol.HttpRequestExecutor
public class HttpRequestExecutor
Sends HTTP requests and receives the responses. Takes care of request preprocessing and response postprocessing by the respective interceptors.
Field Summary | |
---|---|
protected HttpContext |
defaultContext
The context holding the default context information. |
protected static int |
WAIT_FOR_CONTINUE_MS
|
Constructor Summary | |
---|---|
HttpRequestExecutor()
Create a new request executor. |
|
HttpRequestExecutor(HttpContext parentContext)
Create a new request executor with default context information. |
Method Summary | |
---|---|
protected boolean |
canResponseHaveBody(HttpRequest request,
HttpResponse response)
Decide whether a response comes with an entity. |
protected void |
doEstablishConnection(HttpClientConnection conn,
HttpHost target,
HttpParams params)
Establish a connection with the target host. |
protected void |
doFinishResponse(HttpResponse response,
HttpContext context)
Finish a response. |
protected void |
doPrepareRequest(HttpRequest request,
HttpContext context)
Prepare a request for sending. |
protected HttpResponse |
doReceiveResponse(HttpRequest request,
HttpClientConnection conn,
HttpContext context)
Wait for and receive a response. |
protected HttpResponse |
doSendRequest(HttpRequest request,
HttpClientConnection conn,
HttpContext context)
Send a request over a connection. |
HttpResponse |
execute(HttpRequest request,
HttpClientConnection conn)
Synchronously send a request and obtain the response. |
HttpContext |
getContext()
Obtain the default context information. |
HttpParams |
getParams()
Obtain the parameters for executing requests. |
HttpRequestRetryHandler |
getRetryHandler()
Obtain the retry handler. |
void |
setParams(HttpParams params)
Set new parameters for executing requests. |
void |
setRetryHandler(HttpRequestRetryHandler retryhandler)
Set the retry handler. |
Methods inherited from class org.apache.http.protocol.AbstractHttpProcessor |
---|
addInterceptor, addInterceptor, clearInterceptors, postprocessResponse, preprocessRequest, removeInterceptor, removeInterceptor, removeInterceptors, setInterceptors |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int WAIT_FOR_CONTINUE_MS
protected final HttpContext defaultContext
Constructor Detail |
---|
public HttpRequestExecutor(HttpContext parentContext)
parentContext
- the default context information,
or null
public HttpRequestExecutor()
Method Detail |
---|
public final HttpContext getContext()
public final HttpParams getParams()
public final void setParams(HttpParams params)
params
- the new parameters to use from now onpublic final HttpRequestRetryHandler getRetryHandler()
public final void setRetryHandler(HttpRequestRetryHandler retryhandler)
retryhandler
- the handler to decide whether a request
should be retriedprotected boolean canResponseHaveBody(HttpRequest request, HttpResponse response)
request
- the request, to obtain the executed methodresponse
- the response, to obtain the status codepublic HttpResponse execute(HttpRequest request, HttpClientConnection conn) throws java.io.IOException, HttpException
request
- the request to send. It will be preprocessed.conn
- the connection over which to send.
The target
host has to be set before calling this method.
HttpException
- in case of a protocol or processing problem
java.io.IOException
- in case of an I/O problemprotected void doPrepareRequest(HttpRequest request, HttpContext context) throws HttpException, java.io.IOException
request
- the request to preparecontext
- the context for sending the request
HttpException
- in case of a protocol or processing problem
java.io.IOException
- in case of an I/O problemprotected void doEstablishConnection(HttpClientConnection conn, HttpHost target, HttpParams params) throws HttpException, java.io.IOException
conn
- the HTTP connectiontarget
- the target host for the request, or
null
to send to the host already
set as the connection target
HttpException
- in case of a problem
java.io.IOException
- in case of an IO problemprotected HttpResponse doSendRequest(HttpRequest request, HttpClientConnection conn, HttpContext context) throws java.io.IOException, HttpException
request
- the request to send, already
prepared
conn
- the connection over which to send the request, already
established
context
- the context for sending the request
null
if the expect-continue handshake is not used
HttpException
- in case of a protocol or processing problem
java.io.IOException
- in case of an I/O problemprotected HttpResponse doReceiveResponse(HttpRequest request, HttpClientConnection conn, HttpContext context) throws HttpException, java.io.IOException
request
- the request for which to obtain the responseconn
- the connection over which the request was sentcontext
- the context for receiving the response
HttpException
- in case of a protocol or processing problem
java.io.IOException
- in case of an I/O problemprotected void doFinishResponse(HttpResponse response, HttpContext context) throws HttpException, java.io.IOException
response
- the response object to finishcontext
- the context for post-processing the response
HttpException
- in case of a protocol or processing problem
java.io.IOException
- in case of an I/O problem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |