com.prosysopc.ua.server
Class NodeManagerTable

java.lang.Object
  extended by com.prosysopc.ua.server.NodeManagerTable
All Implemented Interfaces:
UaAddressSpace

public class NodeManagerTable
extends Object
implements UaAddressSpace

A collection of node managers, used in an UA Server. The NodeManagerTable can be used to access all Node Managers, and perform operations on any node, independent of which node manager manages it.

The NodeManagerTable will basically just dispatch different calls to the correct Node Manager, which you can also get from getNodeManager(org.opcfoundation.ua.builtintypes.ExpandedNodeId).


Nested Class Summary
static class NodeManagerTable.ModelParserForUaDefinedTypes
          A class for reading XML and CSV model files and transforming them into OPC UA NodeManagement Service Set Service calls.
 
Constructor Summary
NodeManagerTable(UaServer server)
           
 
Method Summary
protected  org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext, org.opcfoundation.ua.core.AddNodesItem nodeToAdd)
           
protected  org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.NodeId parentNodeId, org.opcfoundation.ua.builtintypes.QualifiedName browseName, org.opcfoundation.ua.core.NodeClass nodeClass, org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId, org.opcfoundation.ua.core.NodeAttributes attributes, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
           
 void addNode(UaNode node)
          Add a (@link UaNode) to the address space.
 int addNodeManager(int namespaceIndex, NodeManager nodeManager)
          Add a node manager to the table
protected  void addReference(ServiceContext serviceContext, org.opcfoundation.ua.core.AddReferencesItem addReferencesItem)
           
protected  void afterCreateMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
           
protected  void afterCreateMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, MonitoredEventItem item)
           
protected  void afterDeleteMonitoredItem(ServiceContext serviceContext, Subscription subscription, MonitoredItem item)
           
protected  void afterModifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item)
           
protected  void afterModifyMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, MonitoredEventItem item)
           
protected  BrowseContinuationPoint browseNode(ServiceContext serviceContext, List<org.opcfoundation.ua.core.ReferenceDescription> referenceDescriptions, org.opcfoundation.ua.builtintypes.NodeId nodeId, int maxReferences, org.opcfoundation.ua.core.BrowseDirection browseDirection, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, Boolean includeSubTypes, org.opcfoundation.ua.builtintypes.QualifiedName browseName, EnumSet<org.opcfoundation.ua.core.NodeClass> nodeClassSet, EnumSet<org.opcfoundation.ua.core.BrowseResultMask> resultSet, org.opcfoundation.ua.core.ViewDescription view, int startIndex)
           
protected  org.opcfoundation.ua.builtintypes.Variant[] callMethod(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId objectId, org.opcfoundation.ua.builtintypes.NodeId methodId, org.opcfoundation.ua.builtintypes.Variant[] inputArguments, org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults, org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos)
           
protected  void checkNodeManagementEnabled()
           
 void close()
           
protected  void createMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.MonitoringParameters params, org.opcfoundation.ua.core.MonitoringFilter filter, org.opcfoundation.ua.core.AggregateFilterResult filterResult, org.opcfoundation.ua.core.MonitoringMode monitoringMode)
           
protected  void createMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.core.EventFilter eventFilter, org.opcfoundation.ua.core.EventFilterResult filterResult)
           
protected  void createNewNodeManager(ServiceContext serviceContext, String namespaceUri)
           
protected  void deleteMonitoredItem(ServiceContext serviceContext, Subscription subscription, MonitoredItem monitoredItem)
           
protected  void deleteNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId, boolean deleteTargetReferences)
           
protected  void deleteNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, Boolean deleteTargetReferences)
           
protected  void deleteReference(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId sourceNodeId, org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId, org.opcfoundation.ua.builtintypes.NodeId referenceTypeId, Boolean isForward, Boolean deleteBidirectional)
           
 UaNode findNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Find a (@link UaNode) corresponding to the given (@link NodeId).
 DataTypeConverter getDataTypeConverter()
          Return DataTypeConverter
 org.opcfoundation.ua.encoding.EncoderContext getEncoderContext()
           
 UaNode getExternalNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 ExternalNodeManager getExternalNodeManager()
           
 HistoryManager getHistoryManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 InstanceDeclarationHierarchyCache getInstanceDeclarationHierarchyCache()
           
 IoManager getIoManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 NodeManagerTableListener getListener()
           
 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 NodeManagerTable.getNode
