|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.http.impl.client.AbstractHttpClient
public abstract class AbstractHttpClient
Convenience base class for HTTP client implementations.
Constructor Summary | |
---|---|
protected |
AbstractHttpClient(ClientConnectionManager conman,
org.apache.http.params.HttpParams params)
Creates a new HTTP client. |
Method Summary | |
---|---|
void |
addRequestInterceptor(org.apache.http.HttpRequestInterceptor itcp)
|
void |
addResponseInterceptor(org.apache.http.HttpResponseInterceptor itcp)
|
void |
clearRequestInterceptors()
|
void |
clearResponseInterceptors()
|
protected abstract AuthenticationHandler |
createAuthenticationHandler()
|
protected abstract AuthSchemeRegistry |
createAuthSchemeRegistry()
|
protected abstract ClientConnectionManager |
createClientConnectionManager()
|
protected abstract org.apache.http.ConnectionReuseStrategy |
createConnectionReuseStrategy()
|
protected abstract CookieSpecRegistry |
createCookieSpecRegistry()
|
protected abstract org.apache.http.protocol.HttpContext |
createHttpContext()
|
protected abstract org.apache.http.params.HttpParams |
createHttpParams()
|
protected abstract org.apache.http.protocol.BasicHttpProcessor |
createHttpProcessor()
|
protected abstract HttpRequestRetryHandler |
createHttpRequestRetryHandler()
|
protected abstract HttpState |
createHttpState()
|
protected abstract RedirectHandler |
createRedirectHandler()
|
protected abstract RoutedRequest |
determineRoute(org.apache.http.HttpHost target,
org.apache.http.HttpRequest request,
org.apache.http.protocol.HttpContext context)
Determines the route for a request. |
org.apache.http.HttpResponse |
execute(HttpUriRequest request)
Maps to execute(request, context) . |
org.apache.http.HttpResponse |
execute(HttpUriRequest request,
org.apache.http.protocol.HttpContext context)
Maps to execute(roureq, context) . |
org.apache.http.HttpResponse |
execute(RoutedRequest roureq)
Executes a request along the given route using the default context . |
org.apache.http.HttpResponse |
execute(RoutedRequest roureq,
org.apache.http.protocol.HttpContext context)
Executes a request along the given route. |
AuthenticationHandler |
getAuthenticationHandler()
|
AuthSchemeRegistry |
getAuthSchemes()
|
ClientConnectionManager |
getConnectionManager()
Obtains the connection manager used by this client. |
org.apache.http.ConnectionReuseStrategy |
getConnectionReuseStrategy()
|
CookieSpecRegistry |
getCookieSpecs()
|
org.apache.http.protocol.HttpContext |
getDefaultContext()
Obtains the default context used by this client populated with default attributes. |
protected org.apache.http.protocol.BasicHttpProcessor |
getHttpProcessor()
|
HttpRequestRetryHandler |
getHttpRequestRetryHandler()
|
org.apache.http.params.HttpParams |
getParams()
Obtains the parameters for this client. |
RedirectHandler |
getRedirectHandler()
|
org.apache.http.HttpRequestInterceptor |
getRequestInterceptor(int index)
|
int |
getRequestInterceptorCount()
|
org.apache.http.HttpResponseInterceptor |
getResponseInterceptor(int index)
|
int |
getResponseInterceptorCount()
|
HttpState |
getState()
|
protected abstract void |
populateContext(org.apache.http.protocol.HttpContext context)
|
void |
setAuthenticationHandler(AuthenticationHandler authHandler)
|
void |
setAuthSchemes(AuthSchemeRegistry authSchemeRegistry)
|
void |
setCookieSpecs(CookieSpecRegistry cookieSpecRegistry)
|
void |
setHttpRequestRetryHandler(HttpRequestRetryHandler retryHandler)
|
void |
setInterceptors(java.util.List itcps)
|
void |
setParams(org.apache.http.params.HttpParams params)
Replaces the parameters. |
void |
setRedirectHandler(RedirectHandler redirectHandler)
|
void |
setReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy)
|
void |
setState(HttpState state)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractHttpClient(ClientConnectionManager conman, org.apache.http.params.HttpParams params)
conman
- the connection managerparams
- the parametersMethod Detail |
---|
protected abstract org.apache.http.params.HttpParams createHttpParams()
protected abstract org.apache.http.protocol.HttpContext createHttpContext()
protected abstract ClientConnectionManager createClientConnectionManager()
protected abstract AuthSchemeRegistry createAuthSchemeRegistry()
protected abstract CookieSpecRegistry createCookieSpecRegistry()
protected abstract org.apache.http.ConnectionReuseStrategy createConnectionReuseStrategy()
protected abstract org.apache.http.protocol.BasicHttpProcessor createHttpProcessor()
protected abstract HttpRequestRetryHandler createHttpRequestRetryHandler()
protected abstract RedirectHandler createRedirectHandler()
protected abstract AuthenticationHandler createAuthenticationHandler()
protected abstract HttpState createHttpState()
protected abstract void populateContext(org.apache.http.protocol.HttpContext context)
public final org.apache.http.params.HttpParams getParams()
HttpClient
getParams
in interface HttpClient
public void setParams(org.apache.http.params.HttpParams params)
params
- the new default parameterspublic final ClientConnectionManager getConnectionManager()
HttpClient
getConnectionManager
in interface HttpClient
public final AuthSchemeRegistry getAuthSchemes()
public void setAuthSchemes(AuthSchemeRegistry authSchemeRegistry)
public final CookieSpecRegistry getCookieSpecs()
public void setCookieSpecs(CookieSpecRegistry cookieSpecRegistry)
public final org.apache.http.ConnectionReuseStrategy getConnectionReuseStrategy()
public void setReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy)
public final HttpRequestRetryHandler getHttpRequestRetryHandler()
public void setHttpRequestRetryHandler(HttpRequestRetryHandler retryHandler)
public final RedirectHandler getRedirectHandler()
public void setRedirectHandler(RedirectHandler redirectHandler)
public final AuthenticationHandler getAuthenticationHandler()
public void setAuthenticationHandler(AuthenticationHandler authHandler)
public final HttpState getState()
public void setState(HttpState state)
protected final org.apache.http.protocol.BasicHttpProcessor getHttpProcessor()
public final org.apache.http.protocol.HttpContext getDefaultContext()
HttpClient
getDefaultContext
in interface HttpClient
public void addResponseInterceptor(org.apache.http.HttpResponseInterceptor itcp)
addResponseInterceptor
in interface org.apache.http.protocol.HttpResponseInterceptorList
public void clearResponseInterceptors()
clearResponseInterceptors
in interface org.apache.http.protocol.HttpResponseInterceptorList
public org.apache.http.HttpResponseInterceptor getResponseInterceptor(int index)
getResponseInterceptor
in interface org.apache.http.protocol.HttpResponseInterceptorList
public int getResponseInterceptorCount()
getResponseInterceptorCount
in interface org.apache.http.protocol.HttpResponseInterceptorList
public void addRequestInterceptor(org.apache.http.HttpRequestInterceptor itcp)
addRequestInterceptor
in interface org.apache.http.protocol.HttpRequestInterceptorList
public void clearRequestInterceptors()
clearRequestInterceptors
in interface org.apache.http.protocol.HttpRequestInterceptorList
public org.apache.http.HttpRequestInterceptor getRequestInterceptor(int index)
getRequestInterceptor
in interface org.apache.http.protocol.HttpRequestInterceptorList
public int getRequestInterceptorCount()
getRequestInterceptorCount
in interface org.apache.http.protocol.HttpRequestInterceptorList
public void setInterceptors(java.util.List itcps)
setInterceptors
in interface org.apache.http.protocol.HttpRequestInterceptorList
setInterceptors
in interface org.apache.http.protocol.HttpResponseInterceptorList
public final org.apache.http.HttpResponse execute(HttpUriRequest request) throws org.apache.http.HttpException, java.io.IOException
execute(request, context)
.
The route is computed by determineRoute
.
This method uses default context
.
execute
in interface HttpClient
request
- the request to execute
org.apache.http.HttpException
- in case of a problem
java.io.IOException
- in case of an IO problempublic final org.apache.http.HttpResponse execute(HttpUriRequest request, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, java.io.IOException
execute(roureq, context)
.
The route is computed by determineRoute
.
execute
in interface HttpClient
request
- the request to executecontext
- the request-specific execution context,
or null
to use a default context
org.apache.http.HttpException
- in case of a problem
java.io.IOException
- in case of an IO problem
public org.apache.http.HttpResponse execute(RoutedRequest roureq) throws org.apache.http.HttpException, java.io.IOException
HttpClient
default context
.
execute
in interface HttpClient
roureq
- the request to execute along with the route
HttpClient.execute(HttpUriRequest,HttpContext)
for details.
org.apache.http.HttpException
- in case of a problem
java.io.IOException
- in case of an IO problem
public final org.apache.http.HttpResponse execute(RoutedRequest roureq, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, java.io.IOException
HttpClient
execute
in interface HttpClient
roureq
- the request to execute along with the routecontext
- the context to use for the execution, or
null
to use the
default context
HttpClient.execute(HttpUriRequest,HttpContext)
for details.
org.apache.http.HttpException
- in case of a problem
java.io.IOException
- in case of an IO problem
protected abstract RoutedRequest determineRoute(org.apache.http.HttpHost target, org.apache.http.HttpRequest request, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException
execute(urirequest, context)
to map to execute(roureq, context)
.
target
- the target host for the request.
Implementations may accept null
if they can still determine a route, for example
to a default target or by inspecting the request.request
- the request to executecontext
- the context to use for the execution,
never null
org.apache.http.HttpException
- in case of a problem
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |