Persistence
The Persistence interface is responsible for storing the AAS model.
Each Persistence configuration supports at least the following configuration properties:
Name |
Allowed Value |
Description |
Default Value |
---|---|---|---|
initialModel |
String |
An |
|
initialModelFile |
String |
Path to a model file to load initially. |
In-Memory
The In-Memory Persistence keeps the AAS model in the local memory. This means, that once FA³ST Service is stopped or crashes, all changes made during runtime are lost.
Important
If you use In-Memory Persistence from code by setting the initialModel
property, the passed instance of Environment
will be modified directly (as always the case in Java with pass-by-reference).
If you do not want the original instance to be modified by FA³ST Serivce, call DeepCopyHelper.deepCopy(...)
with the Environment
to create a copy before passing it to FA³ST.
Configuration
In-Memory Persistence has no additional configuration properties.
1{
2 "persistence" : {
3 "@class" : "de.fraunhofer.iosb.ilt.faaast.service.persistence.memory.PersistenceInMemory",
4 "initialModel" : "{pathTo}/FAAAST-Service/misc/examples/model.json"
5 },
6 //...
7}
File-based
The File-based Persistence stores the AAS model in a file according to the AAS specification. Therefore, changes are stored permanently even when FA³ST Service is stopped or crashes.
Important
Each modification of the model results in writing the whole model to the file which might become a performance issue for larger models.
Configuration
Name |
Allowed Value |
Description |
Default Value |
---|---|---|---|
dataDir |
String |
Path where the model file created by the persistence should be saved. |
. |
dataformat |
AASX |
Data format to use when storing. |
same as |
keepInitial |
Boolean |
If true, |
true |
1{
2 "persistence" : {
3 "@class" : "de.fraunhofer.iosb.ilt.faaast.service.persistence.file.PersistenceFile",
4 "initialModelFile" : "{pathTo}/FAAAST-Service/misc/examples/model.json",
5 "dataDir": ".",
6 "keepInitial": true,
7 "dataformat": "XML"
8 },
9 //...
10}