public interface DeviceContext
  • Method Details

    • getGatewayContext

      GatewayContext getGatewayContext()
      Returns:
      the GatewayContext.
    • getName

      String getName()
      Returns:
      the name of Device that received this DeviceContext.
    • 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 the DeviceSubscriptionModel.

      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 the Path 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

      Get the DecodedResource 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

      default org.eclipse.milo.opcua.stack.core.types.builtin.NodeId nodeId(Object id)
      Convenience method for creating a NodeId 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

      default org.eclipse.milo.opcua.stack.core.types.builtin.QualifiedName qualifiedName(String name)
      Convenience method for creating a QualifiedName with the same namespace index as this device.
      Parameters:
      name - the name portion of the QualifiedName.
      Returns:
      a QualifiedName with the same namespace index as this device.