Class TLfnLFSEngineFactory

java.lang.Object
com.luciad.fusion.engine.TLfnEngineFactory
com.luciad.fusion.engine.TLfnLFSEngineFactory

public class TLfnLFSEngineFactory extends TLfnEngineFactory

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:
  • 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 instance
      aTileStoreProvider - a Tile Store provider, necessary to obtain Tile Stores associated with remote engines.
      aTransport - a transport to be used. You can create and share a transport using TLfnClientFactory.
      Throws:
      IOException - when there was a problem connecting to the URI
      TLfnServiceException - when there was a problem connecting to the URI
      IllegalArgumentException - when one of the arguments is invalid, for example with the URI has no scheme
  • Method Details

    • getUri

      public URI getUri()
      Returns the URI this engine factory is for.
      Returns:
      The URI
    • getCapabilities

      public TLfnLTSCapabilities getCapabilities() throws IOException, TLfnServiceException
      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 the TLfnLTSCapabilities class is reused.
      Returns:
      the capabilities
      Throws:
      IOException - on I/O failure
      TLfnServiceException - 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. Use createEngine(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
      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.

      Overrides:
      createEngine in class TLfnEngineFactory
      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
    • 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 class TLfnEngineFactory
      Parameters:
      aTileStore - the LuciadFusion Tile Store that will host the coverage
      aCoverageID - 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 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
    • removeEngine

      public boolean removeEngine(ALfnEngine aEngine) throws IOException, TLfnServiceException
      Description copied from class: TLfnEngineFactory
      Removes an open engine.
      Overrides:
      removeEngine in class TLfnEngineFactory
      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
      See Also:
    • getEngines

      public Collection<ALfnEngine> getEngines() throws IOException, TLfnServiceException
      Description copied from class: TLfnEngineFactory
      Gets the open engines managed by this instance.
      Overrides:
      getEngines in class TLfnEngineFactory
      Returns:
      The open engines
      Throws:
      IOException
      TLfnServiceException
      See Also: