Interface DatumDao

All Known Implementing Classes:
FilteringDatumDao, QueueDatumDao

public interface DatumDao
Data Access Object (DAO) API for NodeDatum objects.
Version:
2.0
Author:
matt
  • Field Details

    • EVENT_TOPIC_DATUM_STORED

      static final String EVENT_TOPIC_DATUM_STORED
      An Event topic for when a NodeDatum has been persisted.

      The properties of the event shall be any of the JavaBean properties of the Datum supported by events (i.e. any simple Java property such as numbers and strings). In addition, the Datum.DATUM_TYPE_PROPERTY property shall be populated with the name of the core class name of the datum type.

      Since:
      1.2
      See Also:
  • Method Details

    • storeDatum

      void storeDatum(NodeDatum datum)
      Store (create or update) a datum.
      Parameters:
      datum - the datum to persist
    • getDatumNotUploaded

      List<NodeDatum> getDatumNotUploaded(String destination)
      Get a List of Datum instances that have not been uploaded yet to a specific destination.

      This does not need to return all data, it can limit the amount returned at one time to conserve memory. This method can be called repeatedly if needed.

      Parameters:
      destination - the destination to check
      Returns:
      list of Datum, or empty List if none available
    • setDatumUploaded

      void setDatumUploaded(NodeDatum datum, Instant date, String destination, String trackingId)
      Mark a datum as uploaded.
      Parameters:
      datum - the Datum that has been uploaded successfully
      date - the date it was uploaded
      destination - the destination the Datum was uploaded to
      trackingId - the remote tracking ID assigned to the uploaded Datum
    • deleteUploadedDataOlderThan

      int deleteUploadedDataOlderThan(int hours)
      Delete both Datum and DatumUpload objects that have been successfully uploaded to at least one destination and are older than the specified number of hours.

      This is designed to free up space from local database storage for devices with limited storage capacity. It will not delete any Datum objects that have not been successfully uploaded anywhere.

      Parameters:
      hours - the minimum number of hours old the data must be to delete
      Returns:
      the number of Datum (and associated DatumUpload) entities deleted