|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecteu.emi.client.security.HttpUtils
public class HttpUtils
Contains helper code to create HttpClient instances. The following settings are always set
(depending on configuration passed in Properties object:
MultiThreadedHttpConnectionManager is used with a preconfigured default
values of max connection attempts.
Additionally one can use additional methods of this class to:
HttpClient
preferences API. Note that for convenience some of the HttpClientParams are recognized
too and can be set through Properties argument in one shot.
Contains some code from XFire's CommonsHttpMessageSender
| Field Summary | |
|---|---|
static String |
CONNECT_TIMEOUT
timeout for creating new HTTP connections |
static String |
CONNECTION_CLOSE
If true then connection will be closed immediately after serving the request |
static String |
HTTP_MAX_REDIRECTS
Maximum number of redirects to take. |
static String |
HTTP_NON_PROXY_HOSTS
Space delimited list of hosts for which HTTP proxy shouldn't be used |
static String |
HTTP_PROXY_HOST
HTTP proxy host |
static String |
HTTP_PROXY_PASS
HTTP proxy password |
static String |
HTTP_PROXY_PORT
HTTP proxy port |
static String |
HTTP_PROXY_USER
HTTP proxy user name |
static String |
MAX_HOST_CONNECTIONS
|
static String |
MAX_TOTAL_CONNECTIONS
|
static String |
SO_TIMEOUT
socket read timeout for HTTP |
static String |
USER_AGENT
|
| Method Summary | |
|---|---|
static void |
configureProxy(org.apache.commons.httpclient.HttpClient client,
String uri,
Properties properties)
configure the HTTP proxy settings on the given client |
static void |
configureSSL(org.apache.commons.httpclient.HttpClient client,
IAuthenticationConfiguration security)
|
static org.apache.commons.httpclient.HttpClient |
createClient(Properties properties)
create a HTTP client (code is based on XFire's CommonsHttpMessageSender |
static org.apache.commons.httpclient.HttpClient |
createClient(String uri,
IAuthenticationConfiguration security,
Properties properties)
Convenience method for getting a HttpClient configured
with HTTP proxy support and SSL setup. |
static void |
setConnectionTimeout(org.apache.commons.httpclient.HttpClient client,
int socketTimeout,
int connectTimeout)
Helper method: sets the connection timeout for the HTTP client and the socket timeout. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String USER_AGENT
public static final String CONNECTION_CLOSE
public static final String HTTP_MAX_REDIRECTS
public static final String HTTP_NON_PROXY_HOSTS
public static final String HTTP_PROXY_HOST
public static final String HTTP_PROXY_PORT
public static final String HTTP_PROXY_USER
public static final String HTTP_PROXY_PASS
public static final String MAX_HOST_CONNECTIONS
public static final String MAX_TOTAL_CONNECTIONS
public static final String SO_TIMEOUT
public static final String CONNECT_TIMEOUT
| Method Detail |
|---|
public static org.apache.commons.httpclient.HttpClient createClient(String uri,
IAuthenticationConfiguration security,
Properties properties)
HttpClient configured
with HTTP proxy support and SSL setup.
uri - - URI to connect tosecurity - - security (i.e. SSL) propertiesproperties - - additional properties used to customize the client
public static org.apache.commons.httpclient.HttpClient createClient(Properties properties)
CommonsHttpMessageSender
public static void configureSSL(org.apache.commons.httpclient.HttpClient client,
IAuthenticationConfiguration security)
public static void configureProxy(org.apache.commons.httpclient.HttpClient client,
String uri,
Properties properties)
client - - the HttpClient instanceuri - - the URI to connect to
public static void setConnectionTimeout(org.apache.commons.httpclient.HttpClient client,
int socketTimeout,
int connectTimeout)
client - - the HTTPClientsocketTimeout - socket timeout in millisecondsconnectTimeout - connection timeout in milliseconds
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||