Class DefaultOutboundHttpClientFactory

java.lang.Object
de.hybris.platform.outboundservices.client.impl.DefaultOutboundHttpClientFactory
All Implemented Interfaces:
OutboundHttpClientFactory

public class DefaultOutboundHttpClientFactory extends Object implements OutboundHttpClientFactory
Default implementation of the OutboundHttpClientFactory
  • Constructor Details

    • DefaultOutboundHttpClientFactory

      public DefaultOutboundHttpClientFactory()
      Instantiates this factory. The instantiated factory uses a context configuration, which is defined in the application context as a Spring bean named "outboundServicesConfiguration"
    • DefaultOutboundHttpClientFactory

      public DefaultOutboundHttpClientFactory(OutboundServicesConfiguration cfg)
      Instantiates this factory with the provided configuration service.
      Parameters:
      cfg - implementation of the configuration service to use for retrieving configuration parameters for the HttpClient instances created by this factory. If null, then connection properties configured for this factory will be used.
  • Method Details

    • create

      public org.apache.http.client.HttpClient create()
      Description copied from interface: OutboundHttpClientFactory
      Creates a HttpClient
      Specified by:
      create in interface OutboundHttpClientFactory
      Returns:
      HttpClient
    • createRequestConfig

      protected org.apache.http.client.config.RequestConfig createRequestConfig()
      Creates a request configuration to be used by the HttpClient this factory creates.
      Returns:
      a configuration in the state to be used by the client "as is".
    • createPoolingHttpClientConnectionManager

      protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager createPoolingHttpClientConnectionManager()
      Creates a connection manager to be used by the HttpClient this factory creates
      Returns:
      a fully configured instance of connection manager to be used "as is" by the client.
    • getConnectionManager

      protected org.apache.http.impl.conn.PoolingHttpClientConnectionManager getConnectionManager()
      Creates a connection manager that is configured then by the createPoolingHttpClientConnectionManager() method.
      Returns:
      a fresh instance of the connection manager. This implementation also initializes the connection manager to work for HTTP and HTTPS connections.
    • getHttpClientBuilder

      protected org.apache.http.impl.client.HttpClientBuilder getHttpClientBuilder()
      Creates an HttpClientBuilder used to create an HttpClient instance. The builder is then populated with the request configuration created by createRequestConfig() method, and the connection manager created by the createPoolingHttpClientConnectionManager(), the keep alive setting.
      Returns:
      an instance of the builder.
    • getMaxConnections

      protected int getMaxConnections()
    • setMaxConnections

      public void setMaxConnections(int maxConnections)
    • getKeepAlive

      public int getKeepAlive()
    • setKeepAlive

      public void setKeepAlive(int keepAlive)
    • getTimeout

      public int getTimeout()
    • setTimeout

      public void setTimeout(int timeout)
    • getValidity

      public int getValidity()
    • setValidity

      public void setValidity(int validity)