Class IGMPGroup

  • Direct Known Subclasses:
    IGMPMembership, IGMPQuery

    public abstract class IGMPGroup
    extends java.lang.Object
    A class to represent Groups for membership query and reports.
    • Constructor Summary

      Constructors 
      Constructor Description
      IGMPGroup()  
      IGMPGroup​(IpAddress gaddr, int auxInfo)
      Initialize this object with a multicast group address and additional info.
    • Field Detail

      • auxInfo

        protected int auxInfo
      • sources

        protected java.util.List<IpAddress> sources
    • Constructor Detail

      • IGMPGroup

        public IGMPGroup()
      • IGMPGroup

        public IGMPGroup​(IpAddress gaddr,
                         int auxInfo)
        Initialize this object with a multicast group address and additional info.
        Parameters:
        gaddr - the multicast group address for this message type.
        auxInfo - additional info potentially used by IGMPQuery
    • Method Detail

      • getGaddr

        public IpAddress getGaddr()
        Get the multicast group address.
        Returns:
        the group address
      • getAuxInfo

        public int getAuxInfo()
        Get the auxillary info.
        Returns:
        the auxillary info
      • addSource

        public void addSource​(IpAddress saddr)
        Add a unicast source address to this message.
        Parameters:
        saddr - IPv4 unicast source address
      • getSources

        public java.util.List<IpAddress> getSources()
        Return the list of source addresses.
        Returns:
        list of source addresses
      • deserialize

        public abstract IGMPGroup deserialize​(java.nio.ByteBuffer bb)
                                       throws DeserializationException
        Deserialize an IGMPQuery or IGMPMembership message.
        Parameters:
        bb - the ByteBuffer wrapping the serialized message. The position of the ByteBuffer should be pointing at the head of either message type.
        Returns:
        An object populated with the respective IGMPGroup subclass
        Throws:
        DeserializationException - in case deserialization goes wrong
      • serialize

        public abstract byte[] serialize​(java.nio.ByteBuffer bb)
        Serialize the IGMPGroup subclass.
        Parameters:
        bb - the ByteBuffer to write into, positioned at the next spot to be written to.
        Returns:
        The serialized message
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object