Interface IfaceAwareNodeService<T extends BinaryMsgIface,I extends IfaceAwareNode>

All Superinterfaces:
BinaryMsgIfaceFactory

public interface IfaceAwareNodeService<T extends BinaryMsgIface,I extends IfaceAwareNode> extends BinaryMsgIfaceFactory
TODO
Version:
2025-06-19
  • Method Summary

    Modifier and Type
    Method
    Description
    createIface(BinaryMsgSession session, I node)
    Return an instance of the custom iface for the specified node.
    default T
    Handle iface checks and only call createIface for matching iface.
    Return the name of the iface for this service.
    Return a reference to the manifest service which is used to verify that connecting nodes are defined in the device manifest.
    default I
    getNode(NodeId nodeId)
    Return a node instance for the specified nodeId but only if the instance already exists.
    getNode(NodeId nodeId, boolean create)
    Given a nodeId, return a IfaceAwareNode instance for the node.
  • Method Details

    • getManifestService

      ManifestService getManifestService()
      Return a reference to the manifest service which is used to verify that connecting nodes are defined in the device manifest.
    • getIfaceName

      String getIfaceName()
      Return the name of the iface for this service.
    • getNode

      I getNode(NodeId nodeId, boolean create)
      Given a nodeId, return a IfaceAwareNode instance for the node. The create argument will be true when calling getNode() due to an incoming iface connection. This is an indication that if a node instance doesn't yet exist for the specified nodeId , one should be created. If create is false, this is call from getNode(nodeId) which should only return an existing instance.
      Parameters:
      nodeId - id of the node to bind an iface to
      create - if true, create a node instance if required
    • getNode

      default I getNode(NodeId nodeId)
      Return a node instance for the specified nodeId but only if the instance already exists. This can be used in normal use cases where checking the existence of an instance shouldn't cause the instance to be created.
      Parameters:
      nodeId - the nodeId to return an instance for
    • getIface

      default T getIface(String name, BinaryMsgSession session)
      Handle iface checks and only call createIface for matching iface.
      Specified by:
      getIface in interface BinaryMsgIfaceFactory
      Parameters:
      name - the name of the interface
      session - the session to back the interface
      Returns:
      the iface or null
    • createIface

      T createIface(BinaryMsgSession session, I node)
      Return an instance of the custom iface for the specified node. This is called when the adapter for the service connects to java. The iface returned by this method can be accessed via getIface() . This will be called every time the adapter connects to the service.