Interface DeviceContext
public interface DeviceContext
-
Method Summary
Modifier and TypeMethodDescriptionGet theDecodedResourcethis device's configuration was created from.Get thePathto a folder this device can use to store files if needed.default org.eclipse.milo.opcua.stack.core.types.builtin.NodeIdgetName()org.eclipse.milo.opcua.stack.core.types.builtin.unsigned.UShortorg.eclipse.milo.opcua.stack.core.types.builtin.NodeIdorg.eclipse.milo.opcua.sdk.server.OpcUaServerGet theDeviceSubscriptionModel.default org.eclipse.milo.opcua.stack.core.types.builtin.NodeIdConvenience method for creating aNodeIdbelonging to this device.default org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedNamequalifiedName(String name) Convenience method for creating aQualifiedNamewith the same namespace index as this device.
-
Method Details
-
getGatewayContext
GatewayContext getGatewayContext()- Returns:
- the
GatewayContext.
-
getName
String getName()- Returns:
- the name of
Devicethat 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
NodeIdof the root "Devices" folder.
-
getDeviceNodeId
default org.eclipse.milo.opcua.stack.core.types.builtin.NodeId getDeviceNodeId()- Returns:
- the
NodeIdthat should be used for this device's root folder.
-
getServer
org.eclipse.milo.opcua.sdk.server.OpcUaServer getServer()- Returns:
- the
OpcUaServerinstance.
-
getSubscriptionModel
DeviceSubscriptionModel getSubscriptionModel()Get theDeviceSubscriptionModel.On startup a
Deviceshould 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 thePathto 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
Pathto a folder this device can use to store files if needed.
-
getDecodedResource
DecodedResource<ExtensionPointConfig<DeviceProfileConfig,?>> getDecodedResource()Get theDecodedResourcethis device's configuration was created from.This can be useful if the implementation needs access to the underlying raw
Resourcethat the profile and settings configurations were created from.- Returns:
- the
DecodedResourcethis device's configuration was created from.
-
nodeId
Convenience method for creating aNodeIdbelonging to this device.Creates a
NodeIdwith a String identifier of the form:"[%s]%s".formatted(getName(), id).- Parameters:
id- the identifier to use.- Returns:
- a
NodeIdbelonging to this device.
-
qualifiedName
Convenience method for creating aQualifiedNamewith the same namespace index as this device.- Parameters:
name- the name portion of theQualifiedName.- Returns:
- a
QualifiedNamewith the same namespace index as this device.
-