Interface ILfnResourceConnector


public interface ILfnResourceConnector
A resource connector allows LuciadFusion Studio to find information about (data) resources.

LuciadFusion Studio by default includes a resource connector implementation that supports filesystem access. Non-filesystem resources, such as resources located on cloud storage, require a separate resource connector implementation. For example, for Amazon AWS S3 cloud storage, a resource connector is available which can be enabled by activating the fusion.aws Spring profile. A copy of this implementation is also available in sample code, named samples.fusion.platform.resource.aws.S3ResourceConnector. This copy can serve as an example for developers aiming to implement a custom resource connector.

Custom implementations can be contributed to the Studio application by annotating them as a Spring @Component. When adding a new resource connector, one must also make sure to provide an appropriate ILcdInputStreamFactory. This input stream factory must be able to create input streams for this new type of resources, and should be registered as a service using the LcdService annotation. Again for S3, an input stream factory is already available as a service, and a copy of that implementation can be found in sample code. See samples.common.io.aws.S3InputStreamFactory.

When your custom resource connector and input stream factory are implemented and exposed with their respective annotations, LuciadFusion Studio will be able to decode certain data formats from that storage technology. Specifically, the supported formats are those that are decoded by model decoders that access their data via InputStreams. The "Supported Data Formats" table specifies which formats we have tested successfully on Amazon S3.

Since:
2022.1
  • Method Details

    • get

      Attempts to decode a resource location from its String-encoded form. If this connector does not support the given location, it must return Optional.empty().
      Parameters:
      aLocation - an encoded resource location
      Returns:
      the decoded resource location, if supported
    • accepts

      boolean accepts(ILfnResourceLocation aResourceLocation)
      Tests whether this connector recognizes the given resource location. Typically, this is implemented using an instanceof check.
      Parameters:
      aResourceLocation - a resource location
      Returns:
      true if the resource location is recognized, false otherwise
    • getMetadata

      Optional<TLfnResourceMetadata> getMetadata(ILfnResourceLocation aResourceLocation)
      Retrieves metadata for the given resource location. If this connector cannot provide the metadata at this time, it must return Optional.empty().
      Parameters:
      aResourceLocation - a resource location
      Returns:
      the metadata for the resource, if available
      Throws:
      IllegalArgumentException - if the resource location is not accepted
    • isAvailable

      boolean isAvailable(ILfnResourceLocation aResourceLocation)
      Checks whether the given resource location can be accessed.
      Parameters:
      aResourceLocation - a resource location
      Returns:
      true if the location is accessible, false otherwise
      Throws:
      IllegalArgumentException - if the resource location is not accepted