Class LocalNetworkDiscoveryProtocol
java.lang.Object
pt.unl.fct.di.novasys.babel2.protocols.discovery.LocalNetworkDiscoveryProtocol
- All Implemented Interfaces:
BabelProtocol, ResolverProviderBabelProtocol
Protocol that discovers peer nodes on local networks using multicast/broadcast probes and answers.
Implements ResolverProviderBabelProtocol to resolve IPBabelNodeComponent endpoints
dynamically when probes are triggered by other protocols.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new local network discovery protocol instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidinit(Babel runtime, ComposedBabelChannel composedChannel) Initiates the protocol's logic and execution.voiduponBabelNodeAnswer(BabelNodeAnswer msg, BabelNode sender) Handles incoming discovery answers, registering open channel endpoints into theNodeStoreand completing pending component resolution.voiduponBabelNodeProbe(BabelNode node) Called when a Babel node is probed.voiduponBabelNodeProbeMessage(BabelNodeProbeMessage msg, BabelNode sender) Handles incoming discovery probes from peer nodes.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface BabelProtocol
connectionDown, connectionFailed, connectionUp, pause, resume, stopModifier and TypeMethodDescriptiondefault voidconnectionDown(BabelNode peer, @Nullable Throwable cause) Invoked when a previously established connection topeerhas been closed, either locally or remotely.default voidconnectionFailed(BabelNode peer, @Nullable Throwable cause) Invoked when an outgoing connection attempt topeerfailed before a connection could be established.default voidconnectionUp(BabelNode peer) Invoked when an outgoing connection topeerhas been established successfully through the protocol's assignedBabelChannel.default voidpause()Suspends the protocol's operations.default voidresume(Babel runtime, ComposedBabelChannel channel) Reinstates the protocol's execution from a paused state.default voidstop()Completely halt the protocols execution.
-
Constructor Details
-
LocalNetworkDiscoveryProtocol
Constructs a new local network discovery protocol instance.- Parameters:
store- the node store for registering discovered node components
-
-
Method Details
-
init
Description copied from interface:BabelProtocolInitiates the protocol's logic and execution. This method is managed internally by the Babel runtime and should not be invoked directly by external components.- Specified by:
initin interfaceBabelProtocol- Parameters:
runtime- the Babel runtimecomposedChannel- the channel assigned to this protocol
-
uponBabelNodeProbe
Description copied from interface:ResolverProviderBabelProtocolCalled when a Babel node is probed.- Specified by:
uponBabelNodeProbein interfaceResolverProviderBabelProtocol- Parameters:
node- the probed node
-
uponBabelNodeProbeMessage
Handles incoming discovery probes from peer nodes. If this node is the probed target, responds with an answer containing all local open channels.- Parameters:
msg- the received probe messagesender- the node that sent the probe
-
uponBabelNodeAnswer
Handles incoming discovery answers, registering open channel endpoints into theNodeStoreand completing pending component resolution.- Parameters:
msg- the received answer message containing channel informationsender- the node responding with channel info
-