|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.shibboleth.utilities.java.support.httpclient.HttpClientBuilder
public class HttpClientBuilder
Builder used to construct HttpClient objects configured with particular settings.
| Field Summary | |
|---|---|
private boolean |
connectionCloseAfterResponse
Whether to instruct the server to close the connection after it has sent its response. |
private boolean |
connectionDisregardSslCertificate
Whether the SSL certificates used by the responder should be ignored. |
private String |
connectionProxyHost
Host name of the HTTP proxy server through which connections will be made. |
private String |
connectionProxyPassword
Password used to connect to the HTTP proxy server. |
private int |
connectionProxyPort
Port number of the HTTP proxy server through which connections will be made. |
private String |
connectionProxyUsername
Username used to connect to the HTTP proxy server. |
private int |
connectionsMaxPerRoute
Maximum number of connections that may be opened to a single host. |
private int |
connectionsMaxTotal
Total number of connections that may be open. |
private boolean |
connectionStalecheck
Whether to check a connection for staleness before using. |
private int |
connectionTimeout
Maximum length of time in milliseconds to wait for the connection to be established. |
private String |
httpContentCharSet
Character set used for HTTP entity content. |
private boolean |
httpFollowRedirects
Whether to follow HTTP redirects. |
private int |
socketBufferSize
Socket buffer size in bytes. |
private InetAddress |
socketLocalAddress
Local IP address used when establishing connections. |
private int |
socketTimeout
Maximum period inactivity between two consecutive data packets in milliseconds. |
| Constructor Summary | |
|---|---|
HttpClientBuilder()
Constructor. |
|
| Method Summary | |
|---|---|
HttpClient |
buildClient()
Constructs an HttpClient using the settings of this builder. |
private ClientConnectionManager |
buildConnectionManager()
Builds the connection manager used by the HTTP client. |
private SchemeRegistry |
buildSchemeRegistry()
Creates the default scheme registry for connection. |
String |
getConnectionProxyHost()
Gets the hostname of the default proxy used when making connection. |
String |
getConnectionProxyPassword()
Gets the password used when authenticating to the proxy. |
int |
getConnectionProxyPort()
Gets the port of the default proxy used when making connection. |
String |
getConnectionProxyUsername()
Gets the username to use when authenticating to the proxy. |
int |
getConnectionsMaxPerRoute()
Gets the maximum number of connection per route. |
int |
getConnectionsMaxTotal()
Gets the maximum number of connections that may be open at any given time when pooling is used. |
int |
getConnectionTimeout()
Gets the maximum length of time in milliseconds to wait for the connection to be established. |
String |
getHttpContentCharSet()
Gets the character set used with the HTTP entity (body). |
int |
getSocketBufferSize()
Gets the size of the socket buffer, in bytes, used for request/response buffering. |
InetAddress |
getSocketLocalAddress()
Gets the local IP address used when making requests. |
int |
getSocketTimeout()
Gets the maximum period inactivity between two consecutive data packets in milliseconds. |
boolean |
isConnectionCloseAfterResponse()
Gets whether to instruct the server to close the connection after it has sent its response. |
boolean |
isConnectionDisregardSslCertificate()
Gets whether the responder's SSL certificate should be ignored. |
boolean |
isConnectionStalecheck()
Gets whether reused connections are checked if they are closed before being used by the client. |
boolean |
isHttpFollowRedirects()
Gets whether HTTP redirects will be followed. |
void |
resetDefaults()
Resets all builder parameters to their defaults. |
void |
setConnectionCloseAfterResponse(boolean close)
Sets whether to instruct the server to close the connection after it has sent its response. |
void |
setConnectionDisregardSslCertificate(boolean disregard)
Sets whether the responder's SSL certificate should be ignored. |
void |
setConnectionProxyHost(String host)
Sets the hostname of the default proxy used when making connection. |
void |
setConnectionProxyPassword(String password)
Sets the password used when authenticating to the proxy. |
void |
setConnectionProxyPort(int port)
Sets the port of the default proxy used when making connection. |
void |
setConnectionProxyUsername(String usename)
Sets the username to use when authenticating to the proxy. |
void |
setConnectionsMaxPerRoute(int max)
Sets the maximum number of connection per route. |
void |
setConnectionsMaxTotal(int max)
Sets the maximum number of connections that may be open at any given time when pooling is used. |
void |
setConnectionStalecheck(boolean check)
Sets whether reused connections are checked if they are closed before being used by the client. |
void |
setConnectionTimeout(int timeout)
Sets the maximum length of time in milliseconds to wait for the connection to be established. |
void |
setHttpContentCharSet(String charSet)
Sets the character set used with the HTTP entity (body). |
void |
setHttpFollowRedirects(boolean followRedirects)
Gets whether HTTP redirects will be followed. |
void |
setSocketBufferSize(int size)
Sets size of the socket buffer, in bytes, used for request/response buffering. |
void |
setSocketLocalAddress(InetAddress address)
Sets the local IP address used when making requests. |
void |
setSocketLocalAddress(String ipOrHost)
Sets the local IP address used when making requests. |
void |
setSocketTimeout(int timeout)
Sets the maximum period inactivity between two consecutive data packets in milliseconds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private InetAddress socketLocalAddress
private int socketTimeout
private int socketBufferSize
private int connectionTimeout
private boolean connectionDisregardSslCertificate
private boolean connectionCloseAfterResponse
private boolean connectionStalecheck
private int connectionsMaxTotal
private int connectionsMaxPerRoute
private String connectionProxyHost
private int connectionProxyPort
private String connectionProxyUsername
private String connectionProxyPassword
private boolean httpFollowRedirects
private String httpContentCharSet
| Constructor Detail |
|---|
public HttpClientBuilder()
| Method Detail |
|---|
public void resetDefaults()
public InetAddress getSocketLocalAddress()
public void setSocketLocalAddress(InetAddress address)
address - local IP address used when making requests
public void setSocketLocalAddress(String ipOrHost)
throws UnknownHostException
ipOrHost - IP address or hostname, never null
UnknownHostException - thrown if the given IP or hostname can not be resolvedpublic int getSocketTimeout()
public void setSocketTimeout(int timeout)
timeout - maximum period inactivity between two consecutive data packets in millisecondspublic int getSocketBufferSize()
public void setSocketBufferSize(int size)
size - size of the socket buffer, in bytes, used for request/response buffering; must be greater than 0public int getConnectionTimeout()
public void setConnectionTimeout(int timeout)
timeout - maximum length of time in milliseconds to wait for the connection to be establishedpublic boolean isConnectionDisregardSslCertificate()
public void setConnectionDisregardSslCertificate(boolean disregard)
disregard - whether the responder's SSL certificate should be ignoredpublic boolean isConnectionCloseAfterResponse()
public void setConnectionCloseAfterResponse(boolean close)
close - whether to instruct the server to close the connection after it has sent its responsepublic boolean isConnectionStalecheck()
public void setConnectionStalecheck(boolean check)
check - whether reused connections are checked if they are closed before being used by the clientpublic int getConnectionsMaxTotal()
public void setConnectionsMaxTotal(int max)
max - maximum number of connections that may be open at any given time when pooling is used; must be greater
than zeropublic int getConnectionsMaxPerRoute()
public void setConnectionsMaxPerRoute(int max)
max - maximum number of connection per route; must be greater than zeropublic String getConnectionProxyHost()
public void setConnectionProxyHost(String host)
host - hostname of the default proxy used when making connectionpublic int getConnectionProxyPort()
public void setConnectionProxyPort(int port)
port - port of the default proxy used when making connection; must be greater than 0 and less than 65536public String getConnectionProxyUsername()
public void setConnectionProxyUsername(String usename)
usename - username to use when authenticating to the proxy; may be nullpublic String getConnectionProxyPassword()
public void setConnectionProxyPassword(String password)
password - password used when authenticating to the proxy; may be nullpublic boolean isHttpFollowRedirects()
public void setHttpFollowRedirects(boolean followRedirects)
followRedirects - true if redirects are followed, false otherwisepublic String getHttpContentCharSet()
public void setHttpContentCharSet(String charSet)
charSet - character set used with the HTTP entity (body)public HttpClient buildClient()
HttpClient using the settings of this builder.
private ClientConnectionManager buildConnectionManager()
ThreadSafeClientConnManager is used with
ThreadSafeClientConnManager.setDefaultMaxPerRoute(int) set to connectionsMaxPerRoute and
ThreadSafeClientConnManager.setMaxTotal(int) set to connectionsMaxTotal.
private SchemeRegistry buildSchemeRegistry()
connectionDisregardSslCertificate is true, than the https
port will accept any certificate presented by the responder.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||