Interface ProtocolAssetImport

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface ProtocolAssetImport
To be used by protocols that support device import from a protocol specific file. These devices can be represented as Assets with Attributes that contain the necessary MetaItems to establish a link to the linked Agent. These Assets can then be structured in a hierarchical representation using AssetTreeNodes.

Protocols that support Asset import must implement this interface.

It is the caller's responsibility to ensure that only a single import occurs at a given time.

  • Method Summary

    Modifier and Type
    Method
    Description
    startAssetImport(byte[] fileData, Consumer<AssetTreeNode[]> assetConsumer)
    Start the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will become Future.isDone().
  • Method Details

    • startAssetImport

      Future<Void> startAssetImport(byte[] fileData, Consumer<AssetTreeNode[]> assetConsumer)
      Start the process asynchronously; the implementation can make as many calls as it desires to the assetConsumer with the found assets; when the implementation has finished then the returned future will become Future.isDone(). The callee can also cancel the future at any time. If for some reason the process cannot be started or encounters an error then this method should log more details before completing the future.