public class HttpClientFactoryBean extends AbstractComponentAwareFactoryBean<HttpClient>
HttpClientBuilder and to then emit a HttpClient.| Modifier and Type | Field and Description |
|---|---|
private net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder |
builder
Our captive builder.
|
private long |
connectionRequestTimeout
Connection request timeout.
We need this field to ensure that Spring does the conversion. |
private long |
connectionTimeout
Connection timeout.
We need this field to ensure that Spring does the conversion. |
private long |
socketTimeout
Socket timeout.
We need this field to ensure that Spring does the conversion. |
logger| Constructor and Description |
|---|
HttpClientFactoryBean()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder |
createHttpClientBuilder()
Create and return the instance of
HttpClientBuilder to use. |
protected HttpClient |
doCreateInstance()
Call the parent class to create the instance.
|
protected net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder |
getHttpClientBuilder()
Get the instance of
HttpClientBuilder to use. |
Class<HttpClient> |
getObjectType() |
void |
setConnectionDisregardTLSCertificate(boolean disregard)
Sets whether the responder's SSL/TLS 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 |
setConnectionRequestTimeout(long timeout)
Sets the maximum length of time in milliseconds to wait for a connection to be returned from the connection
manager.
|
void |
setConnectionTimeout(long timeout)
Sets the maximum length of time in milliseconds to wait for the connection to be established.
|
void |
setMaxConnectionsPerRoute(int max)
Sets the max simultaneous connections per route allowed by the pooling connection manager.
|
void |
setMaxConnectionsTotal(int max)
Sets the max total simultaneous connections allowed by the pooling connection manager.
|
void |
setSocketTimeout(long timeout)
Sets the maximum period inactivity between two consecutive data packets in milliseconds.
|
void |
setTLSSocketFactory(LayeredConnectionSocketFactory factory)
Set the TLS socket factory to use.
|
void |
setUserAgent(String agent)
Sets the user agent to be used when talking to the server.
|
createInstance, destroyInstanceafterPropertiesSet, destroy, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonprivate final net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder builder
@Duration private long connectionTimeout
@Duration private long connectionRequestTimeout
@Duration private long socketTimeout
public Class<HttpClient> getObjectType()
getObjectType in interface FactoryBean<HttpClient>getObjectType in class AbstractFactoryBean<HttpClient>public void setMaxConnectionsTotal(int max)
max - the max total connectionpublic void setMaxConnectionsPerRoute(int max)
max - the max connections per route@Duration
public void setConnectionTimeout(@Duration
long timeout)
timeout - maximum length of time in milliseconds to wait for the connection to be established@Duration
public void setConnectionRequestTimeout(@Duration
long timeout)
timeout - maximum length of time in milliseconds to wait for a connection from the connection manager@Duration
public void setSocketTimeout(@Duration
long timeout)
timeout - maximum length of time in milliseconds between two consecutive data packetspublic void setTLSSocketFactory(@Nullable LayeredConnectionSocketFactory factory)
factory - the new socket factory, may be nullpublic void setConnectionDisregardTLSCertificate(boolean disregard)
disregard - whether the responder's SSL/TLS certificate should be ignoredpublic void setConnectionProxyHost(String host)
host - hostname of the default proxy used when making connectionpublic void setConnectionProxyPort(int port)
port - port of the default proxy used when making connection; must be greater than 0 and less than 65536public void setConnectionProxyUsername(String usename)
usename - username to use when authenticating to the proxy; may be nullpublic void setConnectionProxyPassword(String password)
password - password used when authenticating to the proxy; may be nullpublic void setUserAgent(@Nullable String agent)
agent - what to setprotected net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder createHttpClientBuilder()
HttpClientBuilder to use.
Subclasses may override to build a specialized subclass.protected net.shibboleth.utilities.java.support.httpclient.HttpClientBuilder getHttpClientBuilder()
HttpClientBuilder to use.protected HttpClient doCreateInstance() throws Exception
doCreateInstance in class AbstractComponentAwareFactoryBean<HttpClient>Exception - if needed.Copyright © 1999–2016 Shibboleth Consortium. All rights reserved.