com.prosysopc.ua.server.nodes
Class UaObjectNode

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.UaObjectNode
All Implemented Interfaces:
UaInstance, UaNode, UaObject, UaCallable
Direct Known Subclasses:
AbstractGeneratedObjectNode

public class UaObjectNode
extends UaInstanceNode
implements UaObject, UaCallable

Straight forward implementation of UaObject.

It keeps all attributes in memory.


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
UaObjectNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.builtintypes.LocalizedText displayName)
          Create a new object node
UaObjectNode(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, String name, Locale locale)
          Create a new object node with name.
 
Method Summary
 void addCallListener(CallableListener listener)
           
 Object[] callMethod(org.opcfoundation.ua.builtintypes.NodeId methodId, Object... inputArgs)
          Call a method on the object.
 org.opcfoundation.ua.builtintypes.Variant[] callMethod(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId methodId, org.opcfoundation.ua.builtintypes.Variant[] inputArguments, org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos)
          Fallback implementation when no subtype handles the method call.
protected  void deleteIfNodeExists(org.opcfoundation.ua.builtintypes.NodeId nodeID)
           
 org.opcfoundation.ua.core.NodeAttributes getAttributes()
           
protected  org.opcfoundation.ua.core.NodeAttributes getAttributes(org.opcfoundation.ua.core.ObjectAttributes attributes)
           
protected  org.opcfoundation.ua.builtintypes.ExpandedNodeId getDefaultTypeDefinition()
           
 EnumSet<EventNotifierClass> getEventNotifier()
          Defines whether the node can be used to subscribe to events.
 UaProperty getIcon()
          The Icon Property provides an image that can be used by clients when displaying the Node.
 org.opcfoundation.ua.core.NodeClass getNodeClass()
          The NodeClass Attribute identifies the NodeClass of a Node.
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.
 void removeCallListener(CallableListener listener)
           
 void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
           
 void setEventNotifier(EnumSet<EventNotifierClass> eventNotifier)
          Define which kind of events the object generates.
 void setIcon(UaProperty icon)
          Set the value of the Icon property.
 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)
           
 
Methods inherited from class com.prosysopc.ua.server.nodes.UaInstanceNode
addModellingRule, beforeAddReference, getTypeDefinition, getTypeDefinitionId, hasTypeDefinition, registerOverridePlainMethod, setTypeDefinition, setTypeDefinitionId, 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, getProperties, getProperty, getPropertyValue, getReferencesAsList, getStandardBrowseName, getStandardDisplayText, getUserWriteMask, getWriteMask, hasProperty, hasReference, hasUserWriteAccess, hasWriteAccess, 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, addProperty, 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.UaInstance
getTypeDefinition, getTypeDefinitionId, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId
 
Methods inherited from interface com.prosysopc.ua.nodes.UaNode
addComponent, addProperty, addReference, addReference, addReference, deleteReference, deleteReference, deleteReference, deleteReference, getAddressSpace, getBrowseName, getComponent, getComponents, getDescription, getDisplayName, getForwardReferences, getInverseReferences, getMethod, getNodeId, getNodeVersion, getProperties, getProperty, getReference, getReferences, getReferences, getSupportedAttributes, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeComponent, removeProperty, setAttribute, setBrowseName, setDescription, setDisplayName, setReferences, setUserWriteMask, setWriteMask, supportsAttribute, writeAttribute
 

Constructor Detail

UaObjectNode

