Class FRAG3.FragEntry

  • Enclosing class:
    FRAG3

    protected 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, boolean needs_deserialization)
      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
      • needs_deserialization

        protected final boolean needs_deserialization
    • Constructor Detail

      • FragEntry

        protected FragEntry​(int num_frags,
                            boolean needs_deserialization)
        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()
                                   throws java.lang.Exception
        Assembles all the fragments into one buffer. Takes all Messages, and combines their buffers into one buffer.
        Returns:
        the complete message in one buffer
        Throws:
        java.lang.Exception
      • toString

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