Interface CompactingService

All Known Implementing Classes:
CompactingServiceImpl

public interface CompactingService
This service remembers the last sample value stored in database. It helps that sensor values are not stored in database if the sensor is in compact mode and the value has not been changed since the last time it was stored in database.
  • Method Details

    • wasUnchanged

      boolean wasUnchanged​(Sample sample)
      Checks if the given Sample can be compacted.
      Parameters:
      sample - Sample to check
      Returns:
      true if the corresponding sensor is in compact mode, and the sample's value is equal to the previously stored sensor value.
    • lastUnchanged

      Regenerates the last unchanged Sample before the value has changed. This way, interpolations can start from the timestamp of the last unchanged value, instead of the first unchanged value.
      Parameters:
      sample - Sample to regenerate the last unchanged sample for
      Returns:
      Regenerated Sample, or null if there was no last sample that could be generated
    • rememberSample

      void rememberSample​(Sample sample)
      Remember a Sample value.
      Parameters:
      sample - Sample to remember