Package edu.ie3.datamodel.io.sink
Interface DataSink
- All Known Subinterfaces:
InputDataSink
,OutputDataSink
- All Known Implementing Classes:
CsvFileSink
,InfluxDbSink
public interface DataSink
Describes a class that manages data persistence. A sample implementation that can be used as a
blueprint for all method implementation incl. entity handling with processors can be found in
CsvFileSink
-
Method Summary
Modifier and TypeMethodDescription<C extends UniqueEntity>
voidpersist
(C entity) Should implement the entry point of a data sink to persist an entity.<C extends UniqueEntity>
voidpersistAll
(Collection<C> entities) Should implement the entry point of a data sink to persist multiple entities in a collection.<E extends TimeSeriesEntry<V>,
V extends Value>
voidpersistTimeSeries
(TimeSeries<E, V> timeSeries) Should implement the handling of a whole time series.void
shutdown()
Shutdown this sink and do all cleanup operations (e.g.
-
Method Details
-
shutdown
void shutdown()Shutdown this sink and do all cleanup operations (e.g. closing of theDataConnector
) here -
persist
Should implement the entry point of a data sink to persist an entity. By default this method should take care about the extraction process of nested entities (if any) of input entities and useExtractor
accordingly. For an faster method e.g. that neglects the nested objects persistence and only persists the uuid of the nested objects (if any), instead of the object itself useInputDataSink.persistIgnoreNested(C)
- Type Parameters:
C
- bounded to be all unique entities. Handling of specific entities is normally then executed by a specificEntityProcessor
- Parameters:
entity
- the entity that should be persisted
-
persistAll
Should implement the entry point of a data sink to persist multiple entities in a collection. By default this method should take care about the extraction process of nested entities (if any) of input entities and useExtractor
accordingly. For a faster method that neglects the nested objects persistence and only persists the uuid of the nested * objects (if any), instead of the object itself useInputDataSink.persistAllIgnoreNested(java.util.Collection<C>)
- Type Parameters:
C
- bounded to be all unique entities. Handling of specific entities is normally then executed by a specificEntityProcessor
- Parameters:
entities
- a collection of entities that should be persisted
-
persistTimeSeries
Should implement the handling of a whole time series. Therefore the single entries have to be extracted and persisted accordingly.- Type Parameters:
E
- Type of entry in the time seriesV
- Type of actual value, that is inside the entry- Parameters:
timeSeries
- Time series to persist
-