com.prosysopc.ua
Interface UaAddressSpace

All Known Implementing Classes:
AddressSpace, NodeManagerTable

public interface UaAddressSpace

A common interface for UA address space. The main use-case for this interface is to offer somewhat common interface for accessing UaNodes on both the client and the server side.

NOTE! This interface tries to offer methods that AddressSpace (client side) and NodeManagerTable (server side) have. Note that there is some differences on returning null values and throwing exceptions, therefore it is better to use the concrete implementation classes returned by e.g. UaClient.getAddressSpace() if possible.

NOTE! This interface is not designed to be implemented by SDK users, e.g. methods can be added to it.


Method Summary
 void addNode(UaNode node)
          Add a (@link UaNode) to the address space.
 UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId id)
          Find a (@link UaNode) corresponding to the given (@link NodeId).
 DataTypeConverter getDataTypeConverter()
          Return DataTypeConverter
 org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
           
 org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
          Return the (@link NamespaceTable) associated with the (@link UaAddressSpace).
 UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
          Convenience method for getNode(NodeId) that accepts ExpandedNodeId
<T extends UaNode>
T
getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, Class<T> clazz)
          Convenience method for #getNode(ExpandedNodeId)) that converts the results to given class
 UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Find the UaNode object, corresponding to the NodeId.
<T extends UaNode>
T
getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId, Class<T> clazz)
          Convenience method for getNode(NodeId) that converts the results to given class
 void loadModel(InputStream inputStream)
          Load an Information Model into the application's address space.
 void loadModel(URI path)
          Load an Information Model into the application's address space.
 

Method Detail

getDataTypeConverter

DataTypeConverter getDataTypeConverter()
Return DataTypeConverter

Returns:
the DataTypeConverter

getEncoderContext

org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
Returns:
the encoder context, which is used for mapping namespaces and nodeIds in the stack layer.

getNode

UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
               throws UaException
Convenience method for getNode(NodeId) that accepts ExpandedNodeId

Throws:
UaException

getNode

<T extends UaNode> T getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                             Class<T> clazz)
                         throws UaException
Convenience method for #getNode(ExpandedNodeId)) that converts the results to given class

Throws:
UaException

getNode

UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
               throws UaException
Find the UaNode object, corresponding to the NodeId. How this is done is upto implementations.

NOTE! It is implementation specific what happens if there is no UaNode instance for given NodeId or given NodeId is null or NodeId.NULL

Parameters:
nodeId - the NodeId
Returns:
the UaNode for the given NodeId
Throws:
UaException - possible error

getNode

<T extends UaNode> T getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                             Class<T> clazz)
                         throws UaException
Convenience method for getNode(NodeId) that converts the results to given class

Throws:
UaException

loadModel

void loadModel(InputStream inputStream)
               throws SAXException,
                      IOException,
                      ModelException,
                      ServiceException
Load an Information Model into the application's address space. Load nodes and references from an UA NodeSet file. The file must conform to the UANodeSet schema, http://opcfoundation.org/UA/2011/03/UANodeSet.xsd

Parameters:
inputStream - The stream that contains the XML node set.
Throws:
ModelException - if there is a problem with the model and it cannot be fully created. The exception is thrown with and errorList of all errors found in the file.
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.
ServiceException - if the AddNodes service call to the server fails

loadModel

void loadModel(URI path)
               throws SAXException,
                      IOException,
                      ModelException,
                      ServiceException
Load an Information Model into the application's address space. Load nodes and references from an UA NodeSet file. The file must conform to the UANodeSet schema, http://opcfoundation.org/UA/2011/03/UANodeSet.xsd

Parameters:
path - The path to the XML file. You can create an URI from a File name with File.toURI()
Throws:
ModelException - if there is a problem with the model and it cannot be fully created. The exception is thrown with and errorList of all errors found in the file.
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.
ServiceException - if the AddNodes service call to the server fails

addNode

void addNode(UaNode node)
Add a (@link UaNode) to the address space.

Parameters:
node - that is added

findNode

UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId id)
Find a (@link UaNode) corresponding to the given (@link NodeId).

Parameters:
id - of the (@link UaNode) that is searched for
Returns:
the found (@link UaNode) or null if not found

getNamespaceTable

org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
Return the (@link NamespaceTable) associated with the (@link UaAddressSpace).

Returns:
the (@link NamespaceTable) associated with the (@link UaAddressSpace).


Copyright © 2018. All rights reserved.