<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 a node from the NodeManagers managed by the NodeManagerTable.
<T extends UaNode>
T
getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId, Class<T> clazz)
          Convinience method for getNode(NodeId) that casts the result to given class
 UaNodeBuilderConfiguration getNodeBuilderConfiguration()
          Get UaNodeBuilderConfiguration that NodeManagerUaNode uses if it does not have it's own configuration.
 org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId, UaNode node)
          Return the node class of a node.
 org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.NodeId nodeId, UaNode node)
          Return the node class of a node.
 boolean getNodeManagementEnabled()
          Are node management operations enabled in the server?
 NodeManager getNodeManager(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId)
          Get a NodeManager that handles the specified node.
 NodeManager getNodeManager(int namespaceIndex)
          Get a certain NodeManager from the table.
 NodeManager getNodeManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
          Get a NodeManager that handles the specified node.
 NodeManager getNodeManager(String namespaceUri)
          Find the node manager for the defined namespaceUri

The method equals to getNodeManager(getNamespaceTable().getIndex(namespaceUri))

 NodeManagerRoot getNodeManagerRoot()
           
 UaNode getNodeOrExternal(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 UaServer getServer()
           
 org.opcfoundation.ua.common.ServerTable getServerTable()
           
 StructureInfoCache getStructureInfoCache()
          Get StructureInfoCache
 UaType getType(org.opcfoundation.ua.builtintypes.NodeId typeId)
          Find the type node with a specific Id
 boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
 boolean hasNodeManager(String uri)
           
protected  HistoryResult historyRead(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.utils.NumericRange indexRange, HistoryContinuationPoint continuationPoint, org.opcfoundation.ua.core.HistoryReadDetails details, int aggregateIndex)
           
protected  void historyUpdate(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.core.HistoryUpdateDetails details, org.opcfoundation.ua.core.HistoryUpdateResult historyUpdateResult)
           
protected  void init()
           
protected  void initializeMonitoredDataItem(ServiceContext serviceContext, MonitoredDataItem monitoredItem, org.opcfoundation.ua.builtintypes.DataValue dataValue)
           
 boolean isTypeOf(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId, UaType typeDefinition, org.opcfoundation.ua.builtintypes.NodeId expectedTypeId, UaType expectedType)
           
 void loadModel(InputStream inputStream)
          Load an Information Model into the client.
 void loadModel(InputStream inputStream, Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> ignoredNodes, boolean failOnFirstError)
          Load an Information Model into the server.
 void loadModel(URI path)
          Load an Information Model into the server.
 void loadModel(URI path, Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> ignoredNodes, boolean failOnFirstError)
          Load an Information Model into the server.
 void loadNodesFromXml(URL path, URL url, Map<String,NodeManagerTable.ModelParserForUaDefinedTypes.ParentDefinition> parentIds)
          Deprecated. this format is not supported, use NodeSet format, loadModel(URI)
 void loadNodesFromXml(URL path, URL url, Map<String,NodeManagerTable.ModelParserForUaDefinedTypes.ParentDefinition> parentIds, String targetNamespace)
          Deprecated. this format is not supported, use NodeSet format, loadModel(URI)
protected  void modifyMonitoredDataItem(ServiceContext serviceContext, Subscription subscription, MonitoredDataItem item, org.opcfoundation.ua.core.MonitoringParameters params, org.opcfoundation.ua.core.MonitoringFilter filter, org.opcfoundation.ua.core.AggregateFilterResult filterResult)
           
protected  void modifyMonitoredEventItem(ServiceContext serviceContext, Subscription subscription, MonitoredEventItem item, org.opcfoundation.ua.core.EventFilter eventFilter, org.opcfoundation.ua.core.EventFilterResult filterResult)
           
protected  void queryFirst(ServiceContext serviceContext, org.opcfoundation.ua.core.QueryFirstRequest request, org.opcfoundation.ua.core.QueryFirstResponse response)
           
protected  void queryNext(ServiceContext serviceContext, org.opcfoundation.ua.core.QueryNextRequest request, org.opcfoundation.ua.core.QueryNextResponse response)
           
protected  void readAttribute(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn, org.opcfoundation.ua.builtintypes.DateTime minTimestamp, org.opcfoundation.ua.builtintypes.DataValue dataValue)
          Read the value of a single node attribute.
protected  org.opcfoundation.ua.builtintypes.NodeId registerNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
protected  void releaseHistoryContinuationPoint(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.ByteString continuationPoint)
           
 NodeManager removeNodeManager(int namespaceIndex)
           
 void setListener(NodeManagerTableListener listener)
           
 void setNodeBuilderConfiguration(UaNodeBuilderConfiguration configuration)
          Set new NodeBuilder configuration.
 void setNodeManagementEnabled(boolean nodeManagementEnabled)
          Enable node management operations in the server.
protected  void start()
          Start all node managers.
protected  org.opcfoundation.ua.core.BrowsePathTarget[] translateBrowsePath(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId startingNode, org.opcfoundation.ua.core.RelativePath relativePath)
           
 org.opcfoundation.ua.core.BrowsePathTarget[] translateBrowsePathToNodeIds(org.opcfoundation.ua.builtintypes.NodeId startingNode, org.opcfoundation.ua.core.RelativePath relativePath)
          Request the NodeIds for the nodes that are references from the startingNode using paths.
protected  void unregisterNode(ServiceContext serviceContext, org.opcfoundation.ua.builtintypes.NodeId nodeId)
           
protected  boolean writeAttribute(ServiceContext serviceContext, Object operationContext, org.opcfoundation.ua.builtintypes.NodeId nodeId, org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId, org.opcfoundation.ua.utils.NumericRange indexRange, org.opcfoundation.ua.builtintypes.DataValue value)
          Write the value of a single node attribute.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeManagerTable

public NodeManagerTable(UaServer server)
Method Detail

addNode

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

Specified by:
addNode in interface UaAddressSpace
Parameters:
node - that is added

addNodeManager

public int addNodeManager(int namespaceIndex,
                          NodeManager nodeManager)
Add a node manager to the table

Parameters:
namespaceIndex - the desired namespaceIndex or -1 to use the next available. Indexes 0 and 1 are reserved for the standard OPCUA namespaces
nodeManager - The node manager to add to the table
Returns:
the namespaceIndex that was assigned for the node manager

close

public void close()

findNode

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

Specified by:
findNode in interface UaAddressSpace
Parameters:
nodeId - of the (@link UaNode) that is searched for
Returns:
the found (@link UaNode) or null if not found

getDataTypeConverter

public DataTypeConverter getDataTypeConverter()
Description copied from interface: UaAddressSpace
Return DataTypeConverter

Specified by:
getDataTypeConverter in interface UaAddressSpace
Returns:

getEncoderContext

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

getExternalNode

public UaNode getExternalNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
                       throws StatusException
Throws:
StatusException

getExternalNodeManager

public ExternalNodeManager getExternalNodeManager()

getHistoryManager

public HistoryManager getHistoryManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
                                 throws StatusException
Parameters:
nodeId -
Returns:
Throws:
StatusException

getInstanceDeclarationHierarchyCache

public InstanceDeclarationHierarchyCache getInstanceDeclarationHierarchyCache()

getIoManager

public IoManager getIoManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
                       throws StatusException
Parameters:
nodeId -
Returns:
Throws:
StatusException

getListener

public NodeManagerTableListener getListener()

getNamespaceTable

public org.opcfoundation.ua.common.NamespaceTable getNamespaceTable()
Description copied from interface: UaAddressSpace
Return the (@link NamespaceTable) associated with the (@link UaAddressSpace).

Specified by:
getNamespaceTable in interface UaAddressSpace
Returns:
the (@link NamespaceTable) associated with the (@link UaAddressSpace).

getNode

public UaNode getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId)
               throws StatusException
