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 -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractPersistenceRecipe(de.iip_ecosphere.platform.support.FileFormat... formats) Creates a persistence recipe instance with given file formats. -
Method Summary
Modifier and TypeMethodDescriptionprotected org.eclipse.digitaltwin.aas4j.v3.model.EnvironmentbuildEnvironment(List<de.iip_ecosphere.platform.support.aas.Aas> aas) Creates an AAS environment for writing.Collection<de.iip_ecosphere.platform.support.FileFormat> protected voidtransform(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 relatedaasandsubmodelsto a list ofAasinstances 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 ofAasinstances of the abstraction.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.support.aas.PersistenceRecipe
readFrom, writeTo, writeTo
-
Field Details
-
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
- Specified by:
getSupportedFormatsin interfacede.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 ofAasinstances of the abstraction.- Parameters:
env- the environmentrelatedFiles- the optional related files, may be null- Returns:
- the resulting
Aasinstances (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 relatedaasandsubmodelsto a list ofAasinstances of the abstraction.- Parameters:
aas- the AAS to transformsubmodels- the sub-models to transform/link toaasresult- the resultingAasinstances (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
-