public class DefaultConnectionBuilder extends Object
DefaultConnection
objects.Constructor and Description |
---|
DefaultConnectionBuilder(int connectTimeout,
int socketTimeout) |
Modifier and Type | Method and Description |
---|---|
DefaultConnection |
build()
Creates a fully initialized
DefaultConnection object. |
DefaultConnectionBuilder |
withConnectionReuse(boolean connectionReuse)
Sets whether or not connections should be reused.
|
DefaultConnectionBuilder |
withHttpsProtocols(Set<String> httpsProtocols)
Sets the HTTPS protocols to support.
|
DefaultConnectionBuilder |
withMaxConnections(int maxConnections)
Sets the maximum number of connections.
|
DefaultConnectionBuilder |
withProxyConfiguration(ProxyConfiguration proxyConfiguration)
Sets the proxy configuration to use.
|
DefaultConnectionBuilder |
withSslConnectionSocketFactory(org.apache.http.conn.ssl.SSLConnectionSocketFactory sslConnectionSocketFactory)
Sets a custom SSL connection socket factory to use.
|
public DefaultConnectionBuilder(int connectTimeout, int socketTimeout)
public DefaultConnectionBuilder withMaxConnections(int maxConnections)
CommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS
.public DefaultConnectionBuilder withConnectionReuse(boolean connectionReuse)
true
).
This method can be used to turn off connection reuse. This may be necessary in case (proxy) servers do not
handle reused connections well. This may lead to instances of NoHttpResponseException
to be thrown.
public DefaultConnectionBuilder withProxyConfiguration(ProxyConfiguration proxyConfiguration)
public DefaultConnectionBuilder withHttpsProtocols(Set<String> httpsProtocols)
CommunicatorConfiguration.DEFAULT_HTTPS_PROTOCOLS
.
This method is mutually exclusive with withSslConnectionSocketFactory(SSLConnectionSocketFactory)
.
public DefaultConnectionBuilder withSslConnectionSocketFactory(org.apache.http.conn.ssl.SSLConnectionSocketFactory sslConnectionSocketFactory)
This method can be used to provide a fully customizable SSL connection socket factory, in case the SSL connection socket factory that is created by default cannot be used due to SSL issues.
This method is mutually exclusive with withHttpsProtocols(Set)
.
public DefaultConnection build()
DefaultConnection
object.Copyright © 2024 Worldline Global Collect. All rights reserved.