Convenience method for NodeManagerTable.getNode

Specified by:
getNode in interface UaAddressSpace
Throws:
StatusException
See Also:
getNode(NodeId)

getNode

public <T extends UaNode> T getNode(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                    Class<T> clazz)
                         throws StatusException
Description copied from interface: UaAddressSpace
Convenience method for #getNode(ExpandedNodeId)) that converts the results to given class

Specified by:
getNode in interface UaAddressSpace
Throws:
StatusException
See Also:
getNode(NodeId, Class)

getNode

public UaNode getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)
               throws StatusException
Find a node from the NodeManagers managed by the NodeManagerTable. It dispatches the request to the NodeManager that is registered to handle the nameSpace in which the NodeId resides.

If the node is not found or there is no UaNode initialized for it, the method throws StatusException: Bad_NodeIdUnknown.

In case the NodeManager does contain the node with the specified NodeId, but does not use UaNode objects, the method may return null.

In case the node is handled by a node manager without any UaNode, you should rather use findNode, which simply returns null, if there is no node object available and hasNode to just check if the NodeId is handled by a node manager. Alternatively, you can find the correct NodeManager yourself and request more detailed information directly from it.

Specified by:
getNode in interface UaAddressSpace
Parameters:
nodeId - the Node to look for
Returns:
the UaNode object with the NodeId. May be null, if the NodeManager does not ServiceManagerBase.requireUaNode() but the NodeId is valid.
Throws:
StatusException - if the node is not found

getNode

public <T extends UaNode> T getNode(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                    Class<T> clazz)
                         throws StatusException
Convinience method for getNode(NodeId) that casts the result to given class

Specified by:
getNode in interface UaAddressSpace
Parameters:
nodeId -
clazz -
Returns:
Throws:
StatusException - if the node is not found
ClassCastException - if cast fails

getNodeBuilderConfiguration

public UaNodeBuilderConfiguration getNodeBuilderConfiguration()
Get UaNodeBuilderConfiguration that NodeManagerUaNode uses if it does not have it's own configuration.

Returns:
a configuration for NodeBuilder

getNodeClass

public org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.ExpandedNodeId nodeId,
                                                        UaNode node)
Return the node class of a node.

