Package com.luciad.io.transport
Class TLcdTransportFactory
java.lang.Object
com.luciad.io.transport.TLcdTransportFactory
- All Implemented Interfaces:
ILcdTransportFactory
- Direct Known Subclasses:
TLcdBingMapsTransportFactory
Default transport factory for HTTP transports, based on Apache's HttpClient library 4.5.2.
- Since:
- 2013.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionCreates a valid transport configuration that can be used to create a transport.Creates a new transport based on Apache's HttpClient library 4.5.2.createTransport
(Object aConfiguration) Creates a transport using Apache'sHttpClient
4.5.2, with a transport configuration of typeHttpClient
.int
Returns the maximum number of cache entries for transports created by this factory.int
Gets the maximum number of connections per route.int
Gets the maximum number of total connections.boolean
Tells whether or not HTTP caching is enabled for transports created by this factory.void
setCaching
(boolean aOn) Enables or disables caching for transports created by this factory.void
setMaxCacheEntries
(int aMaxCacheEntries) Setter for the maximum number of cache entries used by transports created by this factory.void
setMaxConnectionsPerRoute
(int aMaxConnectionsPerRoute) Sets the maximum number of connections per route.void
setMaxTotalConnections
(int aMaxTotalConnections) Sets the maximum number of total connections.
-
Constructor Details
-
TLcdTransportFactory
public TLcdTransportFactory()
-
-
Method Details
-
createTransport
Creates a new transport based on Apache's HttpClient library 4.5.2.- Specified by:
createTransport
in interfaceILcdTransportFactory
- 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
- whentrue
, 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 is2
. 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 is2
. 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 is20
. 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 is20
. Negative values mean that the implementation's default will be used.- Parameters:
aMaxTotalConnections
- the maximum number of total connections
-
createTransport
Creates a transport using Apache'sHttpClient
4.5.2, with a transport configuration of typeHttpClient
. The transport configuration should have been created by an earlier call tocreateConfiguration()
.- Parameters:
aConfiguration
- a transport configuration, which must be of typeHttpClient
- Returns:
- a transport
- Throws:
IllegalArgumentException
- if the transport configuration is incompatible with the transports created by this factory
-
createConfiguration
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 methodssetCaching(boolean)
andsetMaxCacheEntries(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.- Returns:
- a valid transport configuration of type
HttpClient
- See Also:
-