Interface ModifiablePersistenceService
- All Superinterfaces:
PersistenceService
,QueryablePersistenceService
PersistenceService
to 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.- Author:
- Chris Jackson - Initial contribution
-
Method Summary
Modifier and TypeMethodDescriptionboolean
remove
(FilterCriteria filter) Removes data associated with an item from a persistence service.void
store
(Item item, ZonedDateTime date, State state) Stores the historic item value.void
store
(Item item, ZonedDateTime date, State state, @Nullable String alias) Stores the historic item value under a specified alias.Methods inherited from interface org.openhab.core.persistence.PersistenceService
getDefaultStrategies, getId, getLabel, store, store
Methods inherited from interface org.openhab.core.persistence.QueryablePersistenceService
getItemInfo, query
-
Method Details
-
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
PersistenceService
s are called synchronously. Hence long running operations should be processed asynchronously. E.g.store
adds things to a queue which is processed by some asynchronous workers (Quartz Job, Thread, etc.).- Parameters:
item
- the data to be storeddate
- the date of the recordstate
- the state to be recorded
-
store
Stores the historic item value under a specified alias. 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
PersistenceService
s are called synchronously. Hence long running operations should be processed asynchronously. E.g.store
adds things to a queue which is processed by some asynchronous workers (Quartz Job, Thread, etc.).- Parameters:
item
- the data to be storeddate
- the date of the recordstate
- the state to be recorded
-
remove
Removes 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 (e.g. remove any tables or delete files from the storage).- Parameters:
filter
- the filter to apply to the data removal. ItemName can not be null.- Returns:
- true if the query executed successfully
- Throws:
IllegalArgumentException
- if item name is null.
-