Package org.sensorhub.api.datastore.obs
Interface IDataStreamStore
- All Superinterfaces:
IDataStore<DataStreamKey,
,IDataStreamInfo, IDataStreamStore.DataStreamInfoField, DataStreamFilter> IResourceStore<DataStreamKey,
,IDataStreamInfo, IDataStreamStore.DataStreamInfoField, DataStreamFilter> Map<DataStreamKey,
IDataStreamInfo>
- All Known Implementing Classes:
EmptyDataStreamStore
public interface IDataStreamStore
extends IResourceStore<DataStreamKey,IDataStreamInfo,IDataStreamStore.DataStreamInfoField,DataStreamFilter>
Generic interface for managing data streams within an observation store.
Removal operations also remove all observations associated to a data stream.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.sensorhub.api.datastore.resource.IResourceStore
IResourceStore.ResourceField
-
Method Summary
Modifier and TypeMethodDescriptionadd
(IDataStreamInfo dsInfo) Add a new data stream and generate a new unique key for it.
If the datastream valid time is not set, it will be set to the valid time of the parent system.default DataStreamFilter.Builder
default IDataStreamInfo
getLatestVersion
(String sysUID, String outputName) Helper method to retrieve the latest version of the data stream corresponding to the specified system and output.default Map.Entry<DataStreamKey,
IDataStreamInfo> getLatestVersionEntry
(String sysUID, String outputName) Helper method to retrieve the entry for the latest version of the data stream corresponding to the specified system and output.default DataStreamKey
getLatestVersionKey
(String sysUID, String outputName) Helper method to retrieve the internal ID of the latest version of the data stream corresponding to the specified system and output.void
linkTo
(ISystemDescStore systemStore) Link this store to a system store to enable JOIN queriesRemove the datastream mapped to the given key and all observations associated to it.default long
removeAllVersions
(String sysUID, String outputName) Remove all datastreams that are associated to the given system outputMethods inherited from interface org.sensorhub.api.datastore.IDataStore
backup, commit, containsKey, containsValue, countMatchingEntries, entrySet, getDatastoreName, getNumRecords, isEmpty, isReadOnly, keySet, putAll, removeEntries, restore, select, select, select, selectEntries, selectEntries, selectEntries, selectKeys, size, values
Methods inherited from interface org.sensorhub.api.datastore.resource.IResourceStore
selectAllFilter
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, equals, forEach, get, getOrDefault, hashCode, merge, put, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
filterBuilder
- Specified by:
filterBuilder
in interfaceIResourceStore<DataStreamKey,
IDataStreamInfo, IDataStreamStore.DataStreamInfoField, DataStreamFilter> - Returns:
- A builder for a filter compatible with this datastore
-
add
Add a new data stream and generate a new unique key for it.
If the datastream valid time is not set, it will be set to the valid time of the parent system.- Specified by:
add
in interfaceIResourceStore<DataStreamKey,
IDataStreamInfo, IDataStreamStore.DataStreamInfoField, DataStreamFilter> - Parameters:
dsInfo
- The data stream info object to be stored- Returns:
- The key associated with the new data stream
- Throws:
DataStoreException
- if a datastream with the same parent system, output name and valid time already exists, or if the parent system is unknown.
-
getLatestVersionKey
Helper method to retrieve the internal ID of the latest version of the data stream corresponding to the specified system and output.- Parameters:
sysUID
- Unique ID of system producing the data streamoutputName
- Name of output generating the data stream- Returns:
- The datastream key or null if none was found
-
getLatestVersion
Helper method to retrieve the latest version of the data stream corresponding to the specified system and output.- Parameters:
sysUID
- Unique ID of system producing the data streamoutputName
- Name of output generating the data stream- Returns:
- The datastream info or null if none was found
-
getLatestVersionEntry
default Map.Entry<DataStreamKey,IDataStreamInfo> getLatestVersionEntry(String sysUID, String outputName) Helper method to retrieve the entry for the latest version of the data stream corresponding to the specified system and output.- Parameters:
sysUID
- Unique ID of system producing the data streamoutputName
- Name of output generating the data stream- Returns:
- The datastream entry or null if none was found
-
removeAllVersions
Remove all datastreams that are associated to the given system output- Parameters:
sysUID
-outputName
-- Returns:
- The number of entries actually removed
-
linkTo
Link this store to a system store to enable JOIN queries- Parameters:
systemStore
-
-
remove
Remove the datastream mapped to the given key and all observations associated to it.- Specified by:
remove
in interfaceMap<DataStreamKey,
IDataStreamInfo>
-