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 TypeMethodDescriptioncreateIface
(BinaryMsgSession session, I node) Return an instance of the custom iface for the specified node.default T
getIface
(String name, BinaryMsgSession session) Handle iface checks and only callcreateIface
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
Return a node instance for the specifiednodeId
but only if the instance already exists.Given a nodeId, return aIfaceAwareNode
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
Given a nodeId, return aIfaceAwareNode
instance for the node. Thecreate
argument will be true when callinggetNode()
due to an incoming iface connection. This is an indication that if a node instance doesn't yet exist for the specifiednodeId
, one should be created. Ifcreate
is false, this is call fromgetNode(nodeId)
which should only return an existing instance.- Parameters:
nodeId
- id of the node to bind an iface tocreate
- if true, create a node instance if required
-
getNode
Return a node instance for the specifiednodeId
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
Handle iface checks and only callcreateIface
for matching iface.- Specified by:
getIface
in interfaceBinaryMsgIfaceFactory
- Parameters:
name
- the name of the interfacesession
- the session to back the interface- Returns:
- the iface or null
-
createIface
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 viagetIface()
. This will be called every time the adapter connects to the service.
-