Package com.onlinepayments.communication
Class DefaultConnectionBuilder
java.lang.Object
com.onlinepayments.communication.DefaultConnectionBuilder
Builder for
DefaultConnection objects.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Creates a fully initializedDefaultConnectionobject.withConnectionReuse(boolean connectionReuse) Sets whether or not connections should be reused.withHttpsProtocols(Set<String> httpsProtocols) Sets the HTTPS protocols to support.withMaxConnections(int maxConnections) Sets the maximum number of connections.withProxyConfiguration(ProxyConfiguration proxyConfiguration) Sets the proxy configuration to use.withSslConnectionSocketFactory(org.apache.http.conn.ssl.SSLConnectionSocketFactory sslConnectionSocketFactory) Sets a custom SSL connection socket factory to use.
-
Constructor Details
-
DefaultConnectionBuilder
public DefaultConnectionBuilder(int connectTimeout, int socketTimeout)
-
-
Method Details
-
withMaxConnections
Sets the maximum number of connections. Defaults toCommunicatorConfiguration.DEFAULT_MAX_CONNECTIONS. -
withConnectionReuse
Sets whether or not connections should be reused. Defaults to on (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
NoHttpResponseExceptionto be thrown. -
withProxyConfiguration
Sets the proxy configuration to use. Defaults to no proxy configuration. -
withHttpsProtocols
Sets the HTTPS protocols to support. Defaults toCommunicatorConfiguration.DEFAULT_HTTPS_PROTOCOLS.This method is mutually exclusive with
withSslConnectionSocketFactory(SSLConnectionSocketFactory). -
withSslConnectionSocketFactory
public DefaultConnectionBuilder withSslConnectionSocketFactory(org.apache.http.conn.ssl.SSLConnectionSocketFactory sslConnectionSocketFactory) Sets a custom SSL connection socket factory to use.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). -
build
Creates a fully initializedDefaultConnectionobject.
-