Class TLcdBingMapsTransportFactory

java.lang.Object
com.luciad.io.transport.TLcdTransportFactory
com.luciad.format.bingmaps.TLcdBingMapsTransportFactory
All Implemented Interfaces:
ILcdTransportFactory

public class TLcdBingMapsTransportFactory extends TLcdTransportFactory
TLcdTransportFactory extension for Bing Maps, tailored for efficiency and reliability. This transport factory has HTTP caching enabled by default with a maximum cached entries setting of 1000. It also configures a retry-policy.
Since:
11.0
  • Field Details

    • TRANSPORT_TYPE_DEFAULT

      public static String TRANSPORT_TYPE_DEFAULT
  • Constructor Details

    • TLcdBingMapsTransportFactory

      public TLcdBingMapsTransportFactory()
      Constructs a Bing Maps transport factory, with caching enabled by default with a maximum cached entries setting of 1000 .
  • Method Details

    • isSupportCaching

      public boolean isSupportCaching()
      Deprecated.
      Returns whether or not transports created by this factory use HTTP caching.
      Returns:
      true if http caching should be supported, false otherwise.
      See Also:
    • getMaxNbOfCachedObjects

      public int getMaxNbOfCachedObjects()
      Enables or disables http caching for transports created by this factory. Default value is true.
      See Also:
    • createTransport

      public ILcdTransport createTransport(String aTransportType, Object aParameter)
      Deprecated.
      Creates a transport to be used by a client. This method supports the creation of different types of transports and allows users to configure it to their needs.

      The currently supported transport is based upon Apache HttpClient 4.5.2. Use TRANSPORT_TYPE_DEFAULT for the aTransportType parameter to create this transport. The aParameter parameter should be a fully configured org.apache.commons.httpclient.HttpClient. To create a valid HttpClient, you can use the createTransportConfiguration(String) method.

      The transport supports the HTTP and HTTPS protocols. Request performed on the transport with other protocols will result in an IOException.

      Note: the cache settings won't affect the returned transport. If Http caching is required, it should be configured on the passed parameter (see addCaching(java.lang.String, java.lang.Object).
      Parameters:
      aTransportType - The type of transport to create, this should be one of the constants that are available in this class.
      aParameter - A parameter that can be used to initialize the transport, the required type depends on aTransportType.
      Returns:
      a transport of the requested type.
      Throws:
      IllegalArgumentException - in case the requested type is not supported.
    • createTransportConfiguration

      public Object createTransportConfiguration(String aTransportType)
      Deprecated.
      Creates a valid configuration parameter that can be used to create the corresponding transport. This method will ensure that the transport will be configured optimally by default.

      To create a transport with a custom configuration, call this method with the constant corresponding to the desired type of transport. The returned Object can then be cast to the type listed below and modified as desired.

      The available transport types and their corresponding return types:

      Note: no caching will be have been configured. To configure Http caching afterwards, you can use the method addCaching(String, Object).
      Parameters:
      aTransportType - The type of transport for which a configuration parameter needs to be created.
      Returns:
      A valid transport configuration.
    • addCaching

      public Object addCaching(String aTransportType, Object aParameter)
      Adds caching to a valid configuration parameter. Note that this is only guaranteed to work for a configuration parameter created with createTransportConfiguration(String) using the same transport type. Any changes to the configuration parameter should be done before caching is added. This method will add caching even if isSupportCaching() returns false. The value returned by getMaxNbOfCachedObjects() will be used to determine the maximum number of object to be cached.
      Parameters:
      aTransportType - The type of transport for which a caching needs to be configured.
      aParameter - the valid configuration parameter.
      Returns:
      A valid transport configuration with caching.
      See Also:
    • createConfiguration

      public Object createConfiguration()
      Description copied from class: TLcdTransportFactory
      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 TLcdTransportFactory.setCaching(boolean) and TLcdTransportFactory.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.

      Overrides:
      createConfiguration in class TLcdTransportFactory
      Returns:
      a valid transport configuration of type HttpClient
      See Also: