Class TLfnClientFactory
- Since:
- 10.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Default transport type, based upon Apache HttpClient 4.5.2. -
Constructor Summary
ConstructorDescriptionTLfnClientFactory
(ALfnClientEnvironment aClientEnvironment) Creates a client factory based on a client environment. -
Method Summary
Modifier and TypeMethodDescriptioncreateLTSClient
(URI aUri) Creates a client for a Luciad Tile Service, with the default transport.createLTSClient
(URI aUri, ILcdTransport aTransport) Creates a client for a Luciad Tile Service, with a specific transport.createLTSClient
(URI aUri, ILcdTransport aTransport, boolean aOwnsTransport) Creates a client for a Luciad Tile Service, with a specific transport.Creates a model decoder for Tile Stores.Creates a default transport to be used by a client.createTransport
(String aTransportType, Object aParameter) Creates a transport to be used by a client.createTransportConfiguration
(String aTransportType) Creates a valid configuration parameter that can be used to create the corresponding transport.Returns the transport factory that will construct theILcdTransport
used for communicating with Luciad tile server.void
setTransportFactory
(ILcdTransportFactory aTransportFactory) Sets the transport factory that will construct theILcdTransport
used for communicating with Luciad tile server.
-
Field Details
-
TRANSPORT_TYPE_DEFAULT
Default transport type, based upon Apache HttpClient 4.5.2.- See Also:
-
-
Constructor Details
-
TLfnClientFactory
Creates a client factory based on a client environment.- Parameters:
aClientEnvironment
- client environment
-
-
Method Details
-
createLTSClient
public TLfnLTSClient createLTSClient(URI aUri, ILcdTransport aTransport) throws IOException, TLfnServiceException Creates a client for a Luciad Tile Service, with a specific transport.The client implements the Luciad Tile Service (LTS) protocol, for communicating with a remote LuciadFusion TileStore.
The LuciadFusion protocol is HTTP based:- Read-only requests that do not change the server state use the HTTP GET method, with the request parameters encoded in the URL. In case the URL becomes too long, a HTTP POST may be used, with the request encoded in the request body using form-URL-encoding (KVP).
- Requests that change the server state must use the HTTP POST method, with the data encoded in the request body using XML, form-URL-encoding (KVP) or a custom binary protocol.
- Parameters:
aUri
- the URI of the LuciadFusion serviceaTransport
- the transport to use for communicating with the LuciadFusion service- Returns:
- the client
- Throws:
IOException
- when client cannot connect to the LuciadFusion serviceTLfnServiceException
- when the LuciadFusion service failed to connect to the clientIllegalArgumentException
- when the URI is not valid
-
createLTSClient
public TLfnLTSClient createLTSClient(URI aUri, ILcdTransport aTransport, boolean aOwnsTransport) throws IOException, TLfnServiceException Creates a client for a Luciad Tile Service, with a specific transport.The client implements the Luciad Tile Service (LTS) protocol, for communicating with a remote LuciadFusion TileStore.
The LuciadFusion protocol is HTTP based:- Read-only requests that do not change the server state use the HTTP GET method, with the request parameters encoded in the URL. In case the URL becomes too long, a HTTP POST may be used, with the request encoded in the request body using form-URL-encoding (KVP).
- Requests that change the server state must use the HTTP POST method, with the data encoded in the request body using XML, form-URL-encoding (KVP) or a custom binary protocol.
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.- Parameters:
aUri
- the URI of the LuciadFusion serviceaTransport
- the transport to use for communicating with the LuciadFusion serviceaOwnsTransport
- Whentrue
, and if the given transport also implementsILcdDisposable
, 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 passfalse
here and you're responsible for disposing the transport yourself.- Returns:
- the client
- Throws:
IOException
- when client cannot connect to the LuciadFusion serviceTLfnServiceException
- when the LuciadFusion service failed to connect to the clientIllegalArgumentException
- when the URI is not valid
-
createLTSClient
Creates a client for a Luciad Tile Service, with the default transport.The client implements the Luciad Tile Service (LTS) protocol, for communicating with a remote LuciadFusion TileStore.
The LuciadFusion protocol is HTTP based:- Read-only requests that do not change the server state use the HTTP GET method, with the request parameters encoded in the URL. In case the URL becomes too long, a HTTP POST may be used, with the request encoded in the request body using XML or form-URL-encoding (KVP).
- Requests that change the server state must use the HTTP POST method, with the data encoded in the request body using XML, form-URL-encoding (KVP) or a custom binary protocol.
- Parameters:
aUri
- the URI of the LuciadFusion service- Returns:
- the client
- Throws:
IOException
- when client cannot connect to the LuciadFusion serviceTLfnServiceException
- when the LuciadFusion service failed to connect to the clientIllegalArgumentException
- when the URI is not valid- See Also:
-
createModelDecoder
Creates a model decoder for Tile Stores.- Returns:
- a model decoder
-
createTransport
Creates a default transport to be used by a client.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 ofcreateLTSClient(java.net.URI, com.luciad.io.transport.ILcdTransport, boolean)
, it will be disposed when the corresponding Tile Store is closed.- Returns:
- a transport.
-
createTransport
Creates 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.1.1. 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.
The transport returned by this method implements
ILcdDisposable
. When combined with the 'owns transport' flag ofcreateLTSClient(java.net.URI, com.luciad.io.transport.ILcdTransport, boolean)
, it will be disposed when the corresponding Tile Store is closed.- 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
Creates 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 casted 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
- Parameters:
aTransportType
- The type of transport for which a configuration parameter needs to be created.- Returns:
- A valid transport configuration.
- See Also:
-
-
setTransportFactory
Sets the transport factory that will construct theILcdTransport
used for communicating with Luciad tile server. The default transport factory createsILcdTransport
s based on the Apache HttpClient library. This factory uses the proxy configuration fromthe system-wide proxy selector
The transports created by the factory should implementILcdDisposable
if they hold any resources (ex. network connections). This setter does not affect already decoded models.- Parameters:
aTransportFactory
- the transport factory, must not benull
- Since:
- 2017.0
-
getTransportFactory
Returns the transport factory that will construct theILcdTransport
used for communicating with Luciad tile server.- Returns:
- the transport.
- Since:
- 2017.0
- See Also:
-