public class HttpClientConnectionHelper
extends java.lang.Object
DefaultHttpClient
and PoolingClientConnectionManager
.
Additionally it allows the use of proxy connection with the call of ProxyInfoProvider
.
To start the comms. call initializeComm()
and at the end cleanUp()
to close the comms.Constructor and Description |
---|
HttpClientConnectionHelper() |
HttpClientConnectionHelper(int maxTotalConnections,
int defaultMaxConnectionsPerRoute,
int connectionTimeout,
boolean initializeProxyRoutePlanner) |
Modifier and Type | Method and Description |
---|---|
void |
autenticateProxyIfNeeded(org.apache.http.HttpResponse iGetResultCode) |
void |
autenticateProxyIfNeeded(org.apache.http.HttpResponse iGetResultCode,
org.apache.http.protocol.HttpContext localContext)
Call this after calling client.execute in order to execute proxy authentication if needed.
|
void |
cleanUp()
This has to be called to cleanup.
|
org.apache.http.impl.client.DefaultHttpClient |
getClient() |
int |
getConnectionTimeout() |
int |
getDefaultMaxConnectionsPerRoute() |
org.apache.http.impl.conn.PoolingClientConnectionManager |
getHttpConnectionManager() |
int |
getMaxTotalConnections() |
void |
initializeComm()
Call this to initialize the comms.
|
boolean |
isInitializeProxyRoutePlanner() |
public HttpClientConnectionHelper()
public HttpClientConnectionHelper(int maxTotalConnections, int defaultMaxConnectionsPerRoute, int connectionTimeout, boolean initializeProxyRoutePlanner)
maxTotalConnections
- defaultMaxConnectionsPerRoute
- connectionTimeout
- initializeProxyRoutePlanner
- public void initializeComm()
public void cleanUp()
public org.apache.http.impl.client.DefaultHttpClient getClient()
public org.apache.http.impl.conn.PoolingClientConnectionManager getHttpConnectionManager()
public int getMaxTotalConnections()
public int getDefaultMaxConnectionsPerRoute()
public int getConnectionTimeout()
public boolean isInitializeProxyRoutePlanner()
public void autenticateProxyIfNeeded(org.apache.http.HttpResponse iGetResultCode)
public void autenticateProxyIfNeeded(org.apache.http.HttpResponse iGetResultCode, org.apache.http.protocol.HttpContext localContext)
iGetResultCode
- localContext
- Copyright © 2004-2014 FEUP-LSTS and Neptus developers. All Rights Reserved.