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 Type
    Method
    Description
    <C extends UniqueEntity>
    void
    persist(C entity)
    Should implement the entry point of a data sink to persist an entity.
    <C extends UniqueEntity>
    void
    persistAll(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>
    void
    persistTimeSeries(TimeSeries<E,V> timeSeries)
    Should implement the handling of a whole time series.
    void
    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 the DataConnector) here
    • persist

      <C extends UniqueEntity> void persist(C entity)
      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 use Extractor 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 use InputDataSink.persistIgnoreNested(C)
      Type Parameters:
      C - bounded to be all unique entities. Handling of specific entities is normally then executed by a specific EntityProcessor
      Parameters:
      entity - the entity that should be persisted
    • persistAll

      <C extends UniqueEntity> void persistAll(Collection<C> entities)
      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 use Extractor 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 use InputDataSink.persistAllIgnoreNested(java.util.Collection<C>)
      Type Parameters:
      C - bounded to be all unique entities. Handling of specific entities is normally then executed by a specific EntityProcessor
      Parameters:
      entities - a collection of entities that should be persisted
    • persistTimeSeries

      <E extends TimeSeriesEntry<V>, V extends Value> void persistTimeSeries(TimeSeries<E,V> timeSeries)
      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 series
      V - Type of actual value, that is inside the entry
      Parameters:
      timeSeries - Time series to persist