Persistence

The Persistence interface is responsible for storing the AAS model.

Each Persistence configuration supports at least the following configuration properties:

Common configuration properties of for all Persistence implementations.

Name

Allowed Value

Description

Default Value

initialModel
(optional)

String

An Environment object containing the model to load initially.
This can only be set when used via code, not via configuration file.
This has precedence over initialModelFile when both are set.

initialModelFile
(optional)

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.

Example configuration for In-Memory Persistence.
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

Configuration properties of File-based Persistence.

Name

Allowed Value

Description

Default Value

dataDir
(optional)

String

Path where the model file created by the persistence should be saved.

.

dataformat
(optional)

AASX
JSON
XML

Data format to use when storing.
Ignored when keepInitial is set to true.

same as initialModelFile

keepInitial
(optional)

Boolean

If true, initialModelFile will not be modified but instead a copy will be created in dataDir where the changes will be saved.
If false, all changes will be written directly to the initialModelFile.

true

Example configuration for File-based Persistence.
 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}