Class BroadcastMessage

java.lang.Object
pt.unl.fct.di.novasys.babel.generic.ProtoMessage
pt.unl.fct.di.novasys.babel.protocols.dissemination.messages.IdentifiableProtoMessage
protocols.broadcast.flood.messages.BroadcastMessage

public class BroadcastMessage extends pt.unl.fct.di.novasys.babel.protocols.dissemination.messages.IdentifiableProtoMessage
The flood's own wire message. It extends IdentifiableProtoMessage, the canonical ParadigmShift base for broadcast messages: a UUID message-id (the "MID") is generated when the broadcast protocol creates the message, carried unchanged across every hop, and used to deduplicate. The broadcast protocol dedups on IdentifiableProtoMessage.getMID() and calls generateDeliveryNotification(short) to build the application-facing BroadcastDelivery — so the message id lives on the message, not in the protocol's send path. (Same pattern as the production GossipMessage.)

Besides the inherited MID it carries the original sender and the issue timestamp (so every receiver reconstructs an identical delivery) and the opaque application payload.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final short
     
    static final pt.unl.fct.di.novasys.network.ISerializer<BroadcastMessage>
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    BroadcastMessage(pt.unl.fct.di.novasys.network.data.Host sender, Timestamp timestamp, byte[] content)
    A fresh broadcast initiated locally — IdentifiableProtoMessage assigns a new MID.
  • Method Summary

    Modifier and Type
    Method
    Description
    pt.unl.fct.di.novasys.babel.protocols.dissemination.notifications.BroadcastDelivery
    generateDeliveryNotification(short sourceProtoID)
     
    byte[]
     
    pt.unl.fct.di.novasys.network.data.Host
     
     
     

    Methods inherited from class pt.unl.fct.di.novasys.babel.protocols.dissemination.messages.IdentifiableProtoMessage

    getMID

    Methods inherited from class pt.unl.fct.di.novasys.babel.generic.ProtoMessage

    getId

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • BroadcastMessage

      public BroadcastMessage(pt.unl.fct.di.novasys.network.data.Host sender, Timestamp timestamp, byte[] content)
      A fresh broadcast initiated locally — IdentifiableProtoMessage assigns a new MID.
  • Method Details

    • generateDeliveryNotification

      public pt.unl.fct.di.novasys.babel.protocols.dissemination.notifications.BroadcastDelivery generateDeliveryNotification(short sourceProtoID)
      Specified by:
      generateDeliveryNotification in class pt.unl.fct.di.novasys.babel.protocols.dissemination.messages.IdentifiableProtoMessage
    • getSender

      public pt.unl.fct.di.novasys.network.data.Host getSender()
    • getTimestamp

      public Timestamp getTimestamp()
    • getContent

      public byte[] getContent()
    • toString

      public String toString()
      Overrides:
      toString in class Object