|
||||||||||
| 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.client.nodes.UaNodeImpl
com.prosysopc.ua.client.nodes.UaInstanceImpl
com.prosysopc.ua.client.nodes.UaVariableImpl
public class UaVariableImpl
Straight forward implementation of UaVariable.
It keeps all attributes in memory.
| Field Summary |
|---|
| Fields inherited from class com.prosysopc.ua.client.nodes.UaNodeImpl |
|---|
addressSpace, references, supportedAttributesMap |
| Constructor Summary | |
|---|---|
UaVariableImpl(AddressSpace addressSpace,
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. |
|
UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
org.opcfoundation.ua.builtintypes.LocalizedText description,
EnumSet<WriteAccess> writeMask,
EnumSet<WriteAccess> userWriteMask,
UaClientReference[] references,
UaProperty[] properties,
org.opcfoundation.ua.builtintypes.NodeId dataTypeId,
Integer valueRank,
org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions,
EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel,
EnumSet<org.opcfoundation.ua.core.AccessLevel> userAccessLevel,
Double minimumSamplingInterval,
Boolean historizing)
|
|
UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Create a new variable with a specific data type. |
|
UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
UaType dataType)
Create a new variable with a specific data type. |
|
UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale,
org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
Create a new variable with a specific data type. |
|
UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale,
UaType dataType)
Create a new variable with a specific data type. |
|
| Method Summary | |
|---|---|
void |
addDataChangeListener(DataChangeListener listener)
Not supported at the moment. |
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()
|
Boolean |
getHistorizing()
|
Double |
getMinimumSamplingInterval()
|
org.opcfoundation.ua.core.NodeClass |
getNodeClass()
The NodeClass Attribute identifies the NodeClass of a Node. |
EnumSet<org.opcfoundation.ua.core.AccessLevel> |
getUserAccessLevel()
Defines the user specific read/write access of the Value attribute. |
org.opcfoundation.ua.builtintypes.DataValue |
getValue()
|
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 void |
readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
Read the value of an attribute. |
org.opcfoundation.ua.builtintypes.DataValue |
readValue()
Reads the current value of the variable from the server. |
void |
removeDataChangeListener(DataChangeListener listener)
Not supported at the moment. |
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 |
setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
Unconditionally, set the value of the specified attribute. |
void |
setAttributes(org.opcfoundation.ua.core.VariableAttributes variableAttributes)
|
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 |
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. |
String |
toString()
|
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)
|
boolean |
writeValue(Object value)
Writes the value to the variable in the server. |
| Methods inherited from class com.prosysopc.ua.client.nodes.UaInstanceImpl |
|---|
getTypeDefinition, getTypeDefinitionId, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId |
| Methods inherited from class com.prosysopc.ua.nodes.AbstractUaNode |
|---|
getForwardReferences, getInverseReferences, getReferences, getReferences, getReferencesAsList, referenceTypeInherits |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.prosysopc.ua.nodes.UaInstance |
|---|
getTypeDefinition, getTypeDefinitionId, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId |
| Constructor Detail |
|---|
public UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
nodeId - browseName - displayName -
public UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
org.opcfoundation.ua.builtintypes.LocalizedText description,
EnumSet<WriteAccess> writeMask,
EnumSet<WriteAccess> userWriteMask,
UaClientReference[] references,
UaProperty[] properties,
org.opcfoundation.ua.builtintypes.NodeId dataTypeId,
Integer valueRank,
org.opcfoundation.ua.builtintypes.UnsignedInteger[] arrayDimensions,
EnumSet<org.opcfoundation.ua.core.AccessLevel> accessLevel,
EnumSet<org.opcfoundation.ua.core.AccessLevel> userAccessLevel,
Double minimumSamplingInterval,
Boolean historizing)
public UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
nodeId - The variable ID.browseName - The name used for browseNamedisplayName - The name used for localized displayNamedataTypeId - The variable data type as a NodeId.
public UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
UaType dataType)
nodeId - The variable ID.browseName - The name used for browseNamedisplayName - The name used for localized displayNamedataTypeId - The variable data type.
public UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale,
org.opcfoundation.ua.builtintypes.NodeId dataTypeId)
nodeId - The variable ID.name - The name used for browseName & displayNamelocale - The locale of displayNamedataTypeId - The variable data type as a NodeId.
public UaVariableImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale,
UaType dataType)
nodeId - The variable ID.name - The name used for browseName & displayNamelocale - The locale of displayNamedataType - The variable data type.| Method Detail |
|---|
public void addDataChangeListener(DataChangeListener listener)
addDataChangeListener in interface UaVariablepublic 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 UaNodepublic 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 UaNodeImplpublic 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 org.opcfoundation.ua.builtintypes.DataValue getValue()
getValue in interface UaValueNodepublic 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 UaNodeImplattributeId -
public boolean hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
hasWriteAccess in interface UaNodehasWriteAccess in class UaNodeImplattributeId -
public org.opcfoundation.ua.builtintypes.DataValue readValue()
throws StatusException,
ServiceException
StatusException - if the read operation fails
ServiceException - if the service call to the server failspublic void removeDataChangeListener(DataChangeListener listener)
removeDataChangeListener in interface UaVariablepublic 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 UaValueNode
public void setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
throws StatusException
UaNodeImpl
setAttribute in interface UaNodesetAttribute in class UaNodeImplStatusExceptionpublic void setAttributes(org.opcfoundation.ua.core.VariableAttributes variableAttributes)
public 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 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. The value may be a DataValue, Variant or any "OPC UA compliant"
value, i.e. value which can be used to initialize a Variant.
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 UaInstanceImpl
public boolean writeValue(Object value)
throws StatusException,
ServiceException
value - the value to write to the server. The value may be a DataValue, Variant or any
"OPC UA compliant" value, i.e. value which can be used to initialize a Variant.
ServiceException - If the call fails. Expected ServiceResult codes are Bad_NothingToDo
and Bad_TooManyOperations.
StatusException - If the server returns a bad status for the value. Read the exception
for the error details and diagnostics. Expected bad status codes are Bad_NodeIdInvalid,
Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData,
Bad_WriteNotSupported, Bad_NotWritable, Bad_UserAccessDenied, Bad_OutOfRange,
Bad_TypeMismatchreadValue(),
UaClient.writeValue(org.opcfoundation.ua.builtintypes.NodeId, java.lang.Object)protected org.opcfoundation.ua.core.VariableAttributes getAttributes(org.opcfoundation.ua.core.VariableAttributes attributes)
protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
initSupportedAttributes in class UaNodeImpl
protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
throws StatusException
UaNodeImpl
readAttributeValue in class UaNodeImplattributeId - the ID of the attribute to read.dataValue - the DataValue structure in which the value is set.
StatusException
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 UaNodeImplStatusException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||