java.lang.Object
com.inductiveautomation.ignition.gateway.sqltags.providers.AbstractTagStore
All Implemented Interfaces:
TagConfigProvider, TagStore

public abstract class AbstractTagStore extends Object implements TagStore
  • Field Details

  • Constructor Details

  • Method Details

    • getLogger

      public LoggerEx getLogger()
    • isErrored

      public boolean isErrored()
      Description copied from interface: TagStore
      Returns whether or not the tag provider is running without error.
      Specified by:
      isErrored in interface TagStore
    • updateStatMetrics

      public void updateStatMetrics(Map<String,NamedValue<StatMetric>> statMetrics)
      Description copied from interface: TagStore
      Allows tag stores to update StatMetrics for the provider status display. The key of the named value describes the metric.
      Specified by:
      updateStatMetrics in interface TagStore
    • getLastError

      public Exception getLastError()
      Description copied from interface: TagStore
      If isErrored() is TRUE, this should return the error that is causing that state.
      Specified by:
      getLastError in interface TagStore
    • getManagerName

      public String getManagerName()
    • getGatewayContext

      protected GatewayContext getGatewayContext()
    • addConfigurationListener

      public void addConfigurationListener(TagStoreListener listener)
      Description copied from interface: TagStore
      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.
      Specified by:
      addConfigurationListener in interface TagStore
    • removeConfigurationListener

      public void removeConfigurationListener(TagStoreListener listener)
      Specified by:
      removeConfigurationListener in interface TagStore
    • setErrored

      protected void setErrored(boolean isErrored, Exception lastError)
    • getDBId

      protected Long getDBId(EntityId id)
      Returns the long value contained in the entityid. Handles override ids as well.
    • updateUdtEidCache

      protected void updateUdtEidCache(EntityId owner, String memberUid, EntityId memberId)
      The UDT EID cache is a structure containing EID mappings for UDT member items. This function updates the specified member under the given owner.
    • updateUDTsForLoadedTags

      protected void updateUDTsForLoadedTags(List<TagStoreObject<TagConfig>> loaded)
    • registerUDTs

      protected void registerUDTs(Map<EntityId,Map<String,EntityId>> udtMap)
      Registers new UDTs with the udt/eid cache, which maps from EntityId (for UDT) to map of Path/EntityId for member path to EID.
    • removeFromUidEidCache

      protected List<EntityId> removeFromUidEidCache(Collection<EntityId> tagIds)
      Goes through the tag ids, and removes them from the UDT/EID cache. Returns the full list of all member EIDs, in addition to the complex tag's id.
    • getIdForMemberPath

      protected EntityId getIdForMemberPath(EntityId parent, String memberUid)
    • getIdsForMemberPaths

      protected List<EntityId> getIdsForMemberPaths(EntityId parent, Collection<String> uids)
      Returns a 1-to-1 list of ids for the passed in paths. A id will be null if the member doesn't exist.
    • notifyItemsAdded

      protected void notifyItemsAdded(Collection<TagStoreObject<TagConfig>> tags, Collection<TagStoreObject<ScanClass>> scanClasses)
    • notifyItemsRemoved

      protected void notifyItemsRemoved(Collection<EntityId> tagIds, Collection<EntityId> scIds)
    • notifyPropertiesChanged

      protected void notifyPropertiesChanged(Collection<TagPropertyValue> properties)
    • getDeepTagCount

      protected int getDeepTagCount(List<? extends Tag> tags)
      Takes a set of tags and returns how many tags are contained below them. Includes folders and top level tags.
    • flattenTags

      protected List<GeneralTagConfig<Tag,String>> flattenTags(TagPath parent, List<? extends Tag> tags)
    • deleteTags

      public void deleteTags(Collection<EntityId> tagIds) throws Exception
      Description copied from interface: TagStore
      Deletes the given tags from the store. Will result in the itemsRemoved notification.
      Specified by:
      deleteTags in interface TagStore
      Throws:
      Exception
    • internalDeleteTag

      protected abstract void internalDeleteTag(List<EntityId> tags, TaskProgressUpdater updater) throws Exception
      Throws:
      Exception
    • executeScalar

      protected Object executeScalar(PreparedStatement stmt) throws SQLException
      Throws:
      SQLException
    • buildPropertyValue

      protected PropertyValue buildPropertyValue(String propId, Object value, int bindType, DataTypeClass fallbackType)
    • getTypeForValueProp

      protected DataType getTypeForValueProp(PropertySet propSet)
      Gets the data type for the value property stored in the provided property set