|
||||||||||
| 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.client.nodes.UaNodeImpl
public abstract class UaNodeImpl
Straight forward implementation of UaNode.
It keeps all attributes in memory.
This is an abstract class, as the UA specification does not enable nodes of the generic class. The nodes must be one of the actual types for the specific node classes.
| Field Summary | |
|---|---|
protected AddressSpace |
addressSpace
|
protected static org.slf4j.Logger |
logger
|
protected Set<UaReference> |
references
|
protected static Map<Class<? extends UaNode>,List<org.opcfoundation.ua.builtintypes.UnsignedInteger>> |
supportedAttributesMap
|
| Constructor Summary | |
|---|---|
UaNodeImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
Create a new node. |
|
UaNodeImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
org.opcfoundation.ua.builtintypes.LocalizedText description,
EnumSet<WriteAccess> writeMask,
EnumSet<WriteAccess> userWriteMask,
UaClientReference[] references,
UaProperty[] properties)
|
|
UaNodeImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale)
|
|
| Method Summary | ||
|---|---|---|
UaReference |
addComponent(UaNode node)
Adds a new component to the 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.NodeId referenceTypeId,
boolean isInverse)
Add a reference to the node. |
|
protected UaReference |
addReference(UaReference reference)
|
|
protected void |
afterAddReference(UaReference reference)
|
|
protected void |
afterDeleteReference(UaReference reference)
|
|
protected void |
assertTypeSupport(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
|
|
protected void |
assertTypeSupport(org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
|
|
protected boolean |
beforeAddReference(UaReference reference)
|
|
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 property)
|
|
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. |
|
AddressSpace |
getAddressSpace()
The address space in which the node resides. |
|
protected org.opcfoundation.ua.core.NodeAttributes |
getAttributes(org.opcfoundation.ua.core.NodeAttributes attributes)
|
|
org.opcfoundation.ua.builtintypes.QualifiedName |
getBrowseName()
Nodes have a BrowseName Attribute that is used as a non-localised human-readable name when browsing the AddressSpace to create paths out of BrowseNames. |
|
UaNode |
getComponent(org.opcfoundation.ua.builtintypes.QualifiedName componentName)
Get the component, which has the specified name. |
|
UaNode[] |
getComponents()
Get a list of components of this node, i.e. target nodes of all forward HasComponent references. |
|
org.opcfoundation.ua.builtintypes.LocalizedText |
getDescription()
The optional Description Attribute shall explain the meaning of the Node in a localized text using the same mechanisms for localization as described for the DisplayName. |
|
org.opcfoundation.ua.builtintypes.LocalizedText |
getDescription(Locale locale)
|
|
org.opcfoundation.ua.builtintypes.LocalizedText |
getDisplayName()
The DisplayName Attribute contains the localised name of the Node. |
|
org.opcfoundation.ua.builtintypes.LocalizedText |
getDisplayName(Locale locale)
|
|
UaMethod |
getMethod(org.opcfoundation.ua.builtintypes.QualifiedName methodName)
Get the method, which has the specified name. |
|
org.opcfoundation.ua.core.NodeClass |
getNodeClass()
The NodeClass Attribute identifies the NodeClass of a Node. |
|
org.opcfoundation.ua.builtintypes.NodeId |
getNodeId()
Nodes are unambiguously identified using a constructed identifier called the NodeId. |
|
UaProperty |
getNodeVersion()
|
|
String |
getNodeVersionString()
|
|
UaProperty[] |
getProperties()
|
|
UaProperty |
getProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
Get the property with name. |
|
org.opcfoundation.ua.builtintypes.DataValue |
getPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
Get the value of a property. |
|
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()
|
|
EnumSet<WriteAccess> |
getUserWriteMask()
The optional UserWriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node taking user access rights into account. |
|
EnumSet<WriteAccess> |
getWriteMask()
The optional WriteMask Attribute exposes the possibilities of a client to write the Attributes of the Node. |
|
int |
hashCode()
|
|
boolean |
hasProperty(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
|
|
boolean |
hasTypeDefinition()
|
|
boolean |
hasUserWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Checks additional user access rights to the node. |
|
boolean |
hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Check the common access rights of a node attribute. |
|
protected void |
initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
|
|
org.opcfoundation.ua.builtintypes.DataValue |
readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Read the current value of an attribute. |
|
void |
readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue,
Locale locale)
|
|
protected void |
readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
Read the value of an attribute. |
|
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. |
|
UaProperty |
removeProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
Remove the property with the specified name. |
|
void |
setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
Unconditionally, set the value of the specified attribute. |
|
void |
setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
|
|
void |
setBrowseName(org.opcfoundation.ua.builtintypes.QualifiedName browseName)
|
|
void |
setDescription(org.opcfoundation.ua.builtintypes.LocalizedText description)
|
|
void |
setDisplayName(org.opcfoundation.ua.builtintypes.LocalizedText displayName)
|
|
protected void |
setNodeVersion(String nodeVersion)
Set the value of the NodeVersion property. |
|
void |
setPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName,
Object value)
Set the value of a property. |
|
void |
setReferences(UaReference[] references)
Set all references of the node at one call. |
|
void |
setUserWriteMask(EnumSet<WriteAccess> userWriteMask)
|
|
void |
setWriteMask(EnumSet<WriteAccess> writeMask)
|
|
boolean |
supportsAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
Check if the node supports the specified attribute. |
|
String |
toString()
|
|
boolean |
writeAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
Write the attribute value in a 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 |
| Field Detail |
|---|
protected static final org.slf4j.Logger logger
protected static final Map<Class<? extends UaNode>,List<org.opcfoundation.ua.builtintypes.UnsignedInteger>> supportedAttributesMap
protected final AddressSpace addressSpace
protected Set<UaReference> references
| Constructor Detail |
|---|
public UaNodeImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName)
nodeId - browseName - displayName -
public UaNodeImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
org.opcfoundation.ua.builtintypes.QualifiedName browseName,
org.opcfoundation.ua.builtintypes.LocalizedText displayName,
org.opcfoundation.ua.builtintypes.LocalizedText description,
EnumSet<WriteAccess> writeMask,
EnumSet<WriteAccess> userWriteMask,
UaClientReference[] references,
UaProperty[] properties)
public UaNodeImpl(AddressSpace addressSpace,
org.opcfoundation.ua.builtintypes.NodeId nodeId,
String name,
Locale locale)
| Method Detail |
|---|
public UaReference addComponent(UaNode node)
UaNodeDepending on the background implementation, the component node may also get added.
This is a shortcut for
addReference(component, Identifiers.HasComponent, false);
node - the component node
UaNode.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.NodeId referenceTypeId,
boolean isInverse)
UaNode
targetNode - referenceTypeId - 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 AddressSpace getAddressSpace()
The address space is used to provide access to other nodes in the server.
public org.opcfoundation.ua.builtintypes.QualifiedName getBrowseName()
UaNodeA BrowseName should never be used to display the name of a Node. The DisplayName should be used instead for this purpose.
Unlike NodeIds, the BrowseName cannot be used to unambiguously identify a Node. Different Nodes may have the same BrowseName.
AddressSpace.translateBrowsePathsToNodeIds(org.opcfoundation.ua.core.BrowsePath...)public UaNode getComponent(org.opcfoundation.ua.builtintypes.QualifiedName componentName)
UaNode
componentName - the BrowseName of the component to get
public UaNode[] getComponents()
UaNode
public org.opcfoundation.ua.builtintypes.LocalizedText getDescription()
UaNode
public org.opcfoundation.ua.builtintypes.LocalizedText getDescription(Locale locale)
public org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName()
UaNodeThe string part of the DisplayName is restricted to 512 characters.
public org.opcfoundation.ua.builtintypes.LocalizedText getDisplayName(Locale locale)
locale - The desired locale
public UaMethod getMethod(org.opcfoundation.ua.builtintypes.QualifiedName methodName)
UaNode
methodName - the BrowseName (in namespace 0) of the method to get
public org.opcfoundation.ua.core.NodeClass getNodeClass()
UaNode
public org.opcfoundation.ua.builtintypes.NodeId getNodeId()
UaNode
public UaProperty getNodeVersion()
public String getNodeVersionString()
public UaProperty[] getProperties()
public UaProperty getProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
name - the name of the property
public org.opcfoundation.ua.builtintypes.DataValue getPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
throws StatusException
propertyName -
StatusException - If the property value cannot be set
IllegalArgumentException - If the property does not exist
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 EnumSet<WriteAccess> getUserWriteMask()
UaNodeThe UserWriteMask Attribute can only further restrict the WriteMask Attribute, when it is set to not writable in the general case that applies for every user.
public EnumSet<WriteAccess> getWriteMask()
UaNode
public int hashCode()
hashCode in class Objectpublic boolean hasProperty(org.opcfoundation.ua.builtintypes.QualifiedName propertyName)
public boolean hasTypeDefinition()
public boolean hasUserWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
UaNode
attributeId - the attribute to check
public boolean hasWriteAccess(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
UaNode
attributeId - the attribute to check
public org.opcfoundation.ua.builtintypes.DataValue readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId)
attributeId -
UaNode.supportsAttribute(UnsignedInteger)
public final void readAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue,
Locale locale)
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 UaProperty removeProperty(org.opcfoundation.ua.builtintypes.QualifiedName name)
UaNode
name - the name of the property
public void setAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
throws StatusException
attributeId - dataValue -
StatusExceptionpublic void setAttributes(org.opcfoundation.ua.core.NodeAttributes nodeAttributes)
public void setBrowseName(org.opcfoundation.ua.builtintypes.QualifiedName browseName)
browseName - the new BrowseName to setUaNode.getBrowseName()public void setDescription(org.opcfoundation.ua.builtintypes.LocalizedText description)
description - the new description to setUaNode.getDescription()public void setDisplayName(org.opcfoundation.ua.builtintypes.LocalizedText displayName)
displayName - the new DisplayName to setUaNode.getDisplayName()
public void setPropertyValue(org.opcfoundation.ua.builtintypes.QualifiedName propertyName,
Object value)
throws StatusException,
IllegalArgumentException
propertyName - value -
StatusException - If the property value cannot be set
IllegalArgumentException - If the property does not existpublic 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 void setUserWriteMask(EnumSet<WriteAccess> userWriteMask)
userWriteMask - the new UserWriteMask to setUaNode.getUserWriteMask()public void setWriteMask(EnumSet<WriteAccess> writeMask)
writeMask - the new WriteMask to setUaNode.getWriteMask()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 Object
public final boolean writeAttribute(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
throws StatusException
attributeId - the attributedataValue - the new value, if this is null, the status of the attribute is set to
StatusCode.BAD, otherwise the status and value are used from it
StatusException - if the write is not accepted (for above mentioned reasons)UaNode.supportsAttribute(UnsignedInteger)protected UaReference addReference(UaReference reference)
protected void afterAddReference(UaReference reference)
reference - protected void afterDeleteReference(UaReference reference)
reference - protected void assertTypeSupport(org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinition)
protected void assertTypeSupport(org.opcfoundation.ua.builtintypes.NodeId typeDefinition)
protected boolean beforeAddReference(UaReference reference)
reference -
protected boolean doAddProperty(UaProperty property)
property -
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 org.opcfoundation.ua.core.NodeAttributes getAttributes(org.opcfoundation.ua.core.NodeAttributes attributes)
protected Collection<UaReference> getReferenceList()
AbstractUaNode
getReferenceList in class AbstractUaNodeprotected void initSupportedAttributes(List<org.opcfoundation.ua.builtintypes.UnsignedInteger> l)
protected void readAttributeValue(org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
org.opcfoundation.ua.builtintypes.DataValue dataValue)
throws StatusException
attributeId - the ID of the attribute to read.dataValue - the DataValue structure in which the value is set.locale - the locale for LocalizedTexts
StatusException
protected boolean referenceTypeInherits(org.opcfoundation.ua.builtintypes.NodeId typeId,
org.opcfoundation.ua.builtintypes.NodeId... referenceTypeIds)
AbstractUaNode
referenceTypeInherits in class AbstractUaNode
protected void setNodeVersion(String nodeVersion)
throws StatusException
nodeVersion -
StatusException
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 | |||||||||