public abstract class AbstractTagStore extends java.lang.Object implements TagStore
Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractTagStore.LegacyAlertInfo |
Modifier | Constructor and Description |
---|---|
protected |
AbstractTagStore(java.lang.String managerName,
GatewayContext context) |
Modifier and Type | Method and Description |
---|---|
void |
addConfigurationListener(TagStoreListener listener)
The configuration listener will be notified any time items are added or removed.
|
protected PropertyValue |
buildPropertyValue(java.lang.String propId,
java.lang.Object value,
int bindType,
DataTypeClass fallbackType) |
void |
deleteTags(java.util.Collection<EntityId> tagIds)
Deletes the given tags from the store.
|
protected java.lang.Object |
executeScalar(java.sql.PreparedStatement stmt) |
protected java.util.List<GeneralTagConfig<Tag,java.lang.String>> |
flattenTags(TagPath parent,
java.util.List<? extends Tag> tags) |
protected java.lang.Long |
getDBId(EntityId id)
Returns the long value contained in the entityid.
|
protected int |
getDeepTagCount(java.util.List<? extends Tag> tags)
Takes a set of tags and returns how many tags are contained below them.
|
protected GatewayContext |
getGatewayContext() |
protected EntityId |
getIdForMemberPath(EntityId parent,
java.lang.String memberUid) |
protected java.util.List<EntityId> |
getIdsForMemberPaths(EntityId parent,
java.util.Collection<java.lang.String> uids)
Returns a 1-to-1 list of ids for the passed in paths.
|
java.lang.Exception |
getLastError()
If isErrored() is TRUE, this should return the error that is causing that state.
|
LoggerEx |
getLogger() |
java.lang.String |
getManagerName() |
protected DataType |
getTypeForValueProp(PropertySet propSet)
Gets the data type for the value property stored in the provided property set
|
protected abstract void |
internalDeleteTag(java.util.List<EntityId> tags,
TaskProgressUpdater updater) |
boolean |
isErrored()
Returns whether or not the tag provider is running without error.
|
protected void |
notifyItemsAdded(java.util.Collection<TagStoreObject<TagConfig>> tags,
java.util.Collection<TagStoreObject<ScanClass>> scanClasses) |
protected void |
notifyItemsRemoved(java.util.Collection<EntityId> tagIds,
java.util.Collection<EntityId> scIds) |
protected void |
notifyPropertiesChanged(java.util.Collection<TagPropertyValue> properties) |
protected void |
registerUDTs(java.util.Map<EntityId,java.util.Map<java.lang.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.
|
void |
removeConfigurationListener(TagStoreListener listener) |
protected java.util.List<EntityId> |
removeFromUidEidCache(java.util.Collection<EntityId> tagIds)
Goes through the tag ids, and removes them from the UDT/EID cache.
|
protected void |
setErrored(boolean isErrored,
java.lang.Exception lastError) |
void |
updateStatMetrics(java.util.Map<java.lang.String,NamedValue<StatMetric>> statMetrics)
Allows tag stores to update StatMetrics for the provider status display.
|
protected void |
updateUdtEidCache(EntityId owner,
java.lang.String memberUid,
EntityId memberId)
The UDT EID cache is a structure containing EID mappings for UDT member items.
|
protected void |
updateUDTsForLoadedTags(java.util.List<TagStoreObject<TagConfig>> loaded) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addScanClasses, addTags, deleteScanClasses, modifyScanClass, modifyTagPaths, modifyTags, reloadTags, shutdown, startup, storeTagValues
getDefinition, getDefinitions, getProperty
protected LoggerEx log
protected AbstractTagStore(java.lang.String managerName, GatewayContext context)
public LoggerEx getLogger()
public boolean isErrored()
TagStore
public void updateStatMetrics(java.util.Map<java.lang.String,NamedValue<StatMetric>> statMetrics)
TagStore
updateStatMetrics
in interface TagStore
public java.lang.Exception getLastError()
TagStore
getLastError
in interface TagStore
public java.lang.String getManagerName()
protected GatewayContext getGatewayContext()
public void addConfigurationListener(TagStoreListener listener)
TagStore
addConfigurationListener
in interface TagStore
public void removeConfigurationListener(TagStoreListener listener)
removeConfigurationListener
in interface TagStore
protected void setErrored(boolean isErrored, java.lang.Exception lastError)
protected java.lang.Long getDBId(EntityId id)
protected void updateUdtEidCache(EntityId owner, java.lang.String memberUid, EntityId memberId)
protected void updateUDTsForLoadedTags(java.util.List<TagStoreObject<TagConfig>> loaded)
protected void registerUDTs(java.util.Map<EntityId,java.util.Map<java.lang.String,EntityId>> udtMap)
protected java.util.List<EntityId> removeFromUidEidCache(java.util.Collection<EntityId> tagIds)
protected EntityId getIdForMemberPath(EntityId parent, java.lang.String memberUid)
protected java.util.List<EntityId> getIdsForMemberPaths(EntityId parent, java.util.Collection<java.lang.String> uids)
protected void notifyItemsAdded(java.util.Collection<TagStoreObject<TagConfig>> tags, java.util.Collection<TagStoreObject<ScanClass>> scanClasses)
protected void notifyItemsRemoved(java.util.Collection<EntityId> tagIds, java.util.Collection<EntityId> scIds)
protected void notifyPropertiesChanged(java.util.Collection<TagPropertyValue> properties)
protected int getDeepTagCount(java.util.List<? extends Tag> tags)
protected java.util.List<GeneralTagConfig<Tag,java.lang.String>> flattenTags(TagPath parent, java.util.List<? extends Tag> tags)
public void deleteTags(java.util.Collection<EntityId> tagIds) throws java.lang.Exception
TagStore
deleteTags
in interface TagStore
java.lang.Exception
protected abstract void internalDeleteTag(java.util.List<EntityId> tags, TaskProgressUpdater updater) throws java.lang.Exception
java.lang.Exception
protected java.lang.Object executeScalar(java.sql.PreparedStatement stmt) throws java.sql.SQLException
java.sql.SQLException
protected PropertyValue buildPropertyValue(java.lang.String propId, java.lang.Object value, int bindType, DataTypeClass fallbackType)
protected DataType getTypeForValueProp(PropertySet propSet)