public UaObjectNode(NodeManagerUaNode nodeManager,
                    org.opcfoundation.ua.builtintypes.NodeId nodeId,
                    org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                    org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a new object node

Parameters:
nodeId - The node identifier
browseName - The BrowseName of the node
displayName - The DisplayName of the node

UaObjectNode

public UaObjectNode(NodeManagerUaNode nodeManager,
                    org.opcfoundation.ua.builtintypes.NodeId nodeId,
                    String name,
                    Locale locale)
Create a new object node with name.

Parameters:
nodeId - The node identifier
name - The browse and display name of the object. The NamespaceIndex of the nodeId is also used for the BrowseName.
locale - The locale of the name, used for the DisplayName
Method Detail

addCallListener

public void addCallListener(CallableListener listener)
Specified by:
addCallListener in interface UaCallable

callMethod

public Object[] callMethod(org.opcfoundation.ua.builtintypes.NodeId methodId,
                           Object... inputArgs)
                    throws StatusException
Call a method on the object.

Specified by:
callMethod in interface UaObject
Parameters:
methodId - id of the method
inputArgs - input arguments for the method call
Returns:
output arguments for the method call
Throws:
StatusException - if the call fails due to invalid arguments or something like that.

callMethod

public org.opcfoundation.ua.builtintypes.Variant[] callMethod(ServiceContext serviceContext,
                                                              org.opcfoundation.ua.builtintypes.NodeId methodId,
                                                              org.opcfoundation.ua.builtintypes.Variant[] inputArguments,
                                                              org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults,
                                                              org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos)
                                                       throws StatusException
Fallback implementation when no subtype handles the method call.

Specified by:
callMethod in interface UaCallable
Returns:
Throws:
StatusException

getAttributes

public org.opcfoundation.ua.core.NodeAttributes getAttributes()
Specified by:
getAttributes in interface UaNode
Specified by:
getAttributes in class BaseNode
Returns:
the current attribute values of the node in a NodeAttributes structure.

getEventNotifier

public EnumSet<EventNotifierClass> getEventNotifier()
Description copied from interface: UaObject
Defines whether the node can be used to subscribe to events. The set can contain one or several of the following values.
Value Description
SubscribeToEvents Indicates if it can be used to subscribe to Events (0 means cannot be used to subscribe to Events, 1 means can be used to subscribe to Events).
HistoryRead Indicates if the history of the Events is readable (0 means not readable, 1 means readable).
HistoryWrite Indicates if the history of the Events is writable (0 means not writable, 1 means writable).
HistoryRead and HistoryWrite also indicate if the history of the Events is available via the OPC UA server.

Specified by:
getEventNotifier in interface UaObject
Returns:
the current value of the EventNotifier attribute

getIcon

public UaProperty getIcon()
Description copied from interface: UaObject
The Icon Property provides an image that can be used by clients when displaying the Node.

Specified by:
getIcon in interface UaObject
Returns:
the Icon property. This is an optional property, so it may be null, if the property is not defined.

getNodeClass

public final org.opcfoundation.ua.core.NodeClass getNodeClass()
Description copied from interface: UaNode
The NodeClass Attribute identifies the NodeClass of a Node.

Specified by:
getNodeClass in interface UaNode
Overrides:
getNodeClass in class BaseNode
Returns:
the Node Class of the node. This is hard-coded and cannot be changed.

removeCallListener

public void removeCallListener(CallableListener listener)
Specified by:
removeCallListener in interface UaCallable

setAttributes

public void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
Specified by:
setAttributes in interface UaNode
Overrides:
setAttributes in class BaseNode

setEventNotifier

public void setEventNotifier(EnumSet<EventNotifierClass> eventNotifier)
Description copied from interface: UaObject
Define which kind of events the object generates.

Specified by:
setEventNotifier in interface UaObject
Parameters:
eventNotifier - the set of event types that the object generates

setIcon

public void setIcon(UaProperty icon)
             throws StatusException
Description copied from interface: UaObject
Set the value of the Icon property. If the property already exists, the value is copied from the parameter.

Specified by:
setIcon in interface UaObject
Parameters:
icon - the Icon to set
Throws:
StatusException
See Also:
UaObject.getIcon()

toString

public String toString()
Overrides:
toString in class UaInstanceNode

deleteIfNodeExists

protected void deleteIfNodeExists(org.opcfoundation.ua.builtintypes.NodeId nodeID)

getAttributes

protected org.opcfoundation.ua.core.NodeAttributes getAttributes(org.opcfoundation.ua.core.ObjectAttributes attributes)

getDefaultTypeDefinition

protected org.opcfoundation.ua.builtintypes.ExpandedNodeId getDefaultTypeDefinition()
Specified by:
getDefaultTypeDefinition in class UaInstanceNode
Returns:

initSupportedAttributes

protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
Overrides:
initSupportedAttributes in class ServerNode

readAttributeValue

protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                  org.opcfoundation.ua.builtintypes.DataValue dataValue)
                           throws StatusException
Description copied from class: BaseNode
Read the value of an attribute.

Overrides:
readAttributeValue in class BaseNode
Parameters:
attributeId - the ID of the attribute to read.
dataValue - the DataValue structure in which the value is set.
Throws:
StatusException

writeAttributeValue

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
Overrides:
writeAttributeValue in class BaseNode
Throws:
StatusException


Copyright © 2018. All rights reserved.