public class TLcdBingMapsTransportFactory extends TLcdTransportFactory
Modifier and Type | Field and Description |
---|---|
static String |
TRANSPORT_TYPE_DEFAULT |
Constructor and Description |
---|
TLcdBingMapsTransportFactory()
Constructs a Bing Maps transport factory, with caching enabled by default with a maximum cached entries setting of 1000 .
|
Modifier and Type | Method and Description |
---|---|
Object |
addCaching(String aTransportType,
Object aParameter)
Deprecated.
use
TLcdTransportFactory.setCaching(boolean) instead |
Object |
createConfiguration()
Creates a valid transport configuration that can be used to create a transport.
|
ILcdTransport |
createTransport(String aTransportType,
Object aParameter)
Deprecated.
use the
TLcdTransportFactory.createTransport(Object) method instead |
Object |
createTransportConfiguration(String aTransportType)
Deprecated.
use
createConfiguration() instead |
int |
getMaxNbOfCachedObjects()
Deprecated.
use
TLcdTransportFactory.getMaxCacheEntries() instead |
boolean |
isSupportCaching()
Deprecated.
use
TLcdTransportFactory.isCaching() instead |
createTransport, createTransport, getMaxCacheEntries, getMaxConnectionsPerRoute, getMaxTotalConnections, isCaching, setCaching, setMaxCacheEntries, setMaxConnectionsPerRoute, setMaxTotalConnections
public static String TRANSPORT_TYPE_DEFAULT
public TLcdBingMapsTransportFactory()
public boolean isSupportCaching()
TLcdTransportFactory.isCaching()
insteadTLcdTransportFactory.setCaching(boolean)
,
TLcdTransportFactory.getMaxCacheEntries()
public int getMaxNbOfCachedObjects()
TLcdTransportFactory.getMaxCacheEntries()
insteadpublic ILcdTransport createTransport(String aTransportType, Object aParameter)
TLcdTransportFactory.createTransport(Object)
method instead
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 (seeaddCaching(java.lang.String, java.lang.Object)
.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.IllegalArgumentException
- in case the requested type is not supported.public Object createTransportConfiguration(String aTransportType)
createConfiguration()
insteadObject
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 an
org.apache.http.impl.client.AbstractHttpClient
addCaching(String, Object)
.aTransportType
- The type of transport for which a configuration parameter needs to
be created.public Object addCaching(String aTransportType, Object aParameter)
TLcdTransportFactory.setCaching(boolean)
insteadcreateTransportConfiguration(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.aTransportType
- The type of transport for which a caching needs to be configured.aParameter
- the valid configuration parameter.createTransport(String, Object)
public Object createConfiguration()
TLcdTransportFactory
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.createConfiguration
in class TLcdTransportFactory
HttpClient
TLcdTransportFactory.createTransport(Object)