Class OpcUaConnector.OpcUaModelAccess

java.lang.Object
de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
de.iip_ecosphere.platform.connectors.opcuav1.OpcUaConnector.OpcUaModelAccess
All Implemented Interfaces:
de.iip_ecosphere.platform.connectors.model.ModelAccess
Enclosing class:
OpcUaConnector<CO,CI>

protected class OpcUaConnector.OpcUaModelAccess extends de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
Implements the model access for OPC UA.
Author:
Holger Eichelberger, SSE
  • Field Details

  • Constructor Details

    • OpcUaModelAccess

      protected OpcUaModelAccess()
      Creates the instance and binds the listener to the creating connector instance.
    • OpcUaModelAccess

      protected OpcUaModelAccess(OpcUaConnector.NodeCacheEntry base, String basePath, OpcUaConnector<CO,CI>.OpcUaModelAccess parent, Map<String,OpcUaConnector.NodeCacheEntry> nodes)
      Creates the instance and binds the listener to the creating connector instance.
      Parameters:
      base - the context node to resolve non-nested names on
      basePath - the base path this context represente
      parent - the parent to return to in stepOut()
      nodes - the (parent) nodes cache to use
  • Method Details

    • topInstancesQName

      public String topInstancesQName()
    • getQSeparator

      public String getQSeparator()
    • getInputConverter

      public de.iip_ecosphere.platform.connectors.model.ModelInputConverter getInputConverter()
      Returns the input converter instance.
      Returns:
      the input converter
    • getOutputConverter

      public de.iip_ecosphere.platform.connectors.model.ModelOutputConverter getOutputConverter()
      Returns the output converter instance.
      Returns:
      the output converter
    • call

      public Object call(String qName, Object... args) throws IOException
      Throws:
      IOException
    • browseNode

      private void browseNode(String indent, org.eclipse.milo.opcua.stack.core.types.builtin.NodeId browseRoot)
      Just for testing, see Identifiers.RootFolder.
      Parameters:
      indent - output indent
      browseRoot - the node id to start browsing at
    • retrieveVariableNode

      private org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNode retrieveVariableNode(String qName, OpcUaConnector.NodeCacheEntry entry) throws org.eclipse.milo.opcua.stack.core.UaException, IOException
      Retrieves an OPC UA variable node from a cache node entry.
      Parameters:
      qName - the qualified node name (for exception message)
      entry - the cache entry to read the variable node from
      Returns:
      the variable node
      Throws:
      IOException - if no node can be found for qName or if the found node is not a variable node
      org.eclipse.milo.opcua.stack.core.UaException - if accessing/browsing the OPC UA model fails
    • retrieveCacheEntry

      private OpcUaConnector.NodeCacheEntry retrieveCacheEntry(String qName) throws org.eclipse.milo.opcua.stack.core.UaException, IOException
      Retrieves a node starting at the root of the OPC UA model based on the node's qualified name qName. Takes into account the nodes cache.
      Parameters:
      qName - the qualified node name
      Returns:
      the node
      Throws:
      IOException - if no node can be found for qName
      org.eclipse.milo.opcua.stack.core.UaException - if accessing/browsing the OPC UA model fails
    • retrieveNode

      private org.eclipse.milo.opcua.sdk.client.nodes.UaNode retrieveNode(String qName) throws org.eclipse.milo.opcua.stack.core.UaException
      Retrieves a node starting at current recursively following the path given by qName.
      Parameters:
      qName - the qualified node name
      Returns:
      the node or null for none found
      Throws:
      org.eclipse.milo.opcua.stack.core.UaException - if accessing/browsing the OPC UA model fails
    • retrieveNode

      private org.eclipse.milo.opcua.sdk.client.nodes.UaNode retrieveNode(org.eclipse.milo.opcua.sdk.client.nodes.UaNode current, String qName, String constqName) throws org.eclipse.milo.opcua.stack.core.UaException
      Retrieves a node starting at current recursively following the path given by qName.
      Parameters:
      current - the current node to start searching for, may be null for top-level
      qName - the qualified node name
      constqName - the initial qualified node name of first method call
      Returns:
      the node or null for none found
      Throws:
      org.eclipse.milo.opcua.stack.core.UaException - if accessing/browsing the OPC UA model fails
    • retrieveChildsOfChildNodes

      public void retrieveChildsOfChildNodes(String currentPath, List<? extends org.eclipse.milo.opcua.sdk.client.nodes.UaNode> parentNodes)
      Retrieving/caching child nodes via path.
      Parameters:
      currentPath - the current path to be attached
      parentNodes - the parent nodes to process
    • retrieveChildsOfChildNodes

      private void retrieveChildsOfChildNodes(List<? extends org.eclipse.milo.opcua.sdk.client.nodes.UaNode> parentNodes)
      Retrieving/caching child nodes via NodeIDs.
      Parameters:
      parentNodes - the parent nodes to process
    • get

      public Object get(String qName) throws IOException
      Throws:
      IOException
    • get

      public Object get(String qName, int lifetime) throws IOException
      Throws:
      IOException
    • set

      public void set(String qName, Object value) throws IOException
      Throws:
      IOException
    • getStruct

      public <T> T getStruct(String qName, Class<T> type) throws IOException
      Throws:
      IOException
    • setStruct

      public void setStruct(String qName, Object value) throws IOException
      Throws:
      IOException
    • getEncodingId

      private org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeId getEncodingId(Class<?> cls) throws IOException
      Returns the encodingId of a custom type.
      Parameters:
      cls - the type class
      Returns:
      the encodingId
      Throws:
      IOException - if the encodingID cannot be found
    • registerCustomType

      public void registerCustomType(Class<?> cls) throws IOException
      Throws:
      IOException
    • getConnectorParameter

      public de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()
      Specified by:
      getConnectorParameter in class de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
    • monitor

      public void monitor(int notificationInterval, String... qName) throws IOException
      Throws:
      IOException
    • monitorModelChanges

      public void monitorModelChanges(int notificationInterval) throws IOException
      Throws:
      IOException
    • onSubscriptionValue

      private void onSubscriptionValue(org.eclipse.milo.opcua.sdk.client.api.subscriptions.UaMonitoredItem item, org.eclipse.milo.opcua.stack.core.types.builtin.DataValue value)
      Is called on changing a monitored item.
      Parameters:
      item - the monitored item
      value - the new data value
    • onEvent

      private void onEvent(org.eclipse.milo.opcua.sdk.client.api.subscriptions.UaMonitoredItem item, org.eclipse.milo.opcua.stack.core.types.builtin.Variant[] var)
      Is called when a monitoring event occurs.
      Parameters:
      item - the monitored item
      var - the changed values/variants
    • stepInto

      public OpcUaConnector<CO,CI>.OpcUaModelAccess stepInto(String name) throws IOException
      Throws:
      IOException
    • stepOut

      public OpcUaConnector<CO,CI>.OpcUaModelAccess stepOut()