Class FRAG3.FragEntry

  • Enclosing class:
    FRAG3

    protected static class FRAG3.FragEntry
    extends java.lang.Object
    Entry for a full message, received fragments are copied into buffer and set in the bitset of expected frags. When complete, the buffer is set in the resulting message and the message returned.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected FragEntry​(int num_frags)
      Creates a new entry
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected Message assembleMessage()
      Assembles all the fragments into one buffer.
      protected boolean isComplete()
      Returns true if this fragmentation is complete, ie all fragments have been received for this buffer
      Message set​(Message frag_msg, Frag3Header hdr)
      Adds a fragment to the full message
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • lock

        protected final java.util.concurrent.locks.Lock lock
      • buffer

        protected byte[] buffer
      • num_frags

        protected final int num_frags
    • Constructor Detail

      • FragEntry

        protected FragEntry​(int num_frags)
        Creates a new entry
        Parameters:
        num_frags - the number of fragments expected for this message
    • Method Detail

      • isComplete

        protected boolean isComplete()
        Returns true if this fragmentation is complete, ie all fragments have been received for this buffer
      • assembleMessage

        protected Message assembleMessage()
        Assembles all the fragments into one buffer. Takes all Messages, and combines their buffers into one buffer.
        Returns:
        the complete message in one buffer
      • toString

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