com.prosysopc.ua.server.nodes
Class ReflectiveInstanceVariable

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.InstanceVariable
              extended by com.prosysopc.ua.server.nodes.CallbackInstanceVariable
                  extended by com.prosysopc.ua.server.nodes.ReflectiveInstanceVariable
All Implemented Interfaces:
UaInstance, UaNode, UaValueNode, UaVariable
Direct Known Subclasses:
ReflectiveInstanceProperty

public class ReflectiveInstanceVariable
extends CallbackInstanceVariable

An InstanceVariable, which is wrapping a property of a Java object, via reflection, to be exposed as an OPC UA Variable.


Field Summary
 
Fields inherited from class com.prosysopc.ua.server.nodes.CallbackInstanceVariable
callback
 
Fields inherited from class com.prosysopc.ua.server.nodes.ServerNode
eventListeners, INITIALIZATION_TIME, nodeManager, supportedAttributesMap
 
Constructor Summary
ReflectiveInstanceVariable(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, Object source, String propertyName, org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
          Create a new node, referring to an instance declaration node.
ReflectiveInstanceVariable(NodeManagerUaNode nodeManager, org.opcfoundation.ua.builtintypes.NodeId nodeId, Object source, String propertyName, UaVariable instanceDeclaration)
          Create a new node, referring to an instance declaration node.
 
Method Summary
 void exposeStructureWithReflectiveVariables(org.opcfoundation.ua.builtintypes.Structure internalStructure, int nameSpaceIndex, org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
           
 UaType getDataType()
           
 
Methods inherited from class com.prosysopc.ua.server.nodes.CallbackInstanceVariable
doSetValue, getCallback, getValue, setCallback
 
Methods inherited from class com.prosysopc.ua.server.nodes.InstanceVariable
addReference, beforeAddReference, deleteReference, getAccessLevel, getArrayDimensions, getAttributes, getBrowseName, getComponent, getComponents, getDataTypeId, getDescription, getDisplayName, getHistorizing, getMethod, getMinimumSamplingInterval, getNodeClass, getNodeVersion, getProperties, getProperty, getPropertyTypeNode, getReference, getReferencesAsList, getStatus, getTypeDefinition, getTypeDefinitionId, getTypeDefinitionReference, getUserAccessLevel, getUserWriteMask, getValueRank, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeComponent, removeProperty, setAccessLevel, setArrayDimensions, setAttribute, setAttributes, setBrowseName, setDataType, setDataTypeId, setDescription, setDisplayName, setHistorizing, setMinimumSamplingInterval, setReferences, setStatus, setTypeDefinition, setTypeDefinitionId, setTypeDefinitionId, setUserAccessLevel, setUserWriteMask, setValue, setValue, setValueRank, 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, afterAddReference, afterDeleteReference, dataChange, deleteReference, deleteReference, deleteReference, deleteReferences, doAddProperty, doDeleteReference, equals, findPlaceholders, fireDataChange, fireEvent, fireEventInParents, getAddressSpace, getDefaultBrowseName, getNodeId, getNodeManager, getReferenceList, getReferences, getSupportedAttributes, getTargetNodes, hashCode, hasReference, initSupportedAttributes, isAddNotifierReferencesToServerObject, isFalseOrNull, isMandatory, isMonitoredForEvents, isTrueOrNull, isType, referenceTypeInherits, removeDataChangeListener, removeEventListener, setAddNotifierReferencesToServerObject, supportsAttribute, toString, translateBrowsePathToNodeIds, validateHasEventSourceChain, validateHasEventSourceChain, writeAttributeValue
 
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

ReflectiveInstanceVariable

public ReflectiveInstanceVariable(NodeManagerUaNode nodeManager,
                                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                  Object source,
                                  String propertyName,
                                  org.opcfoundation.ua.builtintypes.NodeId instanceDeclarationId)
                           throws SecurityException,
                                  NoSuchMethodException,
                                  StatusException
Create a new node, referring to an instance declaration node.

Parameters:
nodeManager - The node manager to which the node is created.
nodeId - The ID of the new node.
source - the node, whose property is wrapped using reflection
propertyName - the name of the wrapped property - parent must have a getPropertyName and optionally also a setPropertyName method. The propertyName is used as the BrowseName and DisplayName of the property 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.
Throws:
StatusException - if instanceDeclarationId cannot be converted to a variable node
NoSuchMethodException - if the getter for the defined property does not exist
SecurityException - if the getter for the defined property cannot be accessed

ReflectiveInstanceVariable

public ReflectiveInstanceVariable(NodeManagerUaNode nodeManager,
                                  org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                  Object source,
                                  String propertyName,
                                  UaVariable instanceDeclaration)
                           throws NoSuchMethodException
Create a new node, referring to an instance declaration node.

Parameters:
nodeManager - The node manager to which the node is created.
nodeId - The ID of the new node.
source - the node, whose property is wrapped using reflection
propertyName - the name of the wrapped property - parent must have a getPropertyName and optionally also a setPropertyName method. The propertyName is used as the BrowseName and DisplayName of the property 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.
Throws:
NoSuchMethodException - if the getter for the defined property does not exist
SecurityException - if the getter for the defined property cannot be accessed
Method Detail

exposeStructureWithReflectiveVariables

public void exposeStructureWithReflectiveVariables(org.opcfoundation.ua.builtintypes.Structure internalStructure,
                                                   int nameSpaceIndex,
                                                   org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId)
Parameters:
internalStructure -
nameSpaceIndex -
typeDefinitionId -

getDataType

public UaType getDataType()
Specified by:
getDataType in interface UaValueNode
Overrides:
getDataType in class InstanceVariable
Returns:
the DataType node, if set.
See Also:
UaValueNode.getDataTypeId()


Copyright © 2018. All rights reserved.