public abstract class ServerNode extends AbstractUaNode
UaNode.Parameters| Modifier and Type | Field and Description |
|---|---|
protected List<EventListener> |
eventListeners |
protected static DateTime |
INITIALIZATION_TIME |
protected NodeManagerUaNode |
nodeManager |
protected static Map<Class<? extends UaNode>,List<UnsignedInteger>> |
supportedAttributesMap |
| Modifier | Constructor and Description |
|---|---|
|
ServerNode(NodeManagerUaNode nodeManager,
NodeId nodeId) |
protected |
ServerNode(UaNode.Parameters parameters) |
| Modifier and Type | Method and Description |
|---|---|
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(NodeId targetNodeId,
NodeId referenceTypeId,
boolean isInverse)
Adds a reference to this node, without checking for duplicates.
|
UaReference |
addNewReference(UaNode targetNode,
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(ExpandedNodeId nodeId,
NodeId referenceTypeId,
boolean isInverse)
Convenience method for
UaNode.addReference(NodeId, NodeId, boolean) that uses ExpandedNodeId
instead of NodeId. |
UaReference |
addReference(NodeId nodeId,
NodeId referenceTypeId,
boolean isInverse)
Adds a new reference of the specified type to the specified node.
|
UaReference |
addReference(UaNode targetNode,
ExpandedNodeId referenceTypeId,
boolean isInverse)
Convenience method for
addReference(UaNode, NodeId, boolean) |
UaReference |
addReference(UaNode targetNode,
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(UnsignedInteger attributeId,
DataValue prevValue,
DataValue value)
Notify a change in attribute value.
|
UaReference |
deleteReference(ExpandedNodeId targetNodeId,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(NodeId nodeId,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(UaNode targetNode,
NodeId referenceTypeId,
boolean isInverse)
Delete a reference from the node.
|
UaReference |
deleteReference(UaReference reference)
Delete a reference from the node.
|
void |
deleteReferences(NodeId targetId)
Delete all references to a target node.
|
protected boolean |
doAddProperty(UaProperty targetNode) |
protected UaReference |
doDeleteReference(UaReference reference) |
boolean |
equals(Object obj) |
protected <T extends UaNode> |
findPlaceholders(Class<T> clazz,
ExpandedNodeId placeholderId,
ExpandedNodeId referenceTypeId)
Searches UaNodes that match given Placeholder ModellingRule node.
|
protected void |
fireDataChange(DataValue prevValue,
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,
NodeId... referenceTypeIds)
Calls fireEvent for all specified parent nodes, i.e.
|
NodeManagerTable |
getAddressSpace()
Returns the (@link UaAddressSpace) of the (@link UaNode).
|
protected QualifiedName |
getDefaultBrowseName(NodeId nodeId,
String name)
Define the default browseName to create using the name and nodeId.
|
NodeId |
getNodeId()
Nodes are unambiguously identified using a constructed identifier called the NodeId.
|
NodeManagerUaNode |
getNodeManager() |
UaNodeSetExtensions |
getNodeSetExtensions() |
UaReference |
getReference(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(NodeId referenceTypeId,
boolean isInverse)
Finds all references of the specified reference type.
|
UnsignedInteger[] |
getSupportedAttributes()
Returns the list of attributes supported by this node class.
|
protected List<UaNode> |
getTargetNodes(NodeId referenceTypeId) |
UaNodeId |
getUaNodeId()
Returns
UaNode.getNodeId() as UaNodeId (which has the NamespaceUri instead of
NamespaceIndex). |
int |
hashCode() |
protected UaReference |
hasReference(UaReference reference) |
protected void |
initSupportedAttributes(List<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(NodeId typeId,
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 |
setNodeSetExtensions(UaNodeSetExtensions extensions) |
void |
setReferences(UaReference[] references)
Set all references of the node at one call.
|
boolean |
supportsAttribute(UnsignedInteger attributeId)
Check if the node supports the specified attribute.
|
String |
toString() |
protected NodeId[] |
translateBrowsePathToNodeIds(NodeId startingNode,
QualifiedName... path) |
protected void |
validateHasEventSourceChain(Set<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(UnsignedInteger attributeId,
Object value,
StatusCode statusCode,
DateTime sourceTime,
UnsignedShort sourcePicoseconds) |
getForwardReferences, getInverseReferences, getReferences, getReferences, getReferencesAsList, getUserData, referenceTypeInherits, setUserDataclone, finalize, getClass, notify, notifyAll, wait, wait, waitaddReference, addReference, addReference, getAttributes, getAttributesMap, getBrowseName, getBrowsePaths, getComponent, getComponents, getDescription, getDisplayName, getMethod, getNodeClass, getNodeVersionNode, getOrganizedNode, getOrganizedNodes, getProperties, getProperty, getUaBrowsePaths, getUserWriteMask, getWriteMask, hasUserWriteAccess, hasWriteAccess, readAttribute, readAttribute, removeProperty, setAttribute, setAttributes, setBrowseName, setDescription, setDisplayName, setUserWriteMask, setWriteMask, writeAttributeprotected static final DateTime INITIALIZATION_TIME
protected static final Map<Class<? extends UaNode>,List<UnsignedInteger>> supportedAttributesMap
protected List<EventListener> eventListeners
protected final NodeManagerUaNode nodeManager
public ServerNode(NodeManagerUaNode nodeManager, NodeId nodeId)
nodeManager - nodeId - protected ServerNode(UaNode.Parameters parameters)
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 nodeIllegalArgumentException - 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(NodeId targetNodeId, 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, 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 referenceaddReference(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 nodepublic UaReference addReference(ExpandedNodeId nodeId, 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(NodeId nodeId, NodeId referenceTypeId, boolean isInverse)
UaNodenodeId - 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, 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 sourceIllegalArgumentException - if the referenceTypeId cannot be converted to NodeIdpublic UaReference addReference(UaNode targetNode, NodeId referenceTypeId, boolean isInverse)
UaNodetargetNode - 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(ExpandedNodeId targetNodeId, NodeId referenceTypeId, boolean isInverse)
UaNodetargetNodeId - 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(NodeId nodeId, NodeId referenceTypeId, boolean isInverse)
UaNodenodeId - 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, NodeId referenceTypeId, boolean isInverse)
UaNodetargetNode - 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)
UaNodereference - The reference to delete.public void deleteReferences(NodeId targetId)
targetId - NodeId of the target node to which the references should be removed.public NodeManagerTable getAddressSpace()
public NodeId getNodeId()
UaNodepublic NodeManagerUaNode getNodeManager()
public UaNodeSetExtensions getNodeSetExtensions()
public UaReference getReference(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(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 UnsignedInteger[] getSupportedAttributes()
UaNodepublic UaNodeId getUaNodeId()
UaNodeUaNode.getNodeId() as UaNodeId (which has the NamespaceUri instead of
NamespaceIndex).public 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 setNodeSetExtensions(UaNodeSetExtensions extensions)
public void setReferences(UaReference[] references)
UaNode
Use UaNode.addReference(com.prosysopc.ua.stack.builtintypes.ExpandedNodeId, com.prosysopc.ua.stack.builtintypes.NodeId) to add new references to the node.
references - the references to setUaNode.getReferences(),
UaNode.getReference(NodeId, boolean)public boolean supportsAttribute(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(com.prosysopc.ua.stack.builtintypes.UnsignedInteger).
attributeId - the attribute to check - the valid values are defined in
Attributesprotected 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(UnsignedInteger attributeId, DataValue prevValue, DataValue value)
protected boolean doAddProperty(UaProperty targetNode)
targetNode - protected UaReference doDeleteReference(UaReference reference)
reference - protected <T extends UaNode> List<T> findPlaceholders(Class<T> clazz, ExpandedNodeId placeholderId, ExpandedNodeId referenceTypeId)
clazz - placeholderId - referenceTypeId - protected void fireDataChange(DataValue prevValue, 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, NodeId... referenceTypeIds)
eventData - referenceTypeIds - protected QualifiedName getDefaultBrowseName(NodeId nodeId, String name)
nodeId - the nodeId to use. If null s given, namespaceIndex 0 is usedname - the name part of the browsenameprotected Collection<UaReference> getReferenceList()
AbstractUaNodegetReferenceList in class AbstractUaNodeprotected UaReference hasReference(UaReference reference)
reference - protected void initSupportedAttributes(List<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(NodeId typeId, NodeId... referenceTypeIds)
AbstractUaNodereferenceTypeInherits in class AbstractUaNodetypeId - referenceTypeIds - protected NodeId[] translateBrowsePathToNodeIds(NodeId startingNode, QualifiedName... path)
protected void validateHasEventSourceChain(Set<NodeId> chain)
protected void validateHasEventSourceChain(UaReference sReference)
sReference - protected void writeAttributeValue(UnsignedInteger attributeId, Object value, StatusCode statusCode, DateTime sourceTime, UnsignedShort sourcePicoseconds) throws StatusException
StatusExceptionCopyright © 2026. All rights reserved.