Class AbstractPersistenceRecipe

java.lang.Object
de.iip_ecosphere.platform.support.aas.basyx2.AbstractPersistenceRecipe
All Implemented Interfaces:
de.iip_ecosphere.platform.support.aas.PersistenceRecipe
Direct Known Subclasses:
AasxPersistenceRecipe, JsonPersistenceRecipe, XmlPersistenceRecipe

public abstract class AbstractPersistenceRecipe extends Object implements de.iip_ecosphere.platform.support.aas.PersistenceRecipe
Basic supporting functions for persistency.
Author:
Holger Eichelberger, SSE
  • Nested Class Summary

    Nested classes/interfaces inherited from interface de.iip_ecosphere.platform.support.aas.PersistenceRecipe

    de.iip_ecosphere.platform.support.aas.PersistenceRecipe.FileResource
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private List<de.iip_ecosphere.platform.support.FileFormat>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AbstractPersistenceRecipe(de.iip_ecosphere.platform.support.FileFormat... formats)
    Creates a persistence recipe instance with given file formats.
  • Method Summary

    Modifier and Type
    Method
    Description
    protected org.eclipse.digitaltwin.aas4j.v3.model.Environment
    buildEnvironment(List<de.iip_ecosphere.platform.support.aas.Aas> aas)
    Creates an AAS environment for writing.
    Collection<de.iip_ecosphere.platform.support.FileFormat>
     
    protected void
    transform(List<? extends org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell> aas, List<? extends org.eclipse.digitaltwin.aas4j.v3.model.Submodel> submodels, List<de.iip_ecosphere.platform.support.aas.Aas> result)
    Transforms a list of related aas and submodels to a list of Aas instances of the abstraction.
    protected List<de.iip_ecosphere.platform.support.aas.Aas>
    transform(org.eclipse.digitaltwin.aas4j.v3.model.Environment env, List<org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile> relatedFiles)
    Transforms an environment and related files to a list of Aas instances of the abstraction.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface de.iip_ecosphere.platform.support.aas.PersistenceRecipe

    readFrom, writeTo, writeTo
  • Field Details

    • formats

      private List<de.iip_ecosphere.platform.support.FileFormat> formats
  • Constructor Details

    • AbstractPersistenceRecipe

      protected AbstractPersistenceRecipe(de.iip_ecosphere.platform.support.FileFormat... formats)
      Creates a persistence recipe instance with given file formats.
      Parameters:
      formats - the supported formats
  • Method Details

    • getSupportedFormats

      public Collection<de.iip_ecosphere.platform.support.FileFormat> getSupportedFormats()
      Specified by:
      getSupportedFormats in interface de.iip_ecosphere.platform.support.aas.PersistenceRecipe
    • transform

      protected List<de.iip_ecosphere.platform.support.aas.Aas> transform(org.eclipse.digitaltwin.aas4j.v3.model.Environment env, List<org.eclipse.digitaltwin.aas4j.v3.dataformat.aasx.InMemoryFile> relatedFiles) throws IOException
      Transforms an environment and related files to a list of Aas instances of the abstraction.
      Parameters:
      env - the environment
      relatedFiles - the optional related files, may be null
      Returns:
      the resulting Aas instances (to be modified as a side effect)
      Throws:
      IOException - in case that something goes wrong
    • transform

      protected void transform(List<? extends org.eclipse.digitaltwin.aas4j.v3.model.AssetAdministrationShell> aas, List<? extends org.eclipse.digitaltwin.aas4j.v3.model.Submodel> submodels, List<de.iip_ecosphere.platform.support.aas.Aas> result) throws IOException
      Transforms a list of related aas and submodels to a list of Aas instances of the abstraction.
      Parameters:
      aas - the AAS to transform
      submodels - the sub-models to transform/link to aas
      result - the resulting Aas instances (to be modified as a side effect)
      Throws:
      IOException - in case that something goes wrong
    • buildEnvironment

      protected org.eclipse.digitaltwin.aas4j.v3.model.Environment buildEnvironment(List<de.iip_ecosphere.platform.support.aas.Aas> aas)
      Creates an AAS environment for writing.
      Parameters:
      aas - the AAS to write
      Returns:
      the environment