Package net.solarnetwork.node.dao
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 Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintdeleteUploadedDataOlderThan(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.getDatumNotUploaded(String destination) Get a List of Datum instances that have not been uploaded yet to a specific destination.voidsetDatumUploaded(NodeDatum datum, Instant date, String destination, String trackingId) Mark a datum as uploaded.voidstoreDatum(NodeDatum datum) Store (create or update) a datum.
-
Field Details
-
EVENT_TOPIC_DATUM_STORED
AnEventtopic for when aNodeDatumhas 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_PROPERTYproperty shall be populated with the name of the core class name of the datum type.- Since:
- 1.2
- See Also:
-
-
Method Details
-
storeDatum
Store (create or update) a datum.- Parameters:
datum- the datum to persist
-
getDatumNotUploaded
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
Mark a datum as uploaded.- Parameters:
datum- the Datum that has been uploaded successfullydate- the date it was uploadeddestination- the destination the Datum was uploaded totrackingId- 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
-