net.i2p.router.transport.udp
Class InboundMessageState

java.lang.Object
  extended by net.i2p.router.transport.udp.InboundMessageState

public class InboundMessageState
extends java.lang.Object

Hold the raw data fragments of an inbound message


Field Summary
static int MAX_FRAGMENTS
           
 
Constructor Summary
InboundMessageState(RouterContext ctx, long messageId, Hash from)
           
 
Method Summary
 ACKBitfield createACKBitfield()
           
 int getCompleteSize()
           
 int getFragmentCount()
           
 ByteArray[] getFragments()
           
 Hash getFrom()
           
 long getLifetime()
           
 long getMessageId()
           
 boolean isComplete()
           
 boolean isExpired()
           
 boolean receiveFragment(UDPPacketReader.DataReader data, int dataFragment)
          Read in the data from the fragment.
 void releaseResources()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MAX_FRAGMENTS

public static final int MAX_FRAGMENTS
See Also:
Constant Field Values
Constructor Detail

InboundMessageState

public InboundMessageState(RouterContext ctx,
                           long messageId,
                           Hash from)
Method Detail

receiveFragment

public boolean receiveFragment(UDPPacketReader.DataReader data,
                               int dataFragment)
Read in the data from the fragment.

Returns:
true if the data was ok, false if it was corrupt

isComplete

public boolean isComplete()

isExpired

public boolean isExpired()

getLifetime

public long getLifetime()

getFrom

public Hash getFrom()

getMessageId

public long getMessageId()

getCompleteSize

public int getCompleteSize()

createACKBitfield

public ACKBitfield createACKBitfield()

releaseResources

public void releaseResources()

getFragments

public ByteArray[] getFragments()

getFragmentCount

public int getFragmentCount()

toString

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