|
||||||||||
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 |
addRequestInterceptor(org.apache.http.HttpRequestInterceptor itcp,
int index)
|
void |
addResponseInterceptor(org.apache.http.HttpResponseInterceptor itcp)
|
void |
addResponseInterceptor(org.apache.http.HttpResponseInterceptor itcp,
int index)
|
void |
clearRequestInterceptors()
|
void |
clearResponseInterceptors()
|
protected abstract AuthSchemeRegistry |
createAuthSchemeRegistry()
|
protected abstract ClientConnectionManager |
createClientConnectionManager()
|
protected abstract org.apache.http.ConnectionReuseStrategy |
createConnectionReuseStrategy()
|
protected abstract CookieSpecRegistry |
createCookieSpecRegistry()
|
protected abstract CookieStore |
createCookieStore()
|
protected abstract CredentialsProvider |
createCredentialsProvider()
|
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 HttpRoutePlanner |
createHttpRoutePlanner()
|
protected abstract AuthenticationHandler |
createProxyAuthenticationHandler()
|
protected abstract RedirectHandler |
createRedirectHandler()
|
protected abstract AuthenticationHandler |
createTargetAuthenticationHandler()
|
protected org.apache.http.params.HttpParams |
determineParams(org.apache.http.HttpRequest req)
Obtains parameters for executing a request. |
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)
Executes a request using the default 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. |
AuthSchemeRegistry |
getAuthSchemes()
|
ClientConnectionManager |
getConnectionManager()
Obtains the connection manager used by this client. |
org.apache.http.ConnectionReuseStrategy |
getConnectionReuseStrategy()
|
CookieSpecRegistry |
getCookieSpecs()
|
CookieStore |
getCookieStore()
|
CredentialsProvider |
getCredentialsProvider()
|
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. |
AuthenticationHandler |
getProxyAuthenticationHandler()
|
RedirectHandler |
getRedirectHandler()
|
org.apache.http.HttpRequestInterceptor |
getRequestInterceptor(int index)
|
int |
getRequestInterceptorCount()
|
org.apache.http.HttpResponseInterceptor |
getResponseInterceptor(int index)
|
int |
getResponseInterceptorCount()
|
HttpRoutePlanner |
getRoutePlanner()
|
AuthenticationHandler |
getTargetAuthenticationHandler()
|
protected abstract void |
populateContext(org.apache.http.protocol.HttpContext context)
|
void |
removeRequestInterceptorByClass(java.lang.Class clazz)
|
void |
removeResponseInterceptorByClass(java.lang.Class clazz)
|
void |
setAuthSchemes(AuthSchemeRegistry authSchemeRegistry)
|
void |
setCookieSpecs(CookieSpecRegistry cookieSpecRegistry)
|
void |
setCookieStore(CookieStore cookieStore)
|
void |
setCredentialsProvider(CredentialsProvider credsProvider)
|
void |
setHttpRequestRetryHandler(HttpRequestRetryHandler retryHandler)
|
void |
setInterceptors(java.util.List itcps)
|
void |
setParams(org.apache.http.params.HttpParams params)
Replaces the parameters. |
void |
setProxyAuthenticationHandler(AuthenticationHandler proxyAuthHandler)
|
void |
setRedirectHandler(RedirectHandler redirectHandler)
|
void |
setReuseStrategy(org.apache.http.ConnectionReuseStrategy reuseStrategy)
|
void |
setRoutePlanner(HttpRoutePlanner routePlanner)
|
void |
setTargetAuthenticationHandler(AuthenticationHandler targetAuthHandler)
|
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 createTargetAuthenticationHandler()
protected abstract AuthenticationHandler createProxyAuthenticationHandler()
protected abstract CookieStore createCookieStore()
protected abstract CredentialsProvider createCredentialsProvider()
protected abstract void populateContext(org.apache.http.protocol.HttpContext context)
protected abstract HttpRoutePlanner createHttpRoutePlanner()
public final HttpRoutePlanner getRoutePlanner()
public void setRoutePlanner(HttpRoutePlanner routePlanner)
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 getTargetAuthenticationHandler()
public void setTargetAuthenticationHandler(AuthenticationHandler targetAuthHandler)
public final AuthenticationHandler getProxyAuthenticationHandler()
public void setProxyAuthenticationHandler(AuthenticationHandler proxyAuthHandler)
public final CookieStore getCookieStore()
public void setCookieStore(CookieStore cookieStore)
public final CredentialsProvider getCredentialsProvider()
public void setCredentialsProvider(CredentialsProvider credsProvider)
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 addResponseInterceptor(org.apache.http.HttpResponseInterceptor itcp, int index)
addResponseInterceptor
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 clearResponseInterceptors()
clearResponseInterceptors
in interface org.apache.http.protocol.HttpResponseInterceptorList
public void removeResponseInterceptorByClass(java.lang.Class clazz)
removeResponseInterceptorByClass
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 addRequestInterceptor(org.apache.http.HttpRequestInterceptor itcp, int index)
addRequestInterceptor
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 clearRequestInterceptors()
clearRequestInterceptors
in interface org.apache.http.protocol.HttpRequestInterceptorList
public void removeRequestInterceptorByClass(java.lang.Class clazz)
removeRequestInterceptorByClass
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, java.lang.InterruptedException
HttpClient
default context
.
See there for details.
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 problem
java.lang.InterruptedException
- in case of an interrupt
public final org.apache.http.HttpResponse execute(HttpUriRequest request, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, java.io.IOException, java.lang.InterruptedException
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
java.lang.InterruptedException
- in case of an interrupt
public org.apache.http.HttpResponse execute(RoutedRequest roureq) throws org.apache.http.HttpException, java.io.IOException, java.lang.InterruptedException
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
java.lang.InterruptedException
- in case of an interrupt
public final org.apache.http.HttpResponse execute(RoutedRequest roureq, org.apache.http.protocol.HttpContext context) throws org.apache.http.HttpException, java.io.IOException, java.lang.InterruptedException
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
java.lang.InterruptedException
- in case of an interrupt
protected org.apache.http.params.HttpParams determineParams(org.apache.http.HttpRequest req)
ClientParamsStack
from the request parameters
and the client parameters.
execute(RoutedRequest,HttpContext)
to obtain the parameters for the
DefaultClientRequestDirector
.
req
- the request that will be executed
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 |