|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.googlecode.xremoting.core.commonshttpclient.HttpClientBuilder
public class HttpClientBuilder
Used to build an HttpClient using method chain pattern.
| Constructor Summary | |
|---|---|
HttpClientBuilder()
|
|
| Method Summary | |
|---|---|
HttpClientBuilder |
authPreemprive(boolean pre)
Sets whether the resulting HttpClient should send authorization before it's requested by the server. |
HttpClientBuilder |
basicAuth(String username,
String password)
Turns on a Basic authentication. |
HttpClientBuilder |
basicAuthHost(String host)
Constraints host for which Basic auth is sent. |
HttpClientBuilder |
basicAuthPort(int port)
Constraints port for which Basic auth is sent. |
org.apache.commons.httpclient.HttpClient |
build()
Builds the configured HttpClient. |
static HttpClientBuilder |
create()
Creates a new builder. |
HttpClientBuilder |
keyStore(URL url,
String password)
Configures a key store for the current SSL host (see ssl(String)). |
HttpClientBuilder |
proxyHost(String host)
Sets proxy host. |
HttpClientBuilder |
proxyPort(int port)
Sets proxy port. |
HttpClientBuilder |
securePort(int port)
Configures secure port for the HTTPS for current host (see ssl(String)). |
HttpClientBuilder |
secureSchema(String schema)
Configures secure schema for the HTTPS for current host (see ssl(String)). |
HttpClientBuilder |
ssl(String host)
Begins SSL configuration for the given host. |
HttpClientBuilder |
timeouts(int connectionTimeout,
int soTimeout,
long connectionManagerTimeout)
Configures timeouts of the HttpClient being built. |
HttpClientBuilder |
trustKeyStore(URL url,
String password)
Configures a trust store for the current SSL host (see ssl(String)). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public HttpClientBuilder()
| Method Detail |
|---|
public static HttpClientBuilder create()
public HttpClientBuilder proxyHost(String host)
host - proxy host
public HttpClientBuilder proxyPort(int port)
port - proxy port
proxyHost(String)public HttpClientBuilder authPreemprive(boolean pre)
pre - whether to use auth preemptive
basicAuth(String, String)
public HttpClientBuilder basicAuth(String username,
String password)
username - username to sendpassword - password to send
basicAuthHost(String),
basicAuthPort(int)public HttpClientBuilder basicAuthHost(String host)
host - host for which to send Basic auth (for others it will not
be sent)
basicAuth(String, String)public HttpClientBuilder basicAuthPort(int port)
port - port for which to send Basic auth (for others it will not
be sent)
basicAuth(String, String)public HttpClientBuilder ssl(String host)
trustKeyStore(URL, String),
keyStore(URL, String), secureSchema(String),
securePort(int)).
Allows to enable both server validation (by supplying keyStore) and
client authentication (by supplying trustKeyStore).
host - host for which to enable SSL
trustKeyStore(URL, String),
keyStore(URL, String),
secureSchema(String),
securePort(int)
public HttpClientBuilder trustKeyStore(URL url,
String password)
ssl(String)). If set, SSL client authentication will be used
when connecting to that host (i.e. the client certificate will be sent).
url - URL from which to obtain trust storepassword - trust store password
ssl(String),
keyStore(URL, String)
public HttpClientBuilder keyStore(URL url,
String password)
ssl(String)). If set, SSL server validation will be used (i.e.
the server certificate will be requested and validated).
url - URL from which to obtain key storepassword - key store password
ssl(String),
trustKeyStore(URL, String)public HttpClientBuilder secureSchema(String schema)
ssl(String)).
schema - secure schema (usually, this is "https")
ssl(String)public HttpClientBuilder securePort(int port)
ssl(String)).
port - secure port (if this method is not called, it's
defaulted to 443)
ssl(String)
public HttpClientBuilder timeouts(int connectionTimeout,
int soTimeout,
long connectionManagerTimeout)
connectionTimeout - time in millis for connection to
be establishedsoTimeout - SO timeout (millis)connectionManagerTimeout - time in millis for connection to
be obtained from connection manager
public org.apache.commons.httpclient.HttpClient build()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||