Interface DeviceContext
public interface DeviceContext
-
Method Summary
Modifier and TypeMethodDescriptionGet theDecodedResource
this device's configuration was created from.Get thePath
to a folder this device can use to store files if needed.default org.eclipse.milo.opcua.stack.core.types.builtin.NodeId
getName()
org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId
org.eclipse.milo.opcua.sdk.server.OpcUaServer
Get theDeviceSubscriptionModel
.default org.eclipse.milo.opcua.stack.core.types.builtin.NodeId
Convenience method for creating aNodeId
belonging to this device.default org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName
qualifiedName
(String name) Convenience method for creating aQualifiedName
with the same namespace index as this device.
-
Method Details
-
getGatewayContext
GatewayContext getGatewayContext()- Returns:
- the
GatewayContext
.
-
getName
String getName()- Returns:
- the name of
Device
that received thisDeviceContext
.
-
getNamespaceIndex
org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShort getNamespaceIndex()- Returns:
- the index of the OPC UA namespace devices exist in.
-
getNamespaceUri
String getNamespaceUri()- Returns:
- the URI of the OPC UA namespace devices exist in.
-
getRootNodeId
org.eclipse.milo.opcua.stack.core.types.builtin.NodeId getRootNodeId()- Returns:
- the
NodeId
of the root "Devices" folder.
-
getDeviceNodeId
default org.eclipse.milo.opcua.stack.core.types.builtin.NodeId getDeviceNodeId()- Returns:
- the
NodeId
that should be used for this device's root folder.
-
getServer
org.eclipse.milo.opcua.sdk.server.OpcUaServer getServer()- Returns:
- the
OpcUaServer
instance.
-
getSubscriptionModel
DeviceSubscriptionModel getSubscriptionModel()Get theDeviceSubscriptionModel
.On startup a
Device
should query the subscription model for items it's expected to be subscribed to from e.g. a previous lifecycle.- Returns:
- the
DeviceSubscriptionModel
.
-
getDeviceFolderPath
Path getDeviceFolderPath()Get thePath
to a folder this device can use to store files if needed.This is only a Path; the folder may need to be created before it can be used.
- Returns:
- the
Path
to a folder this device can use to store files if needed.
-
getDecodedResource
DecodedResource<ExtensionPointConfig<DeviceProfileConfig,?>> getDecodedResource()Get theDecodedResource
this device's configuration was created from.This can be useful if the implementation needs access to the underlying raw
Resource
that the profile and settings configurations were created from.- Returns:
- the
DecodedResource
this device's configuration was created from.
-
nodeId
Convenience method for creating aNodeId
belonging to this device.Creates a
NodeId
with a String identifier of the form:"[%s]%s".formatted(getName(), id)
.- Parameters:
id
- the identifier to use.- Returns:
- a
NodeId
belonging to this device.
-
qualifiedName
Convenience method for creating aQualifiedName
with the same namespace index as this device.- Parameters:
name
- the name portion of theQualifiedName
.- Returns:
- a
QualifiedName
with the same namespace index as this device.
-