|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.prosysopc.ua.nodes.AbstractUaNode
com.prosysopc.ua.server.nodes.ServerNode
com.prosysopc.ua.server.nodes.BaseNode
com.prosysopc.ua.server.nodes.UaInstanceNode
com.prosysopc.ua.server.nodes.UaVariableNode
public abstract class UaVariableNode
Abstract base implementation of UaVariable for UA Server side.
It reserves fields for all variable specific attributes, except for the Value attribute. See
CacheVariable for a base non-abstract implementation.
| Field Summary |
|---|
| Fields inherited from class com.prosysopc.ua.server.nodes.BaseNode |
|---|
NODE_VERSION_PROPERTY_NAME |
| Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode |
|---|
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap |
| Constructor Summary | |
|---|---|
UaVariableNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a new variable with dataTypeId initialized to BaseDataType. |
|
UaVariableNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale)
Create a new variable with a specific data type. |
|
| Method Summary | |
|---|---|
UaReference |
addProperty(UaProperty property)
Add a new property node to the node. |
protected ReflectiveVariable |
addReflectiveVariable(Object reflectedObject,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String fieldName,
int nameSpaceIndex,
org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
|
protected boolean |
beforeAddReference(UaReference reference)
|
protected void |
checkPropertyType(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
|
protected void |
checkPropertyType(org.opcfoundation.ua.builtintypes.NodeId nodeId)
|
protected org.opcfoundation.ua.builtintypes.DataValue |
createDataValue(Object value)
|
protected abstract void |
doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
Perform the actual value set. |
protected void |
exposeStructureWithReflectiveVariables(org.opcfoundation.ua.builtintypes.Structure structure,
int nameSpaceIndex,
org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
|
EnumSet<org.opcfoundation.ua.core.AccessLevel> |
getAccessLevel()
Defines the global read/write access of the Value attribute for all users. |
org.opcfoundation.ua.builtintypes.UnsignedInteger[] |
getArrayDimensions()
This Attribute specifies the length of each dimension for an array value. |
org.opcfoundation.ua.core.NodeAttributes |
getAttributes()
|
protected org.opcfoundation.ua.core.VariableAttributes |
getAttributes(org.opcfoundation.ua.core.VariableAttributes attributes)
|
UaType |
getDataType()
|
org.opcfoundation.ua.builtintypes.NodeId |
getDataTypeId()
|
protected org.opcfoundation.ua.builtintypes.ExpandedNodeId |
getDefaultTypeDefinition()
|
Boolean |
getHistorizing()
|
Double |
getMinimumSamplingInterval()
|
org.opcfoundation.ua.core.NodeClass |
getNodeClass()
The NodeClass Attribute identifies the NodeClass of a Node. |
UaProperty[] |
getProperties()
|
org.opcfoundation.ua.builtintypes.StatusCode |
getStatus()
|
EnumSet<org.opcfoundation.ua.core.AccessLevel> |
getUserAccessLevel()
Defines the user specific read/write access of the Value attribute. |
Integer |
getValueRank()
This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions the array has. |
boolean |
hasUserWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Overrides the default to check access to Value attribute from AccessLevel. |
boolean |
hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Overrides the default to check access to Value attribute from AccessLevel. |
protected void |
initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
|
protected boolean |
isPropertyType()
|
protected void |
notifyValueChanging(org.opcfoundation.ua.builtintypes.DataValue newValue)
|
void |
notifyValueChanging(Object newValue)
|
protected void |
readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
Read the value of an attribute. |
protected void |
semanticsChanged()
Set the SemanticsChanged bit of statusCodeChangeBits (to be sent with the next notification) and add an entry to the SemanticChangeEvent. |
void |
setAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel)
|
void |
setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions)
This Attribute specifies the length of each dimension for an array value. |
void |
setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
|
void |
setDataType(UaType dataType)
Set the Data Type node. |
void |
setDataTypeId(org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Set the Data Type. |
void |
setHistorizing(Boolean historizing)
|
void |
setMinimumSamplingInterval(Double minimumSamplingInterval)
|
void |
setStatus(org.opcfoundation.ua.builtintypes.StatusCode status)
Set the status of the variable. |
void |
setTypeDefinition(UaType type)
Sets the type of the node. |
void |
setTypeDefinitionId(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
Sets the type definition to an ExpandedNodeId. |
void |
setUserAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> userAccessLevel)
|
void |
setValue(org.opcfoundation.ua.builtintypes.DataValue value)
The default Value for instances of this type. |
void |
setValue(Object value)
Set value. |
void |
setValueRank(int valueRank)
This Attribute indicates whether the Value Attribute of the VariableType is an array and how many dimensions the array has. |
protected void |
structureChanged()
Set the StructureChanged bit of statusCodeChangeBits (to be sent with the next notification). |
String |
toString()
|
void |
updateValue(Object newValue)
Update the current value and status. |
protected void |
updateValue(Object newValue,
org.opcfoundation.ua.builtintypes.StatusCode status,
org.opcfoundation.ua.builtintypes.DateTime sourceTime,
org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
Update the current value and status. |
protected void |
writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
Object value,
org.opcfoundation.ua.builtintypes.StatusCode statusCode,
org.opcfoundation.ua.builtintypes.DateTime sourceTime,
org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
|
| Methods inherited from class com.prosysopc.ua.server.nodes.UaInstanceNode |
|---|
addModellingRule, getTypeDefinition, getTypeDefinitionId, hasTypeDefinition, registerOverridePlainMethod, setTypeDefinitionId, supportsTypeDefinitionNode |
| Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode |
|---|
getForwardReferences, getInverseReferences, getReferences, getReferences, referenceTypeInherits |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.prosysopc.ua.nodes.UaVariable |
|---|
addDataChangeListener, removeDataChangeListener |
| Methods inherited from interface com.prosysopc.ua.nodes.UaInstance |
|---|
getTypeDefinition, getTypeDefinitionId, setTypeDefinitionId |
| Methods inherited from interface com.prosysopc.ua.nodes.UaValueNode |
|---|
getValue |
| Constructor Detail |
|---|
public UaVariableNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
nodeId - browseName - displayName -
public UaVariableNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale)
nodeId - The variable ID.name - The name used for browseName & displayNamelocale - The locale of displayNamedataTypeId - The variable data type as a NodeId.| Method Detail |
|---|
public UaReference addProperty(UaProperty property)
UaNodeAdds a new forward HasProperty reference with target to the property node.
addProperty in interface UaNodeaddProperty in class ServerNodeproperty - the property to add to the node
public EnumSet<org.opcfoundation.ua.core.AccessLevel> getAccessLevel()
UaVariableIn contrast to the WriteAccess this attribute only applies to the Value attribute.
getAccessLevel in interface UaVariableUaVariable.getUserAccessLevel()public org.opcfoundation.ua.builtintypes.UnsignedInteger[] getArrayDimensions()
UaValueNodeThe number of elements shall be equal to the value of the ValueRank Attribute. Shall be null if ValueRank <= 0.
A value of 0 for an individual dimension indicates that the dimension has a variable length.
For example, if a Variable is defined by the following C array: Int32 myArray[346];
then this Variable's DataType would point to an Int32, the Variable's ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.
getArrayDimensions in interface UaValueNodeUaValueNode.setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[])public org.opcfoundation.ua.core.NodeAttributes getAttributes()
getAttributes in interface UaNodegetAttributes in class BaseNodepublic UaType getDataType()
getDataType in interface UaValueNodeUaValueNode.getDataTypeId()public org.opcfoundation.ua.builtintypes.NodeId getDataTypeId()
getDataTypeId in interface UaValueNodepublic Boolean getHistorizing()
getHistorizing in interface UaVariablepublic Double getMinimumSamplingInterval()
getMinimumSamplingInterval in interface UaVariablepublic final org.opcfoundation.ua.core.NodeClass getNodeClass()
UaNode
getNodeClass in interface UaNodegetNodeClass in class BaseNodepublic UaProperty[] getProperties()
getProperties in interface UaNodegetProperties in class BaseNodepublic org.opcfoundation.ua.builtintypes.StatusCode getStatus()
public EnumSet<org.opcfoundation.ua.core.AccessLevel> getUserAccessLevel()
UaVariableIn contrast to the UserWriteAccess this attribute only applies to the Value attribute.
getUserAccessLevel in interface UaVariableUaVariable.getAccessLevel()public Integer getValueRank()
UaValueNodeIt may have the following values:
getValueRank in interface UaValueNodeUaValueNode.setValueRank(int)public boolean hasUserWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
hasUserWriteAccess in interface UaNodehasUserWriteAccess in class BaseNodeattributeId -
public boolean hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
hasWriteAccess in interface UaNodehasWriteAccess in class BaseNodeattributeId -
public void notifyValueChanging(Object newValue)
public void setAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel)
setAccessLevel in interface UaVariableaccessLevel - the access level to setUaVariable.getAccessLevel()public void setArrayDimensions(org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions)
UaValueNodeThe number of elements shall be equal to the value of the ValueRank Attribute. Shall be null if ValueRank <= 0.
A value of 0 for an individual dimension indicates that the dimension has a variable length.
For example, if a VariableType is defined by the following array:
Integer[] myArray = new Integer[346];
then this VariableType's DataType would point to the Int32 data type node, the VariableType's ValueRank has the value 1 and the ArrayDimensions is an array with one entry having the value 346.
setArrayDimensions in interface UaValueNodepublic void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
setAttributes in interface UaNodesetAttributes in class BaseNodepublic void setDataType(UaType dataType)
UaValueNode
setDataType in interface UaValueNodeUaValueNode.setDataTypeId(NodeId)public void setDataTypeId(org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
UaValueNode
setDataTypeId in interface UaValueNodeUaValueNode.setDataTypeId(NodeId)public void setHistorizing(Boolean historizing)
setHistorizing in interface UaVariablehistorizing - define that the variable has history - or notpublic void setMinimumSamplingInterval(Double minimumSamplingInterval)
setMinimumSamplingInterval in interface UaVariableminimumSamplingInterval - define the minimum sampling intervalpublic void setStatus(org.opcfoundation.ua.builtintypes.StatusCode status)
The sourceTimestamp is set to null, and serverTimestamp is set to the current time.
status - the status to setpublic void setTypeDefinition(UaType type)
UaInstanceNode
setTypeDefinition in interface UaInstancesetTypeDefinition in class UaInstanceNodetype - The type to setUaInstance.getTypeDefinitionId(),
UaInstance.getTypeDefinition(),
UaInstance.setTypeDefinitionId(ExpandedNodeId),
UaInstance.setTypeDefinitionId(NodeId)public void setTypeDefinitionId(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
UaInstance
setTypeDefinitionId in interface UaInstancesetTypeDefinitionId in class UaInstanceNodetypeDefinition - the type definition Id to setUaInstance.getTypeDefinitionId(),
UaInstance.getTypeDefinition(),
UaInstance.setTypeDefinition(UaType),
UaInstance.setTypeDefinitionId(NodeId)public void setUserAccessLevel(EnumSet<org.opcfoundation.ua.core.AccessLevel> userAccessLevel)
setUserAccessLevel in interface UaVariableuserAccessLevel - the user access level to setUaVariable.getUserAccessLevel()
public void setValue(org.opcfoundation.ua.builtintypes.DataValue value)
throws StatusException
UaValueNode
setValue in interface UaValueNodevalue - the default value to set
StatusException
public void setValue(Object value)
throws StatusException
setValue in interface UaValueNodevalue - a new value
StatusException - if the value is invalid for the Value attributepublic void setValueRank(int valueRank)
UaValueNodeIt may have the following values:
setValueRank in interface UaValueNodevalueRank - the value rank to setpublic String toString()
toString in class UaInstanceNode
public void updateValue(Object newValue)
throws StatusException
newValue - The new value for the variable. This should be of the correct DataType or a
Variant. Or it can be a DataValue, in which case, it is copied to value with a new
timestamp.
StatusException - if newValue is not valid for the variable
protected ReflectiveVariable addReflectiveVariable(Object reflectedObject,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String fieldName,
int nameSpaceIndex,
org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
throws SecurityException,
NoSuchMethodException
reflectedObject - nodeId - fieldName - nameSpaceIndex - typeDefinitionId -
NoSuchMethodException
SecurityExceptionprotected boolean beforeAddReference(UaReference reference)
beforeAddReference in class UaInstanceNodeprotected void checkPropertyType(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
protected void checkPropertyType(org.opcfoundation.ua.builtintypes.NodeId nodeId)
nodeId -
IllegalArgumentExceptionprotected org.opcfoundation.ua.builtintypes.DataValue createDataValue(Object value)
protected abstract void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
throws StatusException
value -
StatusException
protected void exposeStructureWithReflectiveVariables(org.opcfoundation.ua.builtintypes.Structure structure,
int nameSpaceIndex,
org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
structure - a Structure type, auto-generated to the stack. It must define fields with
capitalized names, e.g. "FieldName"typeDefinitionId -
SecurityException
RuntimeExceptionprotected org.opcfoundation.ua.core.VariableAttributes getAttributes(org.opcfoundation.ua.core.VariableAttributes attributes)
protected org.opcfoundation.ua.builtintypes.ExpandedNodeId getDefaultTypeDefinition()
getDefaultTypeDefinition in class UaInstanceNodeprotected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
initSupportedAttributes in class ServerNodeprotected boolean isPropertyType()
protected void notifyValueChanging(org.opcfoundation.ua.builtintypes.DataValue newValue)
protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
throws StatusException
BaseNode
readAttributeValue in class BaseNodeattributeId - the ID of the attribute to read.dataValue - the DataValue structure in which the value is set.
StatusExceptionprotected void semanticsChanged()
protected void structureChanged()
protected void updateValue(Object newValue,
org.opcfoundation.ua.builtintypes.StatusCode status,
org.opcfoundation.ua.builtintypes.DateTime sourceTime,
org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
throws StatusException
newValue - The new value for the variable. This should be of the correct DataType or a
Variant. Or it can be a DataValue, in which case, it is copied to value with a new
timestamp.status - The new status for the variable.sourceTimestamp - source timestamp, if null current time is used
StatusException - if newValue is not valid for the variable
protected void writeAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
Object value,
org.opcfoundation.ua.builtintypes.StatusCode statusCode,
org.opcfoundation.ua.builtintypes.DateTime sourceTime,
org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
throws StatusException
writeAttributeValue in class BaseNodeStatusException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||