Class TLfnLFSEngineFactory
A factory class for ALfnEngine
instances which perform the fusion on a remote system accessible through the LFS protocol.
Engines can be created using the createEngine(com.luciad.fusion.tilestore.ALfnTileStore, String)
method.
The target Tile Store should be a remote one, accessible through the LTS protocol.
You should reuse the same instance for the same server as much as possible to reduce polling calls to the server.
- Since:
- 2013.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.luciad.fusion.engine.TLfnEngineFactory
TLfnEngineFactory.RasterSessionBuilder, TLfnEngineFactory.TileCombiningStrategy, TLfnEngineFactory.VectorSessionBuilder
-
Field Summary
Fields inherited from class com.luciad.fusion.engine.TLfnEngineFactory
ALL_LEVELS
-
Constructor Summary
ConstructorsConstructorDescriptionTLfnLFSEngineFactory
(URI aUri, ALfnEngineEnvironment aEnvironment, ALfnTileStoreProvider aTileStoreProvider, ILcdTransport aTransport) Creates a new engine factory that proxies for the given URI. -
Method Summary
Modifier and TypeMethodDescriptioncreateEngine
(ALfnTileStore aTileStore, ILfnEngineSession aSession) This method is not supported for remote LFS engines.createEngine
(ALfnTileStore aTileStore, String aCoverageID) Creates a remote engine for a given coverage ID targeting a given Tile Store.Gets the LFS capabilities of the remote fusion server.Gets the open engines managed by this instance.getUri()
Returns the URI this engine factory is for.boolean
removeEngine
(ALfnEngine aEngine) Removes an open engine.Methods inherited from class com.luciad.fusion.engine.TLfnEngineFactory
newRasterSessionBuilder, newVectorSessionBuilder
-
Constructor Details
-
TLfnLFSEngineFactory
public TLfnLFSEngineFactory(URI aUri, ALfnEngineEnvironment aEnvironment, ALfnTileStoreProvider aTileStoreProvider, ILcdTransport aTransport) throws IOException, TLfnServiceException Creates a new engine factory that proxies for the given URI.This constructor already tries to contact the server.
- Parameters:
aUri
- a URI to connect to. Typically this URI has the"http"
scheme, for example"http://localhost:8080/LuciadFusion/lfs"
.aEnvironment
- an engine environment, providing the shared resources for the new instanceaTileStoreProvider
- a Tile Store provider, necessary to obtain Tile Stores associated with remoteengines
.aTransport
- a transport to be used. You can create and share a transport usingTLfnClientFactory
.- Throws:
IOException
- when there was a problem connecting to the URITLfnServiceException
- when there was a problem connecting to the URIIllegalArgumentException
- when one of the arguments is invalid, for example with the URI has no scheme
-
-
Method Details
-
getUri
Returns the URI this engine factory is for.- Returns:
- The URI
-
getCapabilities
Gets the LFS capabilities of the remote fusion server. The capabilities describe the operations offered by the remote fusion server ("FuseCoverage"
, ...), and how they can be accessed ("GET"
,"POST"
). The structure of the capabilities is exactly the same as for the LTS capabilities, which is why theTLfnLTSCapabilities
class is reused.- Returns:
- the capabilities
- Throws:
IOException
- on I/O failureTLfnServiceException
- on service processing failure
-
createEngine
public ALfnEngine createEngine(ALfnTileStore aTileStore, ILfnEngineSession aSession) throws IOException, TLfnServiceException This method is not supported for remote LFS engines.
It will throw
UnsupportedOperationException
. UsecreateEngine(com.luciad.fusion.tilestore.ALfnTileStore, String)
instead.Creates a fusion engine for a coverage.
Creation of an engine will validate the session parameters against a number of constraints, throwing an
IllegalArgumentException
upon violation. The constraints are:- The parameters must not be
null
- The pixel density or scale of assets must be defined
- The source assets must be compatible with the data type of the target coverage
- The tile data codec and tile combiner must be compatible with the tile format
- The level-0 row count and column count must be (strictly) greater then 0
- The properties of an asset must match those of the existing asset:
- geo reference
- data type
- parts: location (URI), bounding box, pixel density/scale
- The properties of a coverage must match those of the existing coverage:
- geo reference
- level-0 row count and column count
- data type
- format
- bounding box
- The existing ordered list of assets must exactly match the head of the session's list of assets, with matching order and fusion status.
The session may have additional assets at the tail of the list which are not in the existing list.
There are 2 cases to be distinguished here:
- There are no additional assets at the tail of the session's list, it matches the existing list exactly. This corresponds to the use case of "resuming an ongoing fusion"
- There are additional assets at the tail of the session's list.
This corresponds to the use case of "adding additional assets on top of an existing coverage". There is an extra constraint in this case:
the existing list must not contain any assets with status
"INCOMPLETE"
. In other words, it is not allowed to add additional assets to an existing coverage as long as that coverage has not yet been fully fused
Note that the source asset metadata does not need to have a matching update sequence, name or abstract. Similarly, the target coverage metadata does not need to have a matching update sequence, name, abstract, or asset infos.
This method is responsible for defining the asset infos, when comparing the session's ordered list of assets with the list of the existing coverage. Any asset infos on the target coverage metadata are ignored and overwritten by this method. In other words, the application never needs to bother with asset infos.
The engine will fuse the assets described in the session, to a coverage in a (remote) LuciadFusion Tile Store.
The fusion engine requires Java 1.6 for optimal performance.
You can only create an engine for the given coverage once. If an engine already exists, you will get an error.
- Overrides:
createEngine
in classTLfnEngineFactory
- Parameters:
aTileStore
- the LuciadFusion Tile Store that will host the coverageaSession
- the session information for the fusion- Returns:
- a new fusion engine
- Throws:
IOException
- if a connection could not be made to the engineTLfnServiceException
- if a failure happens on the remote engine
- The parameters must not be
-
createEngine
public ALfnEngine createEngine(ALfnTileStore aTileStore, String aCoverageID) throws IOException, TLfnServiceException Creates a remote engine for a given coverage ID targeting a given Tile Store. The Tile Store should be a remote one.
The target coverage and all of the source assets must exists in the Tile Store.
Creation of an engine will validate a number of constraints, throwing an
IllegalArgumentException
upon violation. The constraints are:- The parameters must not be
null
- The pixel density or scale of assets must be defined
- The source assets must be compatible with the data type of the target coverage
- The level-0 row count and column count must be (strictly) greater then 0
The engine will fuse the assets linked in the coverage, to a coverage in a remote Tile Store.
The fusion engine requires Java 1.6 for optimal performance.
You can only create an engine for the given coverage once. If an engine already exists, you will get an error.
- Overrides:
createEngine
in classTLfnEngineFactory
- Parameters:
aTileStore
- the LuciadFusion Tile Store that will host the coverageaCoverageID
- the id of the coverage to fuse, must exist in the Tile Store- Returns:
- a new fusion engine
- Throws:
IOException
- if a connection could not be made to the engineTLfnServiceException
- if a failure happens on the remote engineIllegalArgumentException
- in case the session is inconsistent in some wayIllegalStateException
- if an engine for the given coverage already exists
- The parameters must not be
-
removeEngine
Description copied from class:TLfnEngineFactory
Removes an open engine.- Overrides:
removeEngine
in classTLfnEngineFactory
- Parameters:
aEngine
- An engine, managed by this instance.- Returns:
true
if the engine existed, false otherwise.- Throws:
IOException
- if a connection could not be made to the engineTLfnServiceException
- if a failure happens on the remote engine- See Also:
-
getEngines
Description copied from class:TLfnEngineFactory
Gets the open engines managed by this instance.- Overrides:
getEngines
in classTLfnEngineFactory
- Returns:
- The open engines
- Throws:
IOException
TLfnServiceException
- See Also:
-