All Superinterfaces:
TagConfigProvider
All Known Implementing Classes:
AbstractTagStore

public interface TagStore extends TagConfigProvider
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 Details

    • addConfigurationListener

      void addConfigurationListener(TagStoreListener listener)
      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

      void removeConfigurationListener(TagStoreListener listener)
    • startup

      void startup() throws Exception
      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

      void addTags(TagPath parentFolder, List<? extends Tag> tag) throws Exception
      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

      void modifyTags(TagDiff diff, Collection<EntityId> tagIds) throws Exception
      Applies the tagdiff to the given tags. Will result in itemsModified/itemsRemoved notification (removed if tag path changed)
      Throws:
      Exception
    • deleteTags

      void deleteTags(Collection<EntityId> tagIds) throws Exception
      Deletes the given tags from the store. Will result in the itemsRemoved notification.
      Throws:
      Exception
    • modifyTagPaths

      void modifyTagPaths(List<EntityId> ids, List<TagPath> paths) throws Exception
      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

      void addScanClasses(Collection<ScanClass> scanclasses) throws Exception
      Same as with tags, but for scanclasses.
      Throws:
      Exception
    • modifyScanClass

      void modifyScanClass(EntityId scid, ScanClass definition) throws Exception
      Throws:
      Exception
    • deleteScanClasses

      void deleteScanClasses(Collection<EntityId> scanClasses)
    • storeTagValues

      void storeTagValues(Collection<TagPropertyValue> tagValues)
      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

      void reloadTags(Set<EntityId> ids)
    • 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

      void updateStatMetrics(Map<String,NamedValue<StatMetric>> statMetrics)
      Allows tag stores to update StatMetrics for the provider status display. The key of the named value describes the metric.