Class FileSystemDataStorage<R extends FactoryBase<?,R>,S>
- java.lang.Object
-
- io.github.factoryfx.factory.storage.filesystem.FileSystemDataStorage<R,S>
-
- All Implemented Interfaces:
DataStorage<R,S>
public class FileSystemDataStorage<R extends FactoryBase<?,R>,S> extends java.lang.Object implements DataStorage<R,S>
-
-
Constructor Summary
Constructors Constructor Description FileSystemDataStorage(java.nio.file.Path basePath, R initialData, MigrationManager<R,S> migrationManager, SimpleObjectMapper objectMapper)FileSystemDataStorage(java.nio.file.Path basePath, R initialData, MigrationManager<R,S> migrationManager, SimpleObjectMapper objectMapper, int maxConfigurationHistory)FileSystemDataStorage(java.nio.file.Path basePath, R initialData, MigrationManager<R,S> migrationManager, FileSystemFactoryStorageHistory<R,S> fileSystemFactoryStorageHistory, SimpleObjectMapper objectMapper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddFutureData(ScheduledUpdate<R> futureFactory)voiddeleteFutureData(java.lang.String id)DataAndId<R>getCurrentData()get the current data, if first start or no available an initial data is createdRgetFutureData(java.lang.String id)java.util.Collection<ScheduledUpdateMetadata>getFutureDataList()RgetHistoryData(java.lang.String id)java.util.Collection<StoredDataMetadata<S>>getHistoryDataList()voidpatchAll(DataStoragePatcher consumer)for one-time migration apply patch to all stored data including history, changes to jsonNodes are storedvoidpatchCurrentData(DataStoragePatcher consumer)for one-time migration apply patch to current datavoidupdateCurrentData(DataUpdate<R> update, S changeSummary)updateCurrentData and history
-
-
-
Constructor Detail
-
FileSystemDataStorage
public FileSystemDataStorage(java.nio.file.Path basePath, R initialData, MigrationManager<R,S> migrationManager, FileSystemFactoryStorageHistory<R,S> fileSystemFactoryStorageHistory, SimpleObjectMapper objectMapper)
-
FileSystemDataStorage
public FileSystemDataStorage(java.nio.file.Path basePath, R initialData, MigrationManager<R,S> migrationManager, SimpleObjectMapper objectMapper)
-
FileSystemDataStorage
public FileSystemDataStorage(java.nio.file.Path basePath, R initialData, MigrationManager<R,S> migrationManager, SimpleObjectMapper objectMapper, int maxConfigurationHistory)
-
-
Method Detail
-
getHistoryData
public R getHistoryData(java.lang.String id)
- Specified by:
getHistoryDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>
-
getHistoryDataList
public java.util.Collection<StoredDataMetadata<S>> getHistoryDataList()
- Specified by:
getHistoryDataListin interfaceDataStorage<R extends FactoryBase<?,R>,S>
-
getFutureDataList
public java.util.Collection<ScheduledUpdateMetadata> getFutureDataList()
- Specified by:
getFutureDataListin interfaceDataStorage<R extends FactoryBase<?,R>,S>
-
deleteFutureData
public void deleteFutureData(java.lang.String id)
- Specified by:
deleteFutureDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>
-
getFutureData
public R getFutureData(java.lang.String id)
- Specified by:
getFutureDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>
-
addFutureData
public void addFutureData(ScheduledUpdate<R> futureFactory)
- Specified by:
addFutureDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>- Parameters:
futureFactory- futureData
-
getCurrentData
public DataAndId<R> getCurrentData()
Description copied from interface:DataStorageget the current data, if first start or no available an initial data is created- Specified by:
getCurrentDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>- Returns:
- current data
-
updateCurrentData
public void updateCurrentData(DataUpdate<R> update, S changeSummary)
Description copied from interface:DataStorageupdateCurrentData and history- Specified by:
updateCurrentDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>- Parameters:
update- updatechangeSummary- changeSummary
-
patchAll
public void patchAll(DataStoragePatcher consumer)
Description copied from interface:DataStoragefor one-time migration apply patch to all stored data including history, changes to jsonNodes are stored- Specified by:
patchAllin interfaceDataStorage<R extends FactoryBase<?,R>,S>- Parameters:
consumer- called for all stored factories
-
patchCurrentData
public void patchCurrentData(DataStoragePatcher consumer)
Description copied from interface:DataStoragefor one-time migration apply patch to current data- Specified by:
patchCurrentDatain interfaceDataStorage<R extends FactoryBase<?,R>,S>- Parameters:
consumer- called for current factory, changes to jsonNodes are stored
-
-