public interface ILfnResourceConnector
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
InputStream
s. The "Supported Data
Formats" table on our developer platform specifies which formats we have tested successfully on Amazon S3.
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(ILfnResourceLocation aResourceLocation)
Tests whether this connector recognizes the given resource location.
|
Optional<ILfnResourceLocation> |
get(String aLocation)
Attempts to decode a resource location from its
String -encoded form. |
Optional<TLfnResourceMetadata> |
getMetadata(ILfnResourceLocation aResourceLocation)
Retrieves metadata for the given resource location.
|
boolean |
isAvailable(ILfnResourceLocation aResourceLocation)
Checks whether the given resource location can be accessed.
|
Optional<ILfnResourceLocation> get(String aLocation)
String
-encoded form.
If this connector does not support the given location, it must return Optional.empty()
.aLocation
- an encoded resource locationboolean accepts(ILfnResourceLocation aResourceLocation)
instanceof
check.aResourceLocation
- a resource locationtrue
if the resource location is recognized, false
otherwiseOptional<TLfnResourceMetadata> getMetadata(ILfnResourceLocation aResourceLocation)
Optional.empty()
.aResourceLocation
- a resource locationIllegalArgumentException
- if the resource location is not accepted
boolean isAvailable(ILfnResourceLocation aResourceLocation)
aResourceLocation
- a resource locationtrue
if the location is accessible, false
otherwiseIllegalArgumentException
- if the resource location is not accepted