public class TLcdTransportFactory extends Object implements ILcdTransportFactory
Constructor and Description |
---|
TLcdTransportFactory() |
Modifier and Type | Method and Description |
---|---|
Object |
createConfiguration()
Creates a valid transport configuration that can be used to create a transport.
|
ILcdTransport |
createTransport()
Creates a new transport based on Apache's HttpClient library 4.5.2.
|
ILcdTransport |
createTransport(Object aConfiguration)
Creates a transport using Apache's
HttpClient 4.5.2, with a transport configuration of
type HttpClient . |
int |
getMaxCacheEntries()
Returns the maximum number of cache entries for transports created by this factory.
|
int |
getMaxConnectionsPerRoute()
Gets the maximum number of connections per route.
|
int |
getMaxTotalConnections()
Gets the maximum number of total connections.
|
boolean |
isCaching()
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.
|
public ILcdTransport createTransport()
createTransport
in interface ILcdTransportFactory
null
public boolean isCaching()
true
if caching is enabled, false
otherwisesetCaching(boolean)
,
getMaxCacheEntries()
public void setCaching(boolean aOn)
aOn
- when true
, transports created by this factory will cache HTTP requestsisCaching()
,
setMaxCacheEntries(int)
public int getMaxCacheEntries()
setMaxCacheEntries(int)
,
setCaching(boolean)
public void setMaxCacheEntries(int aMaxCacheEntries)
aMaxCacheEntries
- the maximum number of cache entries.getMaxCacheEntries()
,
setCaching(boolean)
public int getMaxConnectionsPerRoute()
2
. Negative values
mean that the implementation's default will be used.public void setMaxConnectionsPerRoute(int aMaxConnectionsPerRoute)
2
. Negative
values mean that the implementation's default will be used.aMaxConnectionsPerRoute
- the maximum number of connections per routepublic int getMaxTotalConnections()
20
. Negative values mean
that the implementation's default will be used.public void setMaxTotalConnections(int aMaxTotalConnections)
20
. Negative values mean
that the implementation's default will be used.aMaxTotalConnections
- the maximum number of total connectionspublic ILcdTransport createTransport(Object aConfiguration)
HttpClient
4.5.2, with a transport configuration of
type HttpClient
. The transport configuration should have been created by an
earlier call to createConfiguration()
.aConfiguration
- a transport configuration, which must be of type HttpClient
IllegalArgumentException
- if the transport configuration is incompatible with the
transports created by this factorypublic Object createConfiguration()
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.HttpClient
createTransport(Object)