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
-
Nested Class Summary
Nested classes/interfaces inherited from class de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
de.iip_ecosphere.platform.connectors.model.AbstractModelAccess.NotificationChangedListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate OpcUaConnector.NodeCacheEntryprivate Stringprivate OpcUaConnector.OpcInputConverterprivate Map<String, OpcUaConnector.NodeCacheEntry> private OpcUaConnector<CO,CI>.OpcUaModelAccess -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCreates the instance and binds the listener to the creating connector instance.protectedOpcUaModelAccess(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. -
Method Summary
Modifier and TypeMethodDescriptionprivate voidbrowseNode(String indent, org.eclipse.milo.opcua.stack.core.types.builtin.NodeId browseRoot) Just for testing, see Identifiers.RootFolder.de.iip_ecosphere.platform.connectors.ConnectorParameterprivate org.eclipse.milo.opcua.stack.core.types.builtin.ExpandedNodeIdgetEncodingId(Class<?> cls) Returns the encodingId of a custom type.de.iip_ecosphere.platform.connectors.model.ModelInputConverterReturns the input converter instance.de.iip_ecosphere.platform.connectors.model.ModelOutputConverterReturns the output converter instance.<T> TvoidvoidmonitorModelChanges(int notificationInterval) private voidonEvent(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.private voidonSubscriptionValue(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.voidregisterCustomType(Class<?> cls) private OpcUaConnector.NodeCacheEntryretrieveCacheEntry(String qName) Retrieves a node starting at the root of the OPC UA model based on the node's qualified nameqName.voidretrieveChildsOfChildNodes(String currentPath, List<? extends org.eclipse.milo.opcua.sdk.client.nodes.UaNode> parentNodes) Retrieving/caching child nodes via path.private voidretrieveChildsOfChildNodes(List<? extends org.eclipse.milo.opcua.sdk.client.nodes.UaNode> parentNodes) Retrieving/caching child nodes via NodeIDs.private org.eclipse.milo.opcua.sdk.client.nodes.UaNoderetrieveNode(String qName) Retrieves a node starting atcurrentrecursively following the path given byqName.private org.eclipse.milo.opcua.sdk.client.nodes.UaNoderetrieveNode(org.eclipse.milo.opcua.sdk.client.nodes.UaNode current, String qName, String constqName) Retrieves a node starting atcurrentrecursively following the path given byqName.private org.eclipse.milo.opcua.sdk.client.nodes.UaVariableNoderetrieveVariableNode(String qName, OpcUaConnector.NodeCacheEntry entry) Retrieves an OPC UA variable node from a cache node entry.voidvoidstepOut()Methods inherited from class de.iip_ecosphere.platform.connectors.model.AbstractModelAccess
iqName, isDetailNotifiedItemEnabled, monitor, monitorModelChanges, qName, setDetailNotifiedItem, useNotifications, useNotificationsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.iip_ecosphere.platform.connectors.model.ModelAccess
dispose, getBigDecimal, getBigInteger, getBoolean, getByte, getByteArray, getDate, getDouble, getDoubleArray, getElementList, getEnum, getFloat, getFloatIndex, getInt, getInteger, getIntegerArray, getList, getLocalDateTime, getLong, getLongIndex, getMultiValue, getObject, getShort, getString, getStringArray, setBigDecimal, setBigInteger, setBoolean, setByte, setByteArray, setDate, setDouble, setDoubleArray, setElementList, setEnum, setEnumAsName, setFloat, setFloatIndex, setInt, setInteger, setIntegerArray, setList, setLocalDateTime, setLong, setLongIndex, setMultiValue, setMultiValue, setObject, setShort, setString, setStringArray
-
Field Details
-
nodes
-
base
-
basePath
-
parent
-
inputConverter
-
outputConverter
-
-
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 onbasePath- the base path this context representeparent- the parent to return to instepOut()nodes- the (parent) nodes cache to use
-
-
Method Details
-
topInstancesQName
-
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
- 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 indentbrowseRoot- 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 forqNameor if the found node is not a variable nodeorg.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 nameqName. Takes into accountthe nodes cache.- Parameters:
qName- the qualified node name- Returns:
- the node
- Throws:
IOException- if no node can be found forqNameorg.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 atcurrentrecursively following the path given byqName.- 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 atcurrentrecursively following the path given byqName.- Parameters:
current- the current node to start searching for, may be null for top-levelqName- the qualified node nameconstqName- 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 attachedparentNodes- 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
- Throws:
IOException
-
get
- Throws:
IOException
-
set
- Throws:
IOException
-
getStruct
- Throws:
IOException
-
setStruct
- 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
- Throws:
IOException
-
getConnectorParameter
public de.iip_ecosphere.platform.connectors.ConnectorParameter getConnectorParameter()- Specified by:
getConnectorParameterin classde.iip_ecosphere.platform.connectors.model.AbstractModelAccess
-
monitor
- Throws:
IOException
-
monitorModelChanges
- 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 itemvalue- 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 itemvar- the changed values/variants
-
stepInto
- Throws:
IOException
-
stepOut
-