|
||||||||||
| 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
com.prosysopc.ua.server.nodes.PlainVariable<T>
public class PlainVariable<T>
A very plain, type specific implementation of the UA variable node.
This is a generic type, which adds a strongly typed field for the CurrentValue of the property. It also reserves separate fields for status, serverTimestamp and sourceTimestamp.
| 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 | |
|---|---|
PlainVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
|
|
PlainVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale)
|
|
| Method Summary | |
|---|---|
protected void |
doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
Perform the actual value set. |
T |
getCurrentValue()
|
org.opcfoundation.ua.builtintypes.DateTime |
getServerTimestamp()
|
org.opcfoundation.ua.builtintypes.DateTime |
getSourceTimestamp()
|
org.opcfoundation.ua.builtintypes.StatusCode |
getStatus()
|
org.opcfoundation.ua.builtintypes.DataValue |
getValue()
|
Class<?> |
getValueClass()
|
boolean |
setCurrentValue(T currentValue)
Set the current value with the current time as sourceTimestamp assuming a good status (unless null value is given). |
boolean |
setCurrentValue(T newValue,
org.opcfoundation.ua.builtintypes.DateTime sourceTimestamp)
Set the current value with a specific sourceTimestamp assuming a good status (unless null value is given). |
boolean |
setCurrentValue(T newValue,
org.opcfoundation.ua.builtintypes.StatusCode status,
org.opcfoundation.ua.builtintypes.DateTime sourceTimestamp,
org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
Set the currentValue together with a specific Status and sourceTimestamp. |
void |
setStatus(org.opcfoundation.ua.builtintypes.StatusCode status)
Set the status of the variable. |
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. |
| 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 |
| Constructor Detail |
|---|
public PlainVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
nodeManager - nodeId - browseName - displayName -
public PlainVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale)
nodeManager - nodeId - name - locale - | Method Detail |
|---|
public final T getCurrentValue()
public org.opcfoundation.ua.builtintypes.DateTime getServerTimestamp()
public org.opcfoundation.ua.builtintypes.DateTime getSourceTimestamp()
public org.opcfoundation.ua.builtintypes.StatusCode getStatus()
getStatus in class UaVariableNodepublic org.opcfoundation.ua.builtintypes.DataValue getValue()
public Class<?> getValueClass()
public boolean setCurrentValue(T currentValue)
currentValue - the currentValue to set
public boolean setCurrentValue(T newValue,
org.opcfoundation.ua.builtintypes.DateTime sourceTimestamp)
newValue - the new value to set. If this is null, status will be set to BAD, otherwise it
is set to GOOD.sourceTimestamp - the tie when the value was measured in the actual source, if known.
Leave to null if the time is not available.
public boolean setCurrentValue(T newValue,
org.opcfoundation.ua.builtintypes.StatusCode status,
org.opcfoundation.ua.builtintypes.DateTime sourceTimestamp,
org.opcfoundation.ua.builtintypes.UnsignedShort sourcePicoseconds)
newValue - the currentValue to setstatus - the status to setsourceTimestamp - the time when the value was measured in the sourcesourcePicoseconds - optional picosecond accuracy of the timestamp
public void setStatus(org.opcfoundation.ua.builtintypes.StatusCode status)
UaVariableNodeThe sourceTimestamp is set to null, and serverTimestamp is set to the current time.
setStatus in class UaVariableNodestatus - the status to set
protected void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
throws StatusException
UaVariableNode
doSetValue in class UaVariableNodeStatusException
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
UaVariableNode
updateValue in class UaVariableNodenewValue - 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.
StatusException - if newValue is not valid for the variable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||