Package org.shredzone.geordi.service
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 Summary
Modifier and Type Method Description Sample
lastUnchanged(Sample sample)
Regenerates the last unchangedSample
before the value has changed.void
rememberSample(Sample sample)
Remember aSample
value.boolean
wasUnchanged(Sample sample)
Checks if the givenSample
can be compacted.
-
Method Details
-
wasUnchanged
Checks if the givenSample
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 unchangedSample
before the value has changed. This way, interpolations can start from the timestamp of the last unchanged value, instead of the first unchanged value. -
rememberSample
Remember aSample
value.- Parameters:
sample
-Sample
to remember
-