com.prosysopc.ua.server.nodes
Class CacheVariable

java.lang.Object
  extended by com.prosysopc.ua.nodes.AbstractUaNode
      extended by com.prosysopc.ua.server.nodes.ServerNode
          extended by com.prosysopc.ua.server.nodes.BaseNode
              extended by com.prosysopc.ua.server.nodes.UaInstanceNode
                  extended by com.prosysopc.ua.server.nodes.UaVariableNode
                      extended by com.prosysopc.ua.server.nodes.CacheVariable
All Implemented Interfaces:
UaInstance, UaNode, UaValueNode, UaVariable
Direct Known Subclasses:
AbstractGeneratedVariableNode, CacheProperty

public class CacheVariable
extends UaVariableNode

A base implementation of UaVariable with a value cache.


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
CacheVariable(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create a new cache variable.
CacheVariable(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
          Create a new cache variable.
 
Method Summary
protected  void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
          Perform the actual value set.
 org.opcfoundation.ua.builtintypes.DataValue getValue()
           
 void updateValue(Object newValue)
          Update the current value and status.
 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.
 
Methods inherited from class com.prosysopc.ua.server.nodes.UaVariableNode
addProperty, addReflectiveVariable, beforeAddReference, checkPropertyType, checkPropertyType, createDataValue, exposeStructureWithReflectiveVariables, getAccessLevel, getArrayDimensions, getAttributes, getAttributes, getDataType, getDataTypeId, getDefaultTypeDefinition, getHistorizing, getMinimumSamplingInterval, getNodeClass, getProperties, getStatus, getUserAccessLevel, getValueRank, hasUserWriteAccess, hasWriteAccess, initSupportedAttributes, isPropertyType, notifyValueChanging, notifyValueChanging, readAttributeValue, semanticsChanged, setAccessLevel, setArrayDimensions, setAttributes, setDataType, setDataTypeId, setHistorizing, setMinimumSamplingInterval, setStatus, setTypeDefinition, setTypeDefinitionId, setUserAccessLevel, setValue, setValue, setValueRank, structureChanged, toString, writeAttributeValue
 
Methods inherited from class com.prosysopc.ua.server.nodes.UaInstanceNode
addModellingRule, getTypeDefinition, getTypeDefinitionId, hasTypeDefinition, registerOverridePlainMethod, setTypeDefinitionId, supportsTypeDefinitionNode
 
Methods inherited from class com.prosysopc.ua.server.nodes.BaseNode
addPlainProperty, addPlainVariable, assertTypeSupport, assertTypeSupport, createNodeId, createNodeId, createReflectiveInstanceProperty, createReflectiveInstanceProperty, deleteReference, deleteReference, doAddProperty, getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDescription, getDisplayName, getDisplayName, getMethod, getNodeVersion, getNodeVersionValue, getProperty, getPropertyValue, getReferencesAsList, getStandardBrowseName, getStandardDisplayText, getUserWriteMask, getWriteMask, hasProperty, hasReference, incNodeVersion, initNodeVersion, isChildOfType, readAttribute, readAttribute, registerCallbackProperty, registerPlainInstanceProperty, registerPlainInstanceProperty, registerPlainProperty, registerPlainProperty, registerPlainVariable, registerPlainVariable, registerReflectiveInstanceProperty, registerReflectiveInstanceVariable, registerReflectiveProperty, registerReflectiveVariable, removeProperty, setAccessLevelRecursively, setAccessLevelRecursively, setAttribute, setBrowseName, setDescription, setDisplayName, setNodeVersionValue, setPropertyValue, setUserWriteMask, setWriteMask, writeAttribute
 
Methods inherited from class com.prosysopc.ua.server.nodes.ServerNode
addComponent, addDataChangeListener, addEventListener, addNewReference, addNewReference, addOrganizes, addProperties, addReference, addReference, addReference, addReference, addReference, addReference, afterAddReference, afterDeleteReference, dataChange, deleteReference, deleteReference, deleteReferences, doDeleteReference, equals, findPlaceholders, fireDataChange, fireEvent, fireEventInParents, getAddressSpace, getDefaultBrowseName, getNodeId, getNodeManager, getReference, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, hashCode, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeComponent, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, setReferences, supportsAttribute, translateBrowsePathToNodeIds, validateHasEventSourceChain, validateHasEventSourceChain
 
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.UaNode
addComponent, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getBrowseName, getComponent, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeId, getNodeVersion, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 

Constructor Detail

CacheVariable

public CacheVariable(NodeManagerUaNode nodeManager,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                     org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a new cache variable.

Parameters:
nodeManager - the nodeManager to which the variable is added
nodeId - the nodeId of the variable
browseName - the browseName of the variable
displayName - the displayName of the variable

CacheVariable

public CacheVariable(NodeManagerUaNode nodeManager,
                     org.opcfoundation.ua.builtintypes.NodeId nodeId,
                     String name,
                     Locale locale)
Create a new cache variable. Name is used as the BrowseName and DisplayName of the variable.

Parameters:
nodeManager - the nodeManager to which the variable is added
nodeId - the nodeId of the variable
name - the name of the variable
locale - the locale of the DisplayName (which is equal to name)
Method Detail

getValue

public org.opcfoundation.ua.builtintypes.DataValue getValue()
Returns:
The default Value for instances of this type.

updateValue

public void updateValue(Object newValue)
                 throws StatusException
Description copied from class: UaVariableNode
Update the current value and status. Server & source timestamp are set to the current time. The status will be set to StatusCode.GOOD, unless the value is null or is a Variant which contains null.

Overrides:
updateValue in class UaVariableNode
Parameters:
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.
Throws:
StatusException - if newValue is not valid for the variable

updateValue

public void updateValue(Object newValue,
                        org.opcfoundation.ua.builtintypes.StatusCode status,
                        org.opcfoundation.ua.builtintypes.DateTime sourceTime,
                        org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
                 throws StatusException
Description copied from class: UaVariableNode
Update the current value and status. Server timestamp is set to the current time.

Overrides:
updateValue in class UaVariableNode
Parameters:
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.
Throws:
StatusException - if newValue is not valid for the variable

doSetValue

protected void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
                   throws StatusException
Description copied from class: UaVariableNode
Perform the actual value set.

Specified by:
doSetValue in class UaVariableNode
Parameters:
value -
Throws:
StatusException


Copyright © 2018. All rights reserved.