public class TLfnClientFactory extends Object
Modifier and Type | Field and Description |
---|---|
static String |
TRANSPORT_TYPE_DEFAULT
Default transport type, based upon Apache HttpClient 4.5.2.
|
Constructor and Description |
---|
TLfnClientFactory(ALfnClientEnvironment aClientEnvironment)
Creates a client factory based on a client environment.
|
Modifier and Type | Method and Description |
---|---|
TLfnLTSClient |
createLTSClient(URI aUri)
Creates a client for a Luciad Tile Service, with the default transport.
|
TLfnLTSClient |
createLTSClient(URI aUri,
ILcdTransport aTransport)
Creates a client for a Luciad Tile Service, with a specific transport.
|
TLfnLTSClient |
createLTSClient(URI aUri,
ILcdTransport aTransport,
boolean aOwnsTransport)
Creates a client for a Luciad Tile Service, with a specific transport.
|
TLfnTileStoreModelDecoder |
createModelDecoder()
Creates a model decoder for Tile Stores.
|
ILcdTransport |
createTransport()
Creates a default transport to be used by a client.
|
ILcdTransport |
createTransport(String aTransportType,
Object aParameter)
Creates a transport to be used by a client.
|
Object |
createTransportConfiguration(String aTransportType)
Creates a valid configuration parameter that can be used to create the
corresponding transport.
|
ILcdTransportFactory |
getTransportFactory()
Returns the transport factory that will construct the
ILcdTransport used for
communicating with Luciad tile server. |
void |
setTransportFactory(ILcdTransportFactory aTransportFactory)
Sets the transport factory that will construct the
ILcdTransport used for
communicating with Luciad tile server. |
public static final String TRANSPORT_TYPE_DEFAULT
public TLfnClientFactory(ALfnClientEnvironment aClientEnvironment)
aClientEnvironment
- client environmentpublic TLfnLTSClient createLTSClient(URI aUri, ILcdTransport aTransport) throws IOException, TLfnServiceException
The client implements the Luciad Tile Service (LTS) protocol, for communicating with a remote LuciadFusion TileStore.
The LuciadFusion protocol is HTTP based:aUri
- the URI of the LuciadFusion serviceaTransport
- the transport to use for communicating with the LuciadFusion serviceIOException
- when client cannot connect to the LuciadFusion serviceTLfnServiceException
- when the LuciadFusion service failed to connect to the clientIllegalArgumentException
- when the URI is not validpublic TLfnLTSClient createLTSClient(URI aUri, ILcdTransport aTransport, boolean aOwnsTransport) throws IOException, TLfnServiceException
The client implements the Luciad Tile Service (LTS) protocol, for communicating with a remote LuciadFusion TileStore.
The LuciadFusion protocol is HTTP based:
When the given transport is owned by the client, and if it is ILcdDisposable
, it will be
closed when the Tile Store corresponding to the client is closed.
aUri
- the URI of the LuciadFusion serviceaTransport
- the transport to use for communicating with the LuciadFusion serviceaOwnsTransport
- When true
, and if the given transport also implements ILcdDisposable
,
it will be disposed when the Tile Store corresponding to the client is closed.
If you want to share a transport across multiple LTS clients, you should pass false
here and you're responsible for disposing the transport yourself.IOException
- when client cannot connect to the LuciadFusion serviceTLfnServiceException
- when the LuciadFusion service failed to connect to the clientIllegalArgumentException
- when the URI is not validpublic TLfnLTSClient createLTSClient(URI aUri) throws IOException, TLfnServiceException
The client implements the Luciad Tile Service (LTS) protocol, for communicating with a remote LuciadFusion TileStore.
The LuciadFusion protocol is HTTP based:aUri
- the URI of the LuciadFusion serviceIOException
- when client cannot connect to the LuciadFusion serviceTLfnServiceException
- when the LuciadFusion service failed to connect to the clientIllegalArgumentException
- when the URI is not validcreateLTSClient(URI, com.luciad.io.transport.ILcdTransport)
,
createTransport()
public TLfnTileStoreModelDecoder createModelDecoder()
public ILcdTransport createTransport()
The transport supports the HTTP and HTTPS protocols. Request performed on the transport with other protocols will result in an IOException.
The transport returned by this method implements ILcdDisposable
.
When combined with the 'owns transport' flag of createLTSClient(java.net.URI, com.luciad.io.transport.ILcdTransport, boolean)
,
it will be disposed when the corresponding Tile Store is closed.
public ILcdTransport createTransport(String aTransportType, Object aParameter)
The currently supported transport is based upon Apache HttpClient 4.1.1.
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.
The transport returned by this method implements ILcdDisposable
.
When combined with the 'owns transport' flag of createLTSClient(java.net.URI, com.luciad.io.transport.ILcdTransport, boolean)
,
it will be disposed when the corresponding Tile Store is closed.
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)
Object
can then be casted 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
aTransportType
- The type of transport for which a configuration parameter needs to
be created.createTransport(String, Object)
public void setTransportFactory(ILcdTransportFactory aTransportFactory)
ILcdTransport
used for
communicating with Luciad tile server.
The default transport factory creates ILcdTransport
s based on the Apache HttpClient
library. This factory uses the proxy configuration from
the system-wide proxy selector
The transports created by the factory should implement ILcdDisposable
if they hold any
resources (ex. network connections).
This setter does not affect already decoded models.aTransportFactory
- the transport factory, must not be null
public ILcdTransportFactory getTransportFactory()
ILcdTransport
used for
communicating with Luciad tile server.setTransportFactory(com.luciad.io.transport.ILcdTransportFactory)