Interface ModifiablePersistenceService

All Superinterfaces:
PersistenceService, QueryablePersistenceService

@NonNullByDefault public interface ModifiablePersistenceService extends QueryablePersistenceService
This class provides an interface to the a 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 Details

    • store

      void store(Item item, ZonedDateTime date, State state)

      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. store adds things to a queue which is processed by some asynchronous workers (Quartz Job, Thread, etc.).

      Parameters:
      item - the data to be stored
      date - the date of the record
      state - the state to be recorded
    • store

      void store(Item item, ZonedDateTime date, State state, @Nullable String alias)

      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 PersistenceServices 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 stored
      date - the date of the record
      state - the state to be recorded
    • remove

      boolean remove(FilterCriteria filter) throws IllegalArgumentException
      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.