Class AbstractTagStore
java.lang.Object
com.inductiveautomation.ignition.gateway.sqltags.providers.AbstractTagStore
- All Implemented Interfaces:
TagConfigProvider
,TagStore
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
AbstractTagStore
(String managerName, GatewayContext context) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigurationListener
(TagStoreListener listener) The configuration listener will be notified any time items are added or removed.protected PropertyValue
buildPropertyValue
(String propId, Object value, int bindType, DataTypeClass fallbackType) void
deleteTags
(Collection<EntityId> tagIds) Deletes the given tags from the store.protected Object
protected List<GeneralTagConfig<Tag,
String>> flattenTags
(TagPath parent, List<? extends Tag> tags) protected Long
Returns the long value contained in the entityid.protected int
getDeepTagCount
(List<? extends Tag> tags) Takes a set of tags and returns how many tags are contained below them.protected GatewayContext
protected EntityId
getIdForMemberPath
(EntityId parent, String memberUid) getIdsForMemberPaths
(EntityId parent, Collection<String> uids) Returns a 1-to-1 list of ids for the passed in paths.If isErrored() is TRUE, this should return the error that is causing that state.protected DataType
getTypeForValueProp
(PropertySet propSet) Gets the data type for the value property stored in the provided property setprotected abstract void
internalDeleteTag
(List<EntityId> tags, TaskProgressUpdater updater) boolean
Returns whether or not the tag provider is running without error.protected void
notifyItemsAdded
(Collection<TagStoreObject<TagConfig>> tags, Collection<TagStoreObject<ScanClass>> scanClasses) protected void
notifyItemsRemoved
(Collection<EntityId> tagIds, Collection<EntityId> scIds) protected void
notifyPropertiesChanged
(Collection<TagPropertyValue> properties) protected void
Registers new UDTs with the udt/eid cache, which maps from EntityId (for UDT) to map of Path/EntityId for member path to EID.void
removeConfigurationListener
(TagStoreListener listener) removeFromUidEidCache
(Collection<EntityId> tagIds) Goes through the tag ids, and removes them from the UDT/EID cache.protected void
setErrored
(boolean isErrored, Exception lastError) void
updateStatMetrics
(Map<String, NamedValue<StatMetric>> statMetrics) Allows tag stores to update StatMetrics for the provider status display.protected void
updateUdtEidCache
(EntityId owner, String memberUid, EntityId memberId) The UDT EID cache is a structure containing EID mappings for UDT member items.protected void
updateUDTsForLoadedTags
(List<TagStoreObject<TagConfig>> loaded) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.inductiveautomation.ignition.gateway.sqltags.model.tagstore.TagConfigProvider
getDefinition, getDefinitions, getProperty
Methods inherited from interface com.inductiveautomation.ignition.gateway.sqltags.model.tagstore.TagStore
addScanClasses, addTags, deleteScanClasses, modifyScanClass, modifyTagPaths, modifyTags, reloadTags, shutdown, startup, storeTagValues
-
Field Details
-
log
-
-
Constructor Details
-
AbstractTagStore
-
-
Method Details
-
getLogger
-
isErrored
public boolean isErrored()Description copied from interface:TagStore
Returns whether or not the tag provider is running without error. -
updateStatMetrics
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 interfaceTagStore
-
getLastError
Description copied from interface:TagStore
If isErrored() is TRUE, this should return the error that is causing that state.- Specified by:
getLastError
in interfaceTagStore
-
getManagerName
-
getGatewayContext
-
addConfigurationListener
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 interfaceTagStore
-
removeConfigurationListener
- Specified by:
removeConfigurationListener
in interfaceTagStore
-
setErrored
-
getDBId
Returns the long value contained in the entityid. Handles override ids as well. -
updateUdtEidCache
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
-
registerUDTs
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
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
-
getIdsForMemberPaths
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
-
notifyPropertiesChanged
-
getDeepTagCount
Takes a set of tags and returns how many tags are contained below them. Includes folders and top level tags. -
flattenTags
-
deleteTags
Description copied from interface:TagStore
Deletes the given tags from the store. Will result in the itemsRemoved notification.- Specified by:
deleteTags
in interfaceTagStore
- Throws:
Exception
-
internalDeleteTag
protected abstract void internalDeleteTag(List<EntityId> tags, TaskProgressUpdater updater) throws Exception - Throws:
Exception
-
executeScalar
- Throws:
SQLException
-
buildPropertyValue
protected PropertyValue buildPropertyValue(String propId, Object value, int bindType, DataTypeClass fallbackType) -
getTypeForValueProp
Gets the data type for the value property stored in the provided property set
-