Class TLfnEngineFactory

java.lang.Object
com.luciad.fusion.engine.TLfnEngineFactory
Direct Known Subclasses:
TLfnLFSEngineFactory

public class TLfnEngineFactory extends Object

A factory class for ALfnEngine instances which perform the fusion on the local system. Engines can be created using the createEngine(com.luciad.fusion.tilestore.ALfnTileStore, String) method.

The engines created by this factory will perform the fusion on the local system. The target tile store can be either local or remote. If you want to do the fusion on a remote system (the same system as the tile store, or another system), you should use the TLfnLFSEngineFactory class.

Example lifecycle:

Since:
10.0
  • Field Details

  • Constructor Details

    • TLfnEngineFactory

      public TLfnEngineFactory(ALfnEngineEnvironment aEngineEnvironment, ALfnTileStoreProvider aTileStoreProvider)
      Constructs an engine factory using a given engine environment and tile store provider. The tile store provider is used to create master tile stores from URIs.
      Parameters:
      aEngineEnvironment - the engine environment, which may be null to use the internal default
      aTileStoreProvider - a tile store provider, which may be null to use the internal default
      Since:
      2015.0
    • TLfnEngineFactory

      public TLfnEngineFactory(ALfnEngineEnvironment aEngineEnvironment)
      Constructs an engine factory using a given engine environment and the default tile store provider.
      Parameters:
      aEngineEnvironment - the engine environment, which may be null to use the internal default
    • TLfnEngineFactory

      public TLfnEngineFactory()
      Constructs an engine factory using the default engine environment and tile store provider. The default engine environment will be closed on finalization, and has the following properties:
      • It supports the default formats as described in ALfnFormat.createDefaultFormats(ALfnEngineEnvironment).
      • It uses all available CPU cores.
      • It supports file system master tile stores of the form file:///mnt/LuciadFusion/tile-store.xml or /mnt/LuciadFusion/tile-store.xml.
      • It supports remote master tile stores of the form http://hostname:8081/LuciadFusion/lts.
      Since:
      2014.0
  • Method Details

    • newRasterSessionBuilder

      @Deprecated public TLfnEngineFactory.RasterSessionBuilder newRasterSessionBuilder()
      Deprecated.
      Sessions are not necessary anymore to create engines. See migration details. (since 2013.0)
      Creates a session builder for fusing raster assets to a raster coverage.

      The following properties must be set before a session can be built:

      • Tile Store
      • Target coverage metadata
      • Source asset metadatas

      Returns:
      a raster session builder
      Since:
      11.0
    • newVectorSessionBuilder

      @Deprecated public TLfnEngineFactory.VectorSessionBuilder newVectorSessionBuilder()
      Deprecated.
      Sessions are not necessary anymore to create engines. See migration details. (since 2013.0)
      Creates a session builder for fusing vector assets to a vector coverage.

      For vector data it is important to provide a multi-leveling geometry and simplification policy. The policy should ensure that the data density decreases as the levels get less detailed. This should be done by leaving out features and by simplifying the geometry of features sufficiently at less detailed levels.

      The following properties must be set before a session can be built:

      • Tile Store
      • Target coverage metadata
      • Source asset metadatas

      It is also highly recommended to set a geometry provider specific for your use case and enable simplification.

      By default a fail-fast session handler is used, which will make the fusion abort on the first error.

      Returns:
      a vector session builder
      Since:
      11.0
    • getEngines

      public Collection<ALfnEngine> getEngines() throws IOException, TLfnServiceException
      Gets the open engines managed by this instance.
      Returns:
      The open engines
      Throws:
      IOException
      TLfnServiceException
      Since:
      2013.0
      See Also:
    • createEngine

      @Deprecated public ALfnEngine createEngine(ALfnTileStore aTileStore, ILfnEngineSession aSession) throws IOException, TLfnServiceException
      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
      When the target coverage or any of the source assets already exists in the Tile Store, the session parameters must match the existing ones. In case of an existing asset, the additional constraints are:
      • The properties of an asset must match those of the existing asset:
        • geo reference
        • data type
        • parts: location (URI), bounding box, pixel density/scale
      In case of an existing coverage, the additional constraints are:
      • 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.

      Parameters:
      aTileStore - the LuciadFusion Tile Store that will host the coverage
      aSession - the session information for the fusion
      Returns:
      a new fusion engine
      Throws:
      IOException - if a connection could not be made to the engine
      TLfnServiceException - if a failure happens on the remote engine
      IllegalArgumentException - in case the session is inconsistent in some way
      IllegalStateException - if an engine for the given coverage already exists
    • createEngine

      public ALfnEngine createEngine(ALfnTileStore aTileStore, String aCoverageID) throws IOException, TLfnServiceException
      Creates a fusion engine for a coverage.

      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) 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.

      Parameters:
      aTileStore - the LuciadFusion Tile Store that will host the coverage
      aCoverageID - the id of the resource to fuse. The resource must exist in the Tile Store, otherwise
      Returns:
      a new fusion engine
      Throws:
      IOException - if no connection could be made with the engine
      TLfnServiceException - if a failure happens on the remote engine
      IllegalArgumentException - in case the session is inconsistent in some way, or if no resource exists in the Tile Store for the given ID.
      IllegalStateException - if an engine for the given coverage already exists
    • removeEngine

      public boolean removeEngine(ALfnEngine aEngine) throws IOException, TLfnServiceException
      Removes an open engine.
      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 engine
      TLfnServiceException - if a failure happens on the remote engine
      Since:
      2013.0
      See Also: