Interface TagStore

  • All Superinterfaces:
    TagConfigProvider
    All Known Implementing Classes:
    AbstractTagStore, DBTagStore

    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 Detail

      • 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 java.lang.Exception
        Initializes the tag store, loading all tags/scs. Some tagstores might also start polling timers, etc.
        Throws:
        java.lang.Exception
      • shutdown

        void shutdown()
        Shuts down the tag store, finalizing any writes and preventing further operations.
      • addTags

        void addTags​(TagPath parentFolder,
                     java.util.List<? extends Tag> tag)
              throws java.lang.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:
        java.lang.Exception
      • modifyTags

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

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

        void modifyTagPaths​(java.util.List<EntityId> ids,
                            java.util.List<TagPath> paths)
                     throws java.lang.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:
        java.lang.Exception
      • addScanClasses

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

        void modifyScanClass​(EntityId scid,
                             ScanClass definition)
                      throws java.lang.Exception
        Throws:
        java.lang.Exception
      • deleteScanClasses

        void deleteScanClasses​(java.util.Collection<EntityId> scanClasses)
      • storeTagValues

        void storeTagValues​(java.util.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​(java.util.Set<EntityId> ids)
      • isErrored

        boolean isErrored()
        Returns whether or not the tag provider is running without error.
      • getLastError

        java.lang.Exception getLastError()
        If isErrored() is TRUE, this should return the error that is causing that state.
      • updateStatMetrics

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