|
||||||||||
| 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
public abstract class ServerNode
An abstract base class for all server side nodes. Sub classes are divided in two categories, BaseNode and the ones inherited from it, which keep all the relevant node attributes in memory and other types, which try to optimize the memory consumption, for example to enable a more light weight implementation.
| Field Summary | |
|---|---|
protected List<EventListener> |
eventListeners
|
protected static org.opcfoundation.ua.builtintypes.DateTime |
INITIALIZATION_TIME
|
protected NodeManagerUaNode |
nodeManager
|
protected static Map<Class<? extends UaNode>,List<org.opcfoundation.ua.builtintypes.UnsignedInteger>> |
supportedAttributesMap
|
| Constructor Summary | |
|---|---|
ServerNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId)
|
|
| Method Summary | ||
|---|---|---|
UaReference |
addComponent(UaNode node)
Adds a new component to the Node. |
|
void |
addDataChangeListener(DataChangeListener listener)
Add a listener for the DataChange notification event. |
|
void |
addEventListener(EventListener listener)
|
|
UaReference |
addNewReference(org.opcfoundation.ua.builtintypes.NodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Adds a reference to this node, without checking for duplicates. |
|
UaReference |
addNewReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Adds a reference to this node, without checking for duplicates. |
|
UaReference |
addOrganizes(UaNode target)
This is a convenience method that adds a new Organizes reference from this node to the target node. |
|
void |
addProperties(UaProperty[] properties)
|
|
UaReference |
addProperty(UaProperty property)
Add a new property node to the node. |
|
UaReference |
addReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Convenience method for UaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId
instead of NodeId. |
|
UaReference |
addReference(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Adds a new reference of the specified type to the specified node. |
|
UaReference |
addReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.ExpandedNodeId referenceTypeId,
boolean isInverse)
Convenience method for addReference(UaNode, NodeId, boolean) |
|
UaReference |
addReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Add a reference to the node. |
|
UaReference |
addReference(UaNode targetNode,
UaReferenceType referenceType,
boolean isInverse)
|
|
protected UaReference |
addReference(UaReference reference)
|
|
protected void |
afterAddReference(UaReference reference)
|
|
protected void |
afterDeleteReference(UaReference reference)
|
|
protected boolean |
beforeAddReference(UaReference reference)
|
|
protected void |
dataChange(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue value)
Notify a change in attribute value. |
|
UaReference |
deleteReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node. |
|
UaReference |
deleteReference(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node. |
|
UaReference |
deleteReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node. |
|
UaReference |
deleteReference(UaReference reference)
Delete a reference from the node. |
|
void |
deleteReferences(org.opcfoundation.ua.builtintypes.NodeId targetId)
Delete all references to a target node. |
|
protected boolean |
doAddProperty(UaProperty targetNode)
|
|
protected UaReference |
doDeleteReference(UaReference reference)
|
|
boolean |
equals(Object obj)
|
|
protected
|
findPlaceholders(Class<T> clazz,
org.opcfoundation.ua.builtintypes.ExpandedNodeId placeholderId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId referenceTypeId)
Searches UaNodes that match given Placeholder ModellingRule node. |
|
protected void |
fireDataChange(org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue value)
Fire the DataChange notification event. |
|
protected void |
fireEvent(EventData eventData,
List<ServerNode> sentNodes)
Fire an Event notification event. |
|
protected void |
fireEventInParents(EventData eventData,
List<ServerNode> sentNodes,
org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
Calls fireEvent for all specified parent nodes, i.e. nodes that are connected via an inverse reference of the specified referenceTypes |
|
NodeManagerTable |
getAddressSpace()
Returns the (@link UaAddressSpace) of the (@link UaNode). |
|
protected org.opcfoundation.ua.builtintypes.QualifiedName |
getDefaultBrowseName(org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name)
Define the default browseName to create using the name and nodeId. |
|
org.opcfoundation.ua.builtintypes.NodeId |
getNodeId()
Nodes are unambiguously identified using a constructed identifier called the NodeId. |
|
NodeManagerUaNode |
getNodeManager()
|
|
UaReference |
getReference(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Finds the first reference of the specified reference type. |
|
protected Collection<UaReference> |
getReferenceList()
Returns all references the node has. |
|
UaReference[] |
getReferences(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
Finds all references of the specified reference type. |
|
org.opcfoundation.ua.builtintypes.UnsignedInteger[] |
getSupportedAttributes()
|
|
protected List<UaNode> |
getTargetNodes(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
|
|
int |
hashCode()
|
|
protected UaReference |
hasReference(UaReference reference)
|
|
protected void |
initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
|
|
static boolean |
isAddNotifierReferencesToServerObject()
|
|
protected boolean |
isFalseOrNull(Boolean value)
|
|
boolean |
isMandatory()
Has this node been defined as mandatory in the type hierarchy? |
|
protected boolean |
isMonitoredForEvents(UaObject event)
|
|
protected boolean |
isTrueOrNull(Boolean value)
|
|
protected boolean |
isType()
|
|
protected boolean |
referenceTypeInherits(org.opcfoundation.ua.builtintypes.NodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
Checks if the given reference type inherits from any of the defined types. |
|
UaNode |
removeComponent(UaNode component)
Remove a component reference from the node. |
|
void |
removeDataChangeListener(DataChangeListener listener)
Add a listener for the DataChange notification event. |
|
void |
removeEventListener(EventListener eventListener)
|
|
static void |
setAddNotifierReferencesToServerObject(boolean addNotifierReferencesToServerObject)
Define whether HasNotifier references should be added from all "top-level notifier (and event source)" instances to the Server object. |
|
void |
setReferences(UaReference[] references)
Set all references of the node at one call. |
|
boolean |
supportsAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Check if the node supports the specified attribute. |
|
String |
toString()
|
|
protected org.opcfoundation.ua.builtintypes.NodeId[] |
translateBrowsePathToNodeIds(org.opcfoundation.ua.builtintypes.NodeId startingNode,
org.opcfoundation.ua.builtintypes.QualifiedName... path)
|
|
protected void |
validateHasEventSourceChain(Set<org.opcfoundation.ua.builtintypes.NodeId> chain)
Parameterless method that is called recursively |
|
protected void |
validateHasEventSourceChain(UaReference sReference)
Validates the HasEventSource chain all the way up to the Server Object, assuming that this is called in the sReference's target node |
|
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.nodes.AbstractUaNode |
|---|
getForwardReferences, getInverseReferences, getReferences, getReferences, getReferencesAsList, referenceTypeInherits |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.prosysopc.ua.nodes.UaNode |
|---|
getAttributes, getBrowseName, getComponent, getComponents, getDescription, getDisplayName, getMethod, getNodeClass, getNodeVersion, getProperties, getProperty, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeProperty, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setUserWriteMask, setWriteMask, writeAttribute |
| Field Detail |
|---|
protected static final org.opcfoundation.ua.builtintypes.DateTime INITIALIZATION_TIME
protected static final Map<Class<? extends UaNode>,List<org.opcfoundation.ua.builtintypes.UnsignedInteger>> supportedAttributesMap
protected List<EventListener> eventListeners
protected final NodeManagerUaNode nodeManager
| Constructor Detail |
|---|
public ServerNode(NodeManagerUaNode nodeManager,
org.opcfoundation.ua.builtintypes.NodeId nodeId)
nodeManager - nodeId - | Method Detail |
|---|
public static boolean isAddNotifierReferencesToServerObject()
public static void setAddNotifierReferencesToServerObject(boolean addNotifierReferencesToServerObject)
addNotifierReferencesToServerObject - if true, new references will be added automatically.
If false, not. Default is true.public UaReference addComponent(UaNode node)
node - the component node
IllegalArgumentException - if the node is not of the correct class (see above)UaNode.addReference(UaNode, NodeId, boolean)public void addDataChangeListener(DataChangeListener listener)
listener - public void addEventListener(EventListener listener)
listener -
public UaReference addNewReference(org.opcfoundation.ua.builtintypes.NodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
addReference(NodeId, NodeId, boolean) instead of this method as that
method does check for duplicates, however if you are sure the reference does not already exist
calling this method is faster.
public UaReference addNewReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
addReference(UaNode, NodeId, boolean) instead of this method as that
method does check for duplicates, however if you are sure the reference does not already exist
calling this method is faster.
public UaReference addOrganizes(UaNode target)
node - the target of Organizes reference
addReference(UaNode, NodeId, boolean)public void addProperties(UaProperty[] properties)
properties - public UaReference addProperty(UaProperty property)
UaNodeAdds a new forward HasProperty reference with target to the property node.
property - the property to add to the node
public UaReference addReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
UaNodeUaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId
instead of NodeId.
nodeId - The target nodereferenceTypeId - The reference typeisInverse - Whether the reference is an inverse reference (or forward, if isInverse=false)
public UaReference addReference(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
UaNode
nodeId - The target node of the referencereferenceTypeId - The reference typeisInverse - Whether the reference is an inverse reference (or forward, if isInverse=false)
public UaReference addReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.ExpandedNodeId referenceTypeId,
boolean isInverse)
addReference(UaNode, NodeId, boolean)
targetNode - reference Node to be addedreferenceTypeId - type of reference to be addedisInverse - true if target node should be a source
IllegalArgumentException - if the referenceTypeId cannot be converted to NodeId
public UaReference addReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
UaNode
targetNode - The target node where the reference points to.referenceTypeId - The type of reference.isInverse - Whether the reference is an inverse reference.
public UaReference addReference(UaNode targetNode,
UaReferenceType referenceType,
boolean isInverse)
public UaReference deleteReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
UaNode
targetNodeId - The target node of the reference.referenceTypeId - The exact type of reference.isInverse - Whether to remove a forward reference. If false, deletes an inverse reference
only.
public UaReference deleteReference(org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
UaNode
nodeId - The target node of the reference.referenceTypeId - The exact type of reference.isInverse - Whether to remove a forward reference. If false, deletes an inverse reference
only.
public UaReference deleteReference(UaNode targetNode,
org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
UaNode
targetNode - The target node of the reference.referenceTypeId - The exact type of reference.isInverse - Whether to remove a forward reference. If false, deletes an inverse reference
only.public UaReference deleteReference(UaReference reference)
UaNode
reference - The reference to delete.public void deleteReferences(org.opcfoundation.ua.builtintypes.NodeId targetId)
targetId - NodeId of the target node to which the references should be removed.public boolean equals(Object obj)
equals in class Objectpublic NodeManagerTable getAddressSpace()
public org.opcfoundation.ua.builtintypes.NodeId getNodeId()
UaNode
public NodeManagerUaNode getNodeManager()
public UaReference getReference(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
referenceTypeId - the reference type to search (or null to accept any)isInverse - To search for inverse reference, instead of non-inverse (applied also if null
referenceType is defined)
public UaReference[] getReferences(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
boolean isInverse)
referenceTypeId - the reference type to search (or null to accept any)isInverse - To search for inverse reference, instead of non-inverse (applied also if null
referenceType is defined)
public org.opcfoundation.ua.builtintypes.UnsignedInteger[] getSupportedAttributes()
public int hashCode()
hashCode in class Objectpublic boolean isMandatory()
public UaNode removeComponent(UaNode component)
UaNodeThis is a shortcut for
deleteReference(component, Identifiers.HasComponent, false);
Note that the method does not remove the component - it only removes the reference to it.
component - the component node to removeUaNode.deleteReference(UaNode, NodeId, boolean)public void removeDataChangeListener(DataChangeListener listener)
listener - public void removeEventListener(EventListener eventListener)
eventListener - public void setReferences(UaReference[] references)
UaNode
Use UaNode.addReference(org.opcfoundation.ua.builtintypes.ExpandedNodeId, org.opcfoundation.ua.builtintypes.NodeId, boolean) to add new references to the node.
references - the references to setUaNode.getReferences(),
UaNode.getReference(NodeId, boolean)public boolean supportsAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
UaNode
Use the method to check if the node object you have is actually supporting a specific UA
Attribute. The supported attributes are available from specific Java properties, and the values
can also be read with UaNode.readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger).
attributeId - the attribute to check - the valid values are defined in
Attributes
public String toString()
toString in class Objectprotected final UaReference addReference(UaReference reference)
protected void afterAddReference(UaReference reference)
reference - protected void afterDeleteReference(UaReference reference)
reference - protected boolean beforeAddReference(UaReference reference)
reference -
protected void dataChange(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue value)
protected boolean doAddProperty(UaProperty targetNode)
targetNode -
protected UaReference doDeleteReference(UaReference reference)
reference -
protected <T extends UaNode> List<T> findPlaceholders(Class<T> clazz,
org.opcfoundation.ua.builtintypes.ExpandedNodeId placeholderId,
org.opcfoundation.ua.builtintypes.ExpandedNodeId referenceTypeId)
clazz - placeholderId - referenceTypeId -
protected void fireDataChange(org.opcfoundation.ua.builtintypes.DataValue prevValue,
org.opcfoundation.ua.builtintypes.DataValue value)
prevValue - value -
protected void fireEvent(EventData eventData,
List<ServerNode> sentNodes)
Sends the event to all EventListeners and calls fireEventInParents for HasEventSource, HasNotifier and HasCondition references.
eventData - sentNodes -
protected final void fireEventInParents(EventData eventData,
List<ServerNode> sentNodes,
org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
eventData - referenceTypeIds -
protected org.opcfoundation.ua.builtintypes.QualifiedName getDefaultBrowseName(org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name)
nodeId - the nodeId to use. If null s given, namespaceIndex 0 is usedname - the name part of the browsename
protected Collection<UaReference> getReferenceList()
AbstractUaNode
getReferenceList in class AbstractUaNodeprotected List<UaNode> getTargetNodes(org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
protected UaReference hasReference(UaReference reference)
reference - protected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
protected boolean isFalseOrNull(Boolean value)
value -
protected boolean isMonitoredForEvents(UaObject event)
protected boolean isTrueOrNull(Boolean value)
value -
protected final boolean isType()
protected boolean referenceTypeInherits(org.opcfoundation.ua.builtintypes.NodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
AbstractUaNode
referenceTypeInherits in class AbstractUaNodetypeId - referenceTypeIds -
protected org.opcfoundation.ua.builtintypes.NodeId[] translateBrowsePathToNodeIds(org.opcfoundation.ua.builtintypes.NodeId startingNode,
org.opcfoundation.ua.builtintypes.QualifiedName... path)
protected void validateHasEventSourceChain(Set<org.opcfoundation.ua.builtintypes.NodeId> chain)
protected void validateHasEventSourceChain(UaReference sReference)
sReference -
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
StatusException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||