public abstract class AbstractClientTag extends AbstractTag implements ClientTag, TagScriptMonitor, Diagnosable
Modifier and Type | Field and Description |
---|---|
protected VisionClientContext |
appContext |
protected boolean |
deleted
Turned true when this tag is deleted so that the correct quality can be returned
|
protected static org.apache.log4j.Logger |
LOGGER |
protected java.lang.String |
name
The name of this tag
|
protected TagPath |
pathContext
Tag path that points toward my parent, null if I'm the root
|
accessRights, attributes, enabled, eventScripts, permissionModel, type
Modifier | Constructor and Description |
---|---|
protected |
AbstractClientTag(java.lang.String name,
DataType dataType,
TagValue value) |
Modifier and Type | Method and Description |
---|---|
void |
addTagChangeListener(TagChangeListener l)
Registers a listener for tag changes for this tag.
|
void |
applyDiff(TagDiff diff)
Applies the diff to this tag, and fires one change at the end.
|
protected void |
checkName(java.lang.String name) |
ClientTag |
findChild(java.lang.String tagName)
Attempts to find a tag with the given name (case insensitive).
|
protected void |
fireScriptEvent(java.lang.String id,
java.lang.Object... params) |
void |
fireTagChange(TagProp prop) |
AlarmConfiguration |
getAlarmStates()
Returns the list of alarm states for this tag
|
TagValue |
getAttribute(TagProp prop)
Gets the value of the given tag attribute.
|
java.util.List<? extends ClientTag> |
getChildren()
Returns a list of children.
|
java.lang.String |
getName()
Returns the name of the tag.
|
int |
getNumSubscribers()
Return the number of subscribers for this client tag
|
TagPath |
getPath() |
TagValue |
getValue()
Returns the value in qualified form- along with quality and timestamp.
|
TagValue |
getValueRaw()
Gets the tag's current value, skipping enabled and security checks.
|
boolean |
hasPermission(boolean write)
Returns true if the currently logged in user has permission for this tag, either for read or write access
|
boolean |
isAlarmingSupported()
Returns true if this tag supports alarming, false otherwise
|
void |
notifyPermissionsChanged()
Called by the tag manager when permissions change - so maybe the user has access to previously denied tags now, or
vice versa.
|
void |
notifyTagDeleted()
Called when this tag is removed.
|
void |
onScriptError(java.lang.String id,
java.lang.String message,
java.lang.Exception error) |
void |
onScriptSuccess(java.lang.String id) |
Tag |
removeChild(java.lang.String tagName)
Removes the child with the given name (case insensitive).
|
void |
removeTagChangeListener(TagChangeListener l)
Removes a listener from this tag.
|
void |
sampleDiagnostics(DiagnosticsSample sample)
Provides the sample upon which the object can set diagnostics information.
|
void |
setAccessRights(AccessRightsType accessRights)
Sets the type of access rights for this tag.
|
void |
setAlarmStates(AlarmConfiguration config) |
void |
setAlarmStates(AlarmStateList list) |
void |
setAttribute(TagProp prop,
TagValue value)
Sets the value of the given tag attribute.
|
void |
setEnabled(boolean enabled)
Sets this tag enabled/disabled
|
void |
setEventScripts(TagEventScripts scripts) |
void |
setName(java.lang.String name)
Sets the name of this tag
|
void |
setPermissionModel(TagPermissionsModel permissionModel)
Sets the tag's permission model
|
void |
setTypeAndValue(DataType type,
java.lang.Object value)
Deprecated.
|
void |
setTypeAndValue(DataType type,
TagValue value) |
void |
setValue(TagValue obj)
Sets this tags value.
|
void |
startBinding(VisionClientContext appContext,
TagPath pathContext)
Starts any binding for the tag, such as an expression binding or a SQL query binding
|
void |
stopBinding()
Stops any binding activities for this tag
|
void |
transferState(ClientTag otherTag)
Transfers listeners and values to another tag.
|
protected void |
updateRuntimeQuality(int flag,
boolean on) |
addChild, coerceValue, compareTo, getAccessRights, getChild, getDataType, getEventScripts, getPermissionModel, getRawAttributes, isEnabled, isValidName, main, sanitizeName, setDataType, setRawAttributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addChild
setDataType
getAccessRights, getDataType, getEventScripts, getPermissionModel, getType, isEnabled
protected static final org.apache.log4j.Logger LOGGER
protected java.lang.String name
protected boolean deleted
protected VisionClientContext appContext
protected TagPath pathContext
public void applyDiff(TagDiff diff)
public java.util.List<? extends ClientTag> getChildren()
TagNode
getChildren
in interface TagNode
getChildren
in class AbstractTag
public java.lang.String getName()
Tag
protected void checkName(java.lang.String name)
public void setName(java.lang.String name)
MutableTag
setName
in interface MutableTag
setName
in class AbstractTag
public ClientTag findChild(java.lang.String tagName)
ClientTag
public Tag removeChild(java.lang.String tagName)
ClientTag
removeChild
in interface ClientTag
removeChild
in class AbstractTag
public TagValue getAttribute(TagProp prop)
Tag
getAttribute
in interface Tag
getAttribute
in class AbstractTag
public void setAttribute(TagProp prop, TagValue value) throws java.lang.ClassCastException
MutableTag
setAttribute
in interface MutableTag
setAttribute
in class AbstractTag
java.lang.ClassCastException
@Deprecated public void setTypeAndValue(DataType type, java.lang.Object value)
public void setValue(TagValue obj) throws java.lang.ClassCastException
MutableTag
setValue
in interface MutableTag
setValue
in class AbstractTag
java.lang.ClassCastException
public TagValue getValue()
Tag
getValue
in interface Tag
getValue
in class AbstractTag
public void setEnabled(boolean enabled)
MutableTag
setEnabled
in interface MutableTag
setEnabled
in class AbstractTag
public TagValue getValueRaw()
public boolean hasPermission(boolean write)
hasPermission
in interface ClientTag
public void setAccessRights(AccessRightsType accessRights)
MutableTag
setAccessRights
in interface MutableTag
setAccessRights
in class AbstractTag
public void setPermissionModel(TagPermissionsModel permissionModel)
MutableTag
setPermissionModel
in interface MutableTag
setPermissionModel
in class AbstractTag
public void setEventScripts(TagEventScripts scripts)
setEventScripts
in interface MutableTag
setEventScripts
in class AbstractTag
public AlarmConfiguration getAlarmStates()
Tag
getAlarmStates
in interface Tag
public void setAlarmStates(AlarmConfiguration config)
setAlarmStates
in interface MutableTag
public boolean isAlarmingSupported()
Tag
isAlarmingSupported
in interface Tag
isAlarmingSupported
in class AbstractTag
public void setAlarmStates(AlarmStateList list)
public TagPath getPath()
public void onScriptSuccess(java.lang.String id)
onScriptSuccess
in interface TagScriptMonitor
public void onScriptError(java.lang.String id, java.lang.String message, java.lang.Exception error)
onScriptError
in interface TagScriptMonitor
public void startBinding(VisionClientContext appContext, TagPath pathContext)
ClientTag
startBinding
in interface ClientTag
public void stopBinding()
ClientTag
stopBinding
in interface ClientTag
public void sampleDiagnostics(DiagnosticsSample sample)
Diagnosable
sampleDiagnostics
in interface Diagnosable
public int getNumSubscribers()
ClientTag
getNumSubscribers
in interface ClientTag
public void addTagChangeListener(TagChangeListener l)
ClientTag
addTagChangeListener
in interface ClientTag
public void removeTagChangeListener(TagChangeListener l)
ClientTag
removeTagChangeListener
in interface ClientTag
public void transferState(ClientTag otherTag)
ClientTag
transferState
in interface ClientTag
protected void updateRuntimeQuality(int flag, boolean on)
public void notifyTagDeleted()
ClientTag
notifyTagDeleted
in interface ClientTag
public void notifyPermissionsChanged()
ClientTag
notifyPermissionsChanged
in interface ClientTag
public void fireTagChange(TagProp prop)
protected void fireScriptEvent(java.lang.String id, java.lang.Object... params)