Interface ICommandStreamStore
- All Superinterfaces:
IDataStore<CommandStreamKey,
,ICommandStreamInfo, ICommandStreamStore.CommandStreamInfoField, CommandStreamFilter> IResourceStore<CommandStreamKey,
,ICommandStreamInfo, ICommandStreamStore.CommandStreamInfoField, CommandStreamFilter> Map<CommandStreamKey,
ICommandStreamInfo>
- All Known Implementing Classes:
EmptyCommandStreamStore
public interface ICommandStreamStore
extends IResourceStore<CommandStreamKey,ICommandStreamInfo,ICommandStreamStore.CommandStreamInfoField,CommandStreamFilter>
Generic interface for managing command streams within a command store.
Removal operations also remove all commands associated to a command stream.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.sensorhub.api.datastore.resource.IResourceStore
IResourceStore.ResourceField
-
Method Summary
Modifier and TypeMethodDescriptionadd
(ICommandStreamInfo csInfo) Add a new command stream and generate a new unique key for it.
If the command stream valid time is not set, it will be set to the valid time of the parent system.default CommandStreamFilter.Builder
default ICommandStreamInfo
getLatestVersion
(String sysUID, String commandName) Helper method to retrieve the latest version of the command stream corresponding to the specified system and command input.default Map.Entry<CommandStreamKey,
ICommandStreamInfo> getLatestVersionEntry
(String sysUID, String controlInput) Helper method to retrieve the entry for the latest version of the command stream corresponding to the specified system and command input.default CommandStreamKey
getLatestVersionKey
(String sysUID, String commandName) Helper method to retrieve the internal ID of the latest version of the command stream corresponding to the specified system and command input.void
linkTo
(ISystemDescStore systemStore) Link this store to a system store to enable JOIN queriesdefault long
removeAllVersions
(String sysUID, String controlInput) Remove all command streams that are associated to the given system command inputMethods 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, remove, replace, replace, replaceAll
-
Method Details
-
filterBuilder
- Specified by:
filterBuilder
in interfaceIResourceStore<CommandStreamKey,
ICommandStreamInfo, ICommandStreamStore.CommandStreamInfoField, CommandStreamFilter> - Returns:
- A builder for a filter compatible with this datastore
-
add
Add a new command stream and generate a new unique key for it.
If the command stream valid time is not set, it will be set to the valid time of the parent system.- Specified by:
add
in interfaceIResourceStore<CommandStreamKey,
ICommandStreamInfo, ICommandStreamStore.CommandStreamInfoField, CommandStreamFilter> - Parameters:
csInfo
- The command stream info object to be stored- Returns:
- The key associated with the new command stream
- Throws:
DataStoreException
- if a command stream with the same parent system, taskable parameter 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 command stream corresponding to the specified system and command input.- Parameters:
sysUID
- Unique ID of system receiving the command streamcommandName
- Name of taskable parameter associated to the command stream- Returns:
- The command stream key or null if none was found
-
getLatestVersion
Helper method to retrieve the latest version of the command stream corresponding to the specified system and command input.- Parameters:
sysUID
- Unique ID of system receiving the command streamcommandName
- Name of taskable parameter associated to the command stream- Returns:
- The command stream info or null if none was found
-
getLatestVersionEntry
default Map.Entry<CommandStreamKey,ICommandStreamInfo> getLatestVersionEntry(String sysUID, String controlInput) Helper method to retrieve the entry for the latest version of the command stream corresponding to the specified system and command input.- Parameters:
sysUID
- Unique ID of system receiving the command streamcontrolInput
- Name of control input associated to the command stream- Returns:
- The feature entry or null if none was found with this UID
-
removeAllVersions
Remove all command streams that are associated to the given system command input- Parameters:
sysUID
- Unique ID of system receiving the command streamcontrolInput
- Name of control input associated to the command stream- Returns:
- The number of entries actually removed
-
linkTo
Link this store to a system store to enable JOIN queries- Parameters:
systemStore
-
-