Package com.luciad.format.bingmaps
Class TLcdBingMapsTransportFactory
java.lang.Object
com.luciad.io.transport.TLcdTransportFactory
com.luciad.format.bingmaps.TLcdBingMapsTransportFactory
- All Implemented Interfaces:
ILcdTransportFactory
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 Summary
-
Constructor Summary
ConstructorDescriptionConstructs a Bing Maps transport factory, with caching enabled by default with a maximum cached entries setting of 1000 . -
Method Summary
Modifier and TypeMethodDescriptionaddCaching
(String aTransportType, Object aParameter) Deprecated.Creates a valid transport configuration that can be used to create a transport.createTransport
(String aTransportType, Object aParameter) Deprecated.use theTLcdTransportFactory.createTransport(Object)
method insteadcreateTransportConfiguration
(String aTransportType) Deprecated.usecreateConfiguration()
insteadint
Deprecated.useTLcdTransportFactory.getMaxCacheEntries()
insteadboolean
Deprecated.useTLcdTransportFactory.isCaching()
insteadMethods inherited from class com.luciad.io.transport.TLcdTransportFactory
createTransport, createTransport, getMaxCacheEntries, getMaxConnectionsPerRoute, getMaxTotalConnections, isCaching, setCaching, setMaxCacheEntries, setMaxConnectionsPerRoute, setMaxTotalConnections
-
Field Details
-
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.useTLcdTransportFactory.isCaching()
insteadReturns 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()Deprecated.useTLcdTransportFactory.getMaxCacheEntries()
insteadEnables or disables http caching for transports created by this factory. Default value is true.- See Also:
-
createTransport
Deprecated.use theTLcdTransportFactory.createTransport(Object)
method insteadCreates 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 theaTransportType
parameter to create this transport. TheaParameter
parameter should be a fully configuredorg.apache.commons.httpclient.HttpClient
. To create a validHttpClient
, you can use thecreateTransportConfiguration(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 (seeaddCaching(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
Deprecated.usecreateConfiguration()
insteadCreates 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 returnedObject
can then be cast to the type listed below and modified as desired. The available transport types and their corresponding return types:-
TRANSPORT_TYPE_DEFAULT
: Creates anorg.apache.http.impl.client.AbstractHttpClient
addCaching(String, Object)
.- Parameters:
aTransportType
- The type of transport for which a configuration parameter needs to be created.- Returns:
- A valid transport configuration.
-
-
addCaching
Deprecated.useTLcdTransportFactory.setCaching(boolean)
insteadAdds caching to a valid configuration parameter. Note that this is only guaranteed to work for a configuration parameter created withcreateTransportConfiguration(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 ifisSupportCaching()
returns false. The value returned bygetMaxNbOfCachedObjects()
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
Description copied from class:TLcdTransportFactory
Creates a valid transport configuration that can be used to create a transport. This factory creates transport configurations of typeHttpClient
. To customize the configuration, cast the object toHttpClient
and configure it accordingly. In order to configure caching, you can use the methodsTLcdTransportFactory.setCaching(boolean)
andTLcdTransportFactory.setMaxCacheEntries(int)
on this factory. If you want to customize caching even further, you can also decorate the HttpClient configuration object with aCachingHttpClient
yourself. If you do this, you should disable caching on this factory.- Overrides:
createConfiguration
in classTLcdTransportFactory
- Returns:
- a valid transport configuration of type
HttpClient
- See Also:
-
TLcdTransportFactory.setCaching(boolean)
instead