Class TLcdTransportFactory

java.lang.Object
com.luciad.io.transport.TLcdTransportFactory
All Implemented Interfaces:
ILcdTransportFactory
Direct Known Subclasses:
TLcdBingMapsTransportFactory

public class TLcdTransportFactory extends Object implements ILcdTransportFactory
Default transport factory for HTTP transports, based on Apache's HttpClient library 4.5.2.
Since:
2013.0
  • Constructor Details

    • TLcdTransportFactory

      public TLcdTransportFactory()
  • Method Details

    • createTransport

      public ILcdTransport createTransport()
      Creates a new transport based on Apache's HttpClient library 4.5.2.
      Specified by:
      createTransport in interface ILcdTransportFactory
      Returns:
      a new transport, never null
    • isCaching

      public boolean isCaching()
      Tells whether or not HTTP caching is enabled for transports created by this factory. When enabled, HTTP requests are cached. Default is disabled.
      Returns:
      true if caching is enabled, false otherwise
      See Also:
    • setCaching

      public void setCaching(boolean aOn)
      Enables or disables caching for transports created by this factory. Default is disabled.
      Parameters:
      aOn - when true, transports created by this factory will cache HTTP requests
      See Also:
    • getMaxCacheEntries

      public int getMaxCacheEntries()
      Returns the maximum number of cache entries for transports created by this factory. Sane values should be positive, but this factory does not enforce this. Default is 1000.
      Returns:
      the maximum number of cache entries in the HTTP cache
      See Also:
    • setMaxCacheEntries

      public void setMaxCacheEntries(int aMaxCacheEntries)
      Setter for the maximum number of cache entries used by transports created by this factory. For the purpose of BingMaps imagery, the objects that will be cached will be compressed (JPEG) Bing tiles.

      Default value is 1000.

      Parameters:
      aMaxCacheEntries - the maximum number of cache entries.
      See Also:
    • getMaxConnectionsPerRoute

      public int getMaxConnectionsPerRoute()
      Gets the maximum number of connections per route. The default is 2. Negative values mean that the implementation's default will be used.
      Returns:
      maximum number of connections per route
    • setMaxConnectionsPerRoute

      public void setMaxConnectionsPerRoute(int aMaxConnectionsPerRoute)
      Sets the maximum number of connections per route. The default value is 2. Negative values mean that the implementation's default will be used.
      Parameters:
      aMaxConnectionsPerRoute - the maximum number of connections per route
    • getMaxTotalConnections

      public int getMaxTotalConnections()
      Gets the maximum number of total connections. The default is 20. Negative values mean that the implementation's default will be used.
      Returns:
      the maximum number of total connections
    • setMaxTotalConnections

      public void setMaxTotalConnections(int aMaxTotalConnections)
      Sets the maximum number of total connections. The default is 20. Negative values mean that the implementation's default will be used.
      Parameters:
      aMaxTotalConnections - the maximum number of total connections
    • createTransport

      public ILcdTransport createTransport(Object aConfiguration)
      Creates a transport using Apache's HttpClient 4.5.2, with a transport configuration of type HttpClient.

      The transport configuration should have been created by an earlier call to createConfiguration().

      Parameters:
      aConfiguration - a transport configuration, which must be of type HttpClient
      Returns:
      a transport
      Throws:
      IllegalArgumentException - if the transport configuration is incompatible with the transports created by this factory
    • createConfiguration

      public Object createConfiguration()
      Creates a valid transport configuration that can be used to create a transport. This factory creates transport configurations of type HttpClient.

      To customize the configuration, cast the object to HttpClient and configure it accordingly.

      In order to configure caching, you can use the methods setCaching(boolean) and setMaxCacheEntries(int) on this factory.

      If you want to customize caching even further, you can also decorate the HttpClient configuration object with a CachingHttpClient yourself. If you do this, you should disable caching on this factory.

      Returns:
      a valid transport configuration of type HttpClient
      See Also: