@NonNullByDefault public interface ModifiablePersistenceService extends QueryablePersistenceServiceThis class provides an interface to the a
PersistenceServiceto allow data to be stored at a specific time. This allows bindings that interface to devices that store data internally, and then periodically provide it to the server to be accommodated.
- Chris Jackson - Initial contribution
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
remove(FilterCriteria filter)Removes data associated with an item from a persistence service.
store(Item item, Date date, State state)Stores the historic item value.
Methods inherited from interface org.openhab.core.persistence.PersistenceService
getDefaultStrategies, getId, getLabel, store, store
Stores the historic item value. This allows the item, time and value to be specified.
Adding data with the same time as an existing record should update the current record value rather than adding a new record.
Implementors should keep in mind that all registered
PersistenceServices are called synchronously. Hence long running operations should be processed asynchronously. E.g.
storeadds things to a queue which is processed by some asynchronous workers (Quartz Job, Thread, etc.).
item- the data to be stored
date- the date of the record
state- the state to be recorded
boolean remove(FilterCriteria filter) throws IllegalArgumentExceptionRemoves data associated with an item from a persistence service. If all data is removed for the specified item, the persistence service should free any resources associated with the item (eg. remove any tables or delete files from the storage).
filter- the filter to apply to the data removal. ItemName can not be null.
- true if the query executed successfully