Parameters:
nodeId - The ID of the node.
node - The UaNode object, if the node manager supports them, or null
Returns:
the NodeClass of the node

getNodeClass

public org.opcfoundation.ua.core.NodeClass getNodeClass(org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                        UaNode node)
Return the node class of a node.

Parameters:
nodeId - The ID of the node.
node - The UaNode object, if the node manager supports them, or null
Returns:
the NodeClass of the node

getNodeManagementEnabled

public boolean getNodeManagementEnabled()
Are node management operations enabled in the server? That is AddNodes, AddReferences, DeleteNodes and DeleteReferences service calls.

Returns:
true if node management operations are enabled in general
See Also:
setNodeManagementEnabled(boolean)

getNodeManager

public NodeManager getNodeManager(org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId)
                           throws StatusException
Get a NodeManager that handles the specified node.

Parameters:
expandedNodeId - the node id that defines the namespace
Returns:
the nodeManager that handles the namespace defined by the NodeId
Throws:
StatusException - if the re is no node manager for the namespace

getNodeManager

public NodeManager getNodeManager(int namespaceIndex)
                           throws StatusException
Get a certain NodeManager from the table.

Parameters:
namespaceIndex - the namespaceIndex of the nodemanager to look for
Returns:
the nodemanager for the index
Throws:
StatusException - with StatusCodes.Bad_NodeIdUnknown if the nodeManager is not found

getNodeManager

public NodeManager getNodeManager(org.opcfoundation.ua.builtintypes.NodeId nodeId)
                           throws StatusException
Get a NodeManager that handles the specified node.

Parameters:
nodeId - the node id that defines the namespace
Returns:
the nodeManager that handles the namespace defined by the NodeId
Throws:
StatusException - if there is no node manager for the namespace

getNodeManager

public NodeManager getNodeManager(String namespaceUri)
                           throws StatusException
Find the node manager for the defined namespaceUri

The method equals to getNodeManager(getNamespaceTable().getIndex(namespaceUri))

Parameters:
namespaceUri - the URI of teh namespace to look for
Returns:
Throws:
StatusException - if the nodeManager is not available

getNodeManagerRoot

public NodeManagerRoot getNodeManagerRoot()

getNodeOrExternal

public UaNode getNodeOrExternal(org.opcfoundation.ua.builtintypes.NodeId nodeId)
                         throws StatusException
Parameters:
nodeId -
Returns:
Throws:
StatusException

getServer

public UaServer getServer()

getServerTable

public org.opcfoundation.ua.common.ServerTable getServerTable()
Returns:

getStructureInfoCache

public StructureInfoCache getStructureInfoCache()
Get StructureInfoCache


getType

public UaType getType(org.opcfoundation.ua.builtintypes.NodeId typeId)
               throws StatusException
Find the type node with a specific Id

Parameters:
typeId - the NodeId of the type
Returns:
the type node
Throws:
StatusException - if the node is not found

hasNode

public boolean hasNode(org.opcfoundation.ua.builtintypes.NodeId nodeId)

hasNodeManager

public boolean hasNodeManager(String uri)
Parameters:
uri -
Returns:

isTypeOf

public boolean isTypeOf(org.opcfoundation.ua.builtintypes.NodeId typeDefinitionId,
                        UaType typeDefinition,
                        org.opcfoundation.ua.builtintypes.NodeId expectedTypeId,
                        UaType expectedType)
                 throws StatusException
Parameters:
typeDefinitionId -
typeDefinition -
expectedTypeId -
expectedType -
Returns:
Throws:
StatusException

loadModel

public void loadModel(InputStream inputStream)
               throws SAXException,
                      IOException,
                      ModelException
Load an Information Model into the client. 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

Specified by:
loadModel in interface UaAddressSpace
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 stream.
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.

loadModel

public void loadModel(InputStream inputStream,
                      Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> ignoredNodes,
                      boolean failOnFirstError)
               throws SAXException,
                      ModelException,
                      IOException
Load an Information Model into the server.

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 stream.
SAXException - if the required XMLReaded cannot be created.
IOException - if the model stream cannot be read

loadModel

public void loadModel(URI path)
               throws SAXException,
                      IOException,
                      ModelException
Load an Information Model into the server.

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

Specified by:
loadModel in interface UaAddressSpace
Parameters:
path - The path to the XML file. You can create an URI from a File name with java.io.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.

loadModel

public void loadModel(URI path,
                      Collection<org.opcfoundation.ua.builtintypes.ExpandedNodeId> ignoredNodes,
                      boolean failOnFirstError)
               throws SAXException,
                      IOException,
                      ModelException
