Interface TagStore
- All Superinterfaces:
TagConfigProvider
- All Known Implementing Classes:
AbstractTagStore
A tag store is where configured tags are saved. Could be to the internal database, could be to an external one, could
be to something else.
All tag modification actions pass through here first- then come back up through the tag modification events.
Every item in the tag store is identified by an EntityId, and opaque identifier unique to the store. It is provided when items are loaded, and is used to reference the items later when performing modifications.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigurationListener
(TagStoreListener listener) The configuration listener will be notified any time items are added or removed.void
addScanClasses
(Collection<ScanClass> scanclasses) Same as with tags, but for scanclasses.void
Saves the specified tag definitions to the store.void
deleteScanClasses
(Collection<EntityId> scanClasses) void
deleteTags
(Collection<EntityId> tagIds) Deletes the given tags from the store.If isErrored() is TRUE, this should return the error that is causing that state.boolean
Returns whether or not the tag provider is running without error.void
modifyScanClass
(EntityId scid, ScanClass definition) void
modifyTagPaths
(List<EntityId> ids, List<TagPath> paths) Writes new tag paths to the store.void
modifyTags
(TagDiff diff, Collection<EntityId> tagIds) Applies the tagdiff to the given tags.void
reloadTags
(Set<EntityId> ids) void
removeConfigurationListener
(TagStoreListener listener) void
shutdown()
Shuts down the tag store, finalizing any writes and preventing further operations.void
startup()
Initializes the tag store, loading all tags/scs.void
storeTagValues
(Collection<TagPropertyValue> tagValues) Writes the given values to the store.void
updateStatMetrics
(Map<String, NamedValue<StatMetric>> statMetrics) Allows tag stores to update StatMetrics for the provider status display.Methods inherited from interface com.inductiveautomation.ignition.gateway.sqltags.model.tagstore.TagConfigProvider
getDefinition, getDefinitions, getProperty
-
Method Details
-
addConfigurationListener
The configuration listener will be notified any time items are added or removed. When first added, it will be called immediately with the current set of objects, unless startup has not been called. In that case, it will likely be called at startup. -
removeConfigurationListener
-
startup
Initializes the tag store, loading all tags/scs. Some tagstores might also start polling timers, etc.- Throws:
Exception
-
shutdown
void shutdown()Shuts down the tag store, finalizing any writes and preventing further operations. -
addTags
Saves the specified tag definitions to the store. Should result in the listeners being notified about the addition/removal of tags. Will result in itemsAdded notification.- Throws:
Exception
-
modifyTags
Applies the tagdiff to the given tags. Will result in itemsModified/itemsRemoved notification (removed if tag path changed)- Throws:
Exception
-
deleteTags
Deletes the given tags from the store. Will result in the itemsRemoved notification.- Throws:
Exception
-
modifyTagPaths
Writes new tag paths to the store. The entity ids must map 1-to-1 with the new tag paths. The new paths should be the full path of the tag, including the tag name. It will change the tag name as well, but won't check for collisions.- Throws:
Exception
-
addScanClasses
Same as with tags, but for scanclasses.- Throws:
Exception
-
modifyScanClass
- Throws:
Exception
-
deleteScanClasses
-
storeTagValues
Writes the given values to the store. The "value" is not necessarily the "tag value"- it can be the value of any property of the tag. The tag store may not store all of the properties- it will only store what it believes is necessary. -
reloadTags
-
isErrored
boolean isErrored()Returns whether or not the tag provider is running without error. -
getLastError
Exception getLastError()If isErrored() is TRUE, this should return the error that is causing that state. -
updateStatMetrics
Allows tag stores to update StatMetrics for the provider status display. The key of the named value describes the metric.
-