|
||||||||||
| 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.InstanceVariable
com.prosysopc.ua.server.nodes.PlainInstanceVariable<T>
public class PlainInstanceVariable<T>
A very plain, type specific implementation of InstanceVariable.
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.ServerNode |
|---|
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap |
| Constructor Summary | |
|---|---|
PlainInstanceVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
Create a new node, referring to an instance declaration node. |
|
PlainInstanceVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaVariable instanceDeclaration)
Create a new node, referring to an instance declaration node. |
|
| 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. |
| 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.UaNode |
|---|
addComponent, addProperty, addReference, addReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getForwardReferences, getInverseReferences, getNodeId, getReferences, getReferences, getSupportedAttributes, supportsAttribute |
| Constructor Detail |
|---|
public PlainInstanceVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
throws StatusException
nodeManager - The node manager to which the node is created.nodeId - The ID of the new node.instanceDeclarationId - The ID of the instance declaration node, which this node is
referring to. I.e. the same variable or property as this one, but under the type,
instead of the instance.
StatusException - if instanceDeclarationId cannot be converted to a variable node
public PlainInstanceVariable(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
UaVariable instanceDeclaration)
nodeManager - The node manager to which the node is created.nodeId - The ID of the new node.instanceDeclaration - The instance declaration node, which this node is referring to. I.e.
the same variable or property as this one, but under the type, instead of the instance.| 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 InstanceVariablepublic 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 time 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)
InstanceVariableThe sourceTimestamp is set to null, and serverTimestamp is set to the current time.
setStatus in class InstanceVariablestatus - the status to set
protected void doSetValue(org.opcfoundation.ua.builtintypes.DataValue value)
throws StatusException
InstanceVariable
doSetValue in class InstanceVariableStatusException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||