Load an Information Model into the server.

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 java.io.File#toUri()
ignoredNodes - Nodes to leave out of import. Use this if you are creating the nodes explicitly in the server and do not want them to be imported from the XML. The related references will be imported though.
failOnFirstError - make the model creation fail for the first error encountered. If false, the model is parsed fully and possible errors are raised only at the end.
Throws:
ModelException - if there is a problem with the model and it cannot be fully created. The exception is thrown for individual nodes only if #isFailOnFirstError() is true. Otherwise, it will be filled with and errorList.
SAXException - if the required XMLReaded cannot be created.
IOException - if the model file cannot be read.

loadNodesFromXml

@Deprecated
public void loadNodesFromXml(URL path,
                                        URL url,
                                        Map<String,NodeManagerTable.ModelParserForUaDefinedTypes.ParentDefinition> parentIds)
                      throws NumberFormatException,
                             IllegalArgumentException,
                             IOException,
                             IllegalAccessException
Deprecated. this format is not supported, use NodeSet format, loadModel(URI)

Load nodes and references from an XML file. The file must conform to the OPC UA ModelDesign schema, http://opcfoundation.org/UA/ModelDesign.xsd.

Note that this file format is not a standard format and whenever possible you should use the new NodeSet format, which can be loaded with #loadModel(URL, Collection, boolean).

Parameters:
path - The path to the XML file.
url - The path to the accompanying .csv file containing NodeIds, or null if default UA NodeIds will suffice.
parentIds -
Throws:
NumberFormatException
IllegalArgumentException
IOException
IllegalAccessException
See Also:
loadModel(URI, Collection, boolean)

loadNodesFromXml

@Deprecated
public void loadNodesFromXml(URL path,
                                        URL url,
                                        Map<String,NodeManagerTable.ModelParserForUaDefinedTypes.ParentDefinition> parentIds,
                                        String targetNamespace)
                      throws NumberFormatException,
                             IllegalArgumentException,
                             IOException,
                             IllegalAccessException
Deprecated. this format is not supported, use NodeSet format, loadModel(URI)

Load nodes and references from an XML file. The file must conform to the OPC UA ModelDesign schema, http://opcfoundation.org/UA/ModelDesign.xsd.

Note that this file format is not a standard format and whenever possible you should use the new NodeSet format, which can be loaded with #loadModel(URL, Collection, boolean).

Parameters:
path - The path to the XML file.
url - The path to the accompanying .csv file containing NodeIds, or null if default UA NodeIds will suffice.
parentIds - Can be used to adjust the parent ids for nodes, if necessary, else null
targetNamespace -
Throws:
NumberFormatException
IllegalArgumentException
IOException
IllegalAccessException
See Also:
loadModel(URI, Collection, boolean)

removeNodeManager

public NodeManager removeNodeManager(int namespaceIndex)
Parameters:
namespaceIndex -
nodeManager -
Returns:

setListener

public void setListener(NodeManagerTableListener listener)

setNodeBuilderConfiguration

public void setNodeBuilderConfiguration(UaNodeBuilderConfiguration configuration)
Set new NodeBuilder configuration.

Parameters:
configuration - the new configuration
See Also:
getNodeBuilderConfiguration()

setNodeManagementEnabled

public void setNodeManagementEnabled(boolean nodeManagementEnabled)
Enable node management operations in the server. That is AddNodes, AddReferences, DeleteNodes and DeleteReferences service calls.

If you wish to enable these operations depending on user identity, then you will need to define user specific access to these in every node manager, using the NodeManagerListener of each.

It will also enable new node managers to be created on the fly as necessary, if clients addNodes for a new namespace. You may modify this behaviour using the UaServerListener of the server.

Default value: false

Parameters:
nodeManagementEnabled - the allowNewNodeManagers to set
See Also:
UaServer.setListener(UaServerListener)

translateBrowsePathToNodeIds

public org.opcfoundation.ua.core.BrowsePathTarget[] translateBrowsePathToNodeIds(org.opcfoundation.ua.builtintypes.NodeId startingNode,
                                                                                 org.opcfoundation.ua.core.RelativePath relativePath)
                                                                          throws StatusException,
                                                                                 ServiceException
Request the NodeIds for the nodes that are references from the startingNode using paths.

Each browse path is constructed of a starting Node and a RelativePath. The specified starting Node identifies the Node from which the RelativePath is based. The RelativePath contains a sequence of ReferenceTypes and BrowseNames.

Parameters:
browsePaths - the browse paths, i.e. combinations of StartingNode & RelativePath
Returns:
a list of targets for the relativePath from the startingNode. The result is a list, since it is possible that there are several nodes that have the same path. Normally, there should be only one result, though. Read the TargetId of the result(s) to find the NodeId requested.

Server may also encounter a Reference to a Node in another Server which it can not follow while it is processing the RelativePath. If this happens the NodeId of the external Node as TargetId is returned, and the remainingPathIndex parameter indicates which RelativePath elements still need to be processed. If all elements are processed, i.e. there is no reference to an external server, remainingPathIndex will be set to UnsignedInteger.MAX_VALUE.

Throws:
ServiceException - if call failed
StatusException - if call failed

addNode

protected org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext,
                                                           org.opcfoundation.ua.core.AddNodesItem nodeToAdd)
                                                    throws StatusException
Throws:
StatusException

addNode

protected org.opcfoundation.ua.builtintypes.NodeId addNode(ServiceContext serviceContext,
                                                           org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                                           org.opcfoundation.ua.builtintypes.NodeId parentNodeId,
                                                           org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                                           org.opcfoundation.ua.core.NodeClass nodeClass,
                                                           org.opcfoundation.ua.builtintypes.ExpandedNodeId typeDefinitionId,
                                                           org.opcfoundation.ua.core.NodeAttributes attributes,
                                                           org.opcfoundation.ua.builtintypes.NodeId referenceTypeId)
                                                    throws StatusException
Parameters:
serviceContext -
nodeId -
parentNodeId -
browseName -
nodeClass -
typeDefinitionId -
attributes -
referenceTypeId -
Returns:
Throws:
StatusException

addReference

protected void addReference(ServiceContext serviceContext,
                            org.opcfoundation.ua.core.AddReferencesItem addReferencesItem)
                     throws StatusException
Throws:
StatusException

afterCreateMonitoredDataItem

protected void afterCreateMonitoredDataItem(ServiceContext serviceContext,
                                            Subscription subscription,
                                            MonitoredDataItem item)
                                     throws StatusException
Parameters:
serviceContext -
subscription -
item -
Throws:
StatusException

afterCreateMonitoredEventItem

protected void afterCreateMonitoredEventItem(ServiceContext serviceContext,
                                             Subscription subscription,
                                             MonitoredEventItem item)
                                      throws StatusException
Parameters:
serviceContext -
subscription -
item -
Throws:
StatusException

afterDeleteMonitoredItem

protected void afterDeleteMonitoredItem(ServiceContext serviceContext,
                                        Subscription subscription,
                                        MonitoredItem item)
                                 throws StatusException
Parameters:
serviceContext -
subscription -
item -
Throws:
StatusException

afterModifyMonitoredDataItem

protected void afterModifyMonitoredDataItem(ServiceContext serviceContext,
                                            Subscription subscription,
                                            MonitoredDataItem item)
                                     throws StatusException
Parameters:
serviceContext -
subscription -
item -
Throws:
StatusException

afterModifyMonitoredEventItem

protected void afterModifyMonitoredEventItem(ServiceContext serviceContext,
                                             Subscription subscription,
                                             MonitoredEventItem item)
                                      throws StatusException
Parameters:
serviceContext -
subscription -
item -
Throws:
StatusException

browseNode

protected BrowseContinuationPoint browseNode(ServiceContext serviceContext,
                                             List<org.opcfoundation.ua.core.ReferenceDescription> referenceDescriptions,
                                             org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                             int maxReferences,
                                             org.opcfoundation.ua.core.BrowseDirection browseDirection,
                                             org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                                             Boolean includeSubTypes,
                                             org.opcfoundation.ua.builtintypes.QualifiedName browseName,
                                             EnumSet<org.opcfoundation.ua.core.NodeClass> nodeClassSet,
                                             EnumSet<org.opcfoundation.ua.core.BrowseResultMask> resultSet,
                                             org.opcfoundation.ua.core.ViewDescription view,
                                             int startIndex)
                                      throws ServiceException,
                                             StatusException
Throws:
ServiceException
StatusException

callMethod

protected org.opcfoundation.ua.builtintypes.Variant[] callMethod(ServiceContext serviceContext,
                                                                 org.opcfoundation.ua.builtintypes.NodeId objectId,
                                                                 org.opcfoundation.ua.builtintypes.NodeId methodId,
                                                                 org.opcfoundation.ua.builtintypes.Variant[] inputArguments,
                                                                 org.opcfoundation.ua.builtintypes.StatusCode[] inputArgumentResults,
                                                                 org.opcfoundation.ua.builtintypes.DiagnosticInfo[] inputArgumentDiagnosticInfos)
                                                          throws StatusException
Parameters:
serviceContext -
objectId -
methodId -
inputArguments -
inputArgumentResults -
inputArgumentDiagnosticInfos -
Returns:
Throws:
StatusException

checkNodeManagementEnabled

protected void checkNodeManagementEnabled()
                                   throws ServiceException
Throws:
ServiceException

createMonitoredDataItem

protected void createMonitoredDataItem(ServiceContext serviceContext,
                                       Subscription subscription,
                                       org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                       org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                       org.opcfoundation.ua.utils.NumericRange indexRange,
                                       org.opcfoundation.ua.core.MonitoringParameters params,
                                       org.opcfoundation.ua.core.MonitoringFilter filter,
                                       org.opcfoundation.ua.core.AggregateFilterResult filterResult,
                                       org.opcfoundation.ua.core.MonitoringMode monitoringMode)
                                throws StatusException
Parameters:
serviceContext -
subscription -
nodeId -
attributeId -
indexRange -
params -
filterResult -
filter -
filterResult -
monitoringMode -
Throws:
StatusException - if the mointoredItem is not accepted

createMonitoredEventItem

protected void createMonitoredEventItem(ServiceContext serviceContext,
                                        Subscription subscription,
                                        org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                        org.opcfoundation.ua.core.EventFilter eventFilter,
                                        org.opcfoundation.ua.core.EventFilterResult filterResult)
                                 throws StatusException
Parameters:
serviceContext -
nodeId -
eventFilter -
filterResult -
Throws:
StatusException - if the node is not valid

createNewNodeManager

protected void createNewNodeManager(ServiceContext serviceContext,
                                    String namespaceUri)
                             throws StatusException
Parameters:
serviceContext -
namespaceUri -
Throws:
StatusException

deleteMonitoredItem

protected void deleteMonitoredItem(ServiceContext serviceContext,
                                   Subscription subscription,
                                   MonitoredItem monitoredItem)
                            throws StatusException
Parameters:
serviceContext -
subscription -
monitoredItem -
Throws:
StatusException

deleteNode

protected void deleteNode(ServiceContext serviceContext,
                          org.opcfoundation.ua.builtintypes.ExpandedNodeId expandedNodeId,
                          boolean deleteTargetReferences)
                   throws StatusException
Parameters:
serviceContext -
expandedNodeId -
deleteTargetReferences -
Throws:
StatusException

deleteNode

protected void deleteNode(ServiceContext serviceContext,
                          org.opcfoundation.ua.builtintypes.NodeId nodeId,
                          Boolean deleteTargetReferences)
                   throws StatusException
Parameters:
serviceContext -
nodeId -
deleteTargetReferences -
Throws:
StatusException

deleteReference

protected void deleteReference(ServiceContext serviceContext,
                               org.opcfoundation.ua.builtintypes.NodeId sourceNodeId,
                               org.opcfoundation.ua.builtintypes.ExpandedNodeId targetNodeId,
                               org.opcfoundation.ua.builtintypes.NodeId referenceTypeId,
                               Boolean isForward,
                               Boolean deleteBidirectional)
                        throws StatusException
Parameters:
serviceContext -
sourceNodeId -
targetNodeId -
referenceTypeId -
isForward -
deleteBidirectional -
Throws:
StatusException

historyRead

protected HistoryResult historyRead(ServiceContext serviceContext,
                                    Object operationContext,
                                    org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                                    org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                    org.opcfoundation.ua.utils.NumericRange indexRange,
                                    HistoryContinuationPoint continuationPoint,
                                    org.opcfoundation.ua.core.HistoryReadDetails details,
                                    int aggregateIndex)
                             throws StatusException
Parameters:
serviceContext -
timestampsToReturn -
nodeId -
indexRange -
continuationPoint -
details -
aggregateIndex -
operationContext -
Returns:
Throws:
StatusException

historyUpdate

protected void historyUpdate(ServiceContext serviceContext,
                             Object operationContext,
                             org.opcfoundation.ua.core.HistoryUpdateDetails details,
                             org.opcfoundation.ua.core.HistoryUpdateResult historyUpdateResult)
                      throws StatusException
Parameters:
serviceContext -
operationContext -
details -
historyUpdateResult -
Throws:
StatusException

init

protected void init()
             throws StatusException,
                    UaNodeFactoryException
Throws:
UaNodeFactoryException
StatusException

initializeMonitoredDataItem

protected void initializeMonitoredDataItem(ServiceContext serviceContext,
                                           MonitoredDataItem monitoredItem,
                                           org.opcfoundation.ua.builtintypes.DataValue dataValue)
                                    throws StatusException
Throws:
StatusException

modifyMonitoredDataItem

protected void modifyMonitoredDataItem(ServiceContext serviceContext,
                                       Subscription subscription,
                                       MonitoredDataItem item,
                                       org.opcfoundation.ua.core.MonitoringParameters params,
                                       org.opcfoundation.ua.core.MonitoringFilter filter,
                                       org.opcfoundation.ua.core.AggregateFilterResult filterResult)
                                throws StatusException
Parameters:
serviceContext -
subscription -
item -
params -
filter -
filterResult -
Throws:
StatusException

modifyMonitoredEventItem

protected void modifyMonitoredEventItem(ServiceContext serviceContext,
                                        Subscription subscription,
                                        MonitoredEventItem item,
                                        org.opcfoundation.ua.core.EventFilter eventFilter,
                                        org.opcfoundation.ua.core.EventFilterResult filterResult)
                                 throws StatusException
Parameters:
serviceContext -
subscription -
item -
eventFilter -
filterResult -
Throws:
StatusException

queryFirst

protected void queryFirst(ServiceContext serviceContext,
                          org.opcfoundation.ua.core.QueryFirstRequest request,
                          org.opcfoundation.ua.core.QueryFirstResponse response)
                   throws ServiceException
Parameters:
serviceContext -
request -
response -
Throws:
StatusException
ServiceException

queryNext

protected void queryNext(ServiceContext serviceContext,
                         org.opcfoundation.ua.core.QueryNextRequest request,
                         org.opcfoundation.ua.core.QueryNextResponse response)
                  throws ServiceException
Parameters:
serviceContext -
request -
response -
Throws:
StatusException
ServiceException

readAttribute

protected void readAttribute(ServiceContext serviceContext,
                             Object operationContext,
                             org.opcfoundation.ua.builtintypes.NodeId nodeId,
                             org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                             org.opcfoundation.ua.utils.NumericRange indexRange,
                             org.opcfoundation.ua.core.TimestampsToReturn timestampsToReturn,
                             org.opcfoundation.ua.builtintypes.DateTime minTimestamp,
                             org.opcfoundation.ua.builtintypes.DataValue dataValue)
                      throws StatusException
Read the value of a single node attribute.

Parameters:
serviceContext - The serviceContext of the client connection used to call this service.
operationContext - the possible operationContext prepared in #beginRead
nodeId - The node to read.
attributeId - The attribute to read.
indexRange - The requested index range for an array value. May be null.
timestampsToReturn - Which timestamps were requested by the client.
minTimestamp - Minimum value of the ServerTimestamp of the value to be read. If there is no value available that is new enough already available (in the server cache), the server should attempt to read a new value from the actual data source, instead of using the cached value. If a new value cannot be read, the best value available is returned. If minTimestamp == DateTime.MAX_VALUE a new value should be read from the source.
dataValue - The data value to return. Set Value, and for Value attribute also StatusCode and the Timestamps.
Throws:
StatusException - If the read fails. Expected result codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData, Bad_DataEncodingInvalid, Bad_DataEncodingUnsupported, Bad_NotReadable, Bad_UserAccessDenied

registerNode

protected org.opcfoundation.ua.builtintypes.NodeId registerNode(ServiceContext serviceContext,
                                                                org.opcfoundation.ua.builtintypes.NodeId nodeId)
                                                         throws StatusException
Parameters:
serviceContext -
nodeId -
Returns:
Throws:
StatusException

releaseHistoryContinuationPoint

protected void releaseHistoryContinuationPoint(ServiceContext serviceContext,
                                               org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                               org.opcfoundation.ua.builtintypes.ByteString continuationPoint)
                                        throws StatusException
Parameters:
serviceContext -
nodeId -
continuationPoint -
Throws:
StatusException

start

protected void start()
              throws StatusException,
                     UaNodeFactoryException
Start all node managers.

Throws:
StatusException
UaNodeFactoryException

translateBrowsePath

protected org.opcfoundation.ua.core.BrowsePathTarget[] translateBrowsePath(ServiceContext serviceContext,
                                                                           org.opcfoundation.ua.builtintypes.NodeId startingNode,
                                                                           org.opcfoundation.ua.core.RelativePath relativePath)
                                                                    throws StatusException,
                                                                           ServiceException
Throws:
StatusException
ServiceException

unregisterNode

protected void unregisterNode(ServiceContext serviceContext,
                              org.opcfoundation.ua.builtintypes.NodeId nodeId)
                       throws StatusException
Parameters:
serviceContext -
nodeId -
Throws:
StatusException

writeAttribute

protected boolean writeAttribute(ServiceContext serviceContext,
                                 Object operationContext,
                                 org.opcfoundation.ua.builtintypes.NodeId nodeId,
                                 org.opcfoundation.ua.builtintypes.UnsignedInteger attributeId,
                                 org.opcfoundation.ua.utils.NumericRange indexRange,
                                 org.opcfoundation.ua.builtintypes.DataValue value)
                          throws StatusException
Write the value of a single node attribute.

Parameters:
serviceContext - The serviceContext of the client connection used to call this service.
operationContext - the possible operationContext prepared in #beginWrite
nodeId - The node to write.
attributeId - The attribute to write.
indexRange - The index range to set for an array value. May be null.
dataValue - The data value to write.
Throws:
StatusException - If the write fails. Expected result codes: Bad_NodeIdInvalid, Bad_NodeIdUnknown, Bad_AttributeIdInvalid, Bad_IndexRangeInvalid, Bad_IndexRangeNoData, Bad_DataEncodingInvalid, Bad_DataEncodingUnsupported, Bad_NotWriteable, Bad_UserAccessDenied, Bad_OutOfRange, Bad_TypeMismatch, Bad_WriteNotSupported


Copyright © 2018. All rights reserved.