Modifier and Type | Field and Description |
---|---|
static int |
MAX_FRAGMENTS |
Constructor and Description |
---|
InboundMessageState(RouterContext ctx,
long messageId,
Hash from) |
InboundMessageState(RouterContext ctx,
long messageId,
Hash from,
UDPPacketReader.DataReader data,
int dataFragment)
Create a new IMS and read in the data from the fragment.
|
Modifier and Type | Method and Description |
---|---|
ACKBitfield |
createACKBitfield() |
void |
drop()
For CDQ
|
int |
getCompleteSize() |
long |
getEnqueueTime()
For CDQ
|
int |
getFragmentCount() |
ByteArray[] |
getFragments() |
Hash |
getFrom() |
long |
getLifetime() |
long |
getMessageId() |
boolean |
isComplete()
May not be valid after released.
|
boolean |
isExpired() |
boolean |
receiveFragment(UDPPacketReader.DataReader data,
int dataFragment)
Read in the data from the fragment.
|
void |
releaseResources() |
void |
setEnqueueTime(long now)
For CDQ
|
String |
toString()
May not be valid if released, or may NPE on race with release, use with care in exception text
|
public static final int MAX_FRAGMENTS
public InboundMessageState(RouterContext ctx, long messageId, Hash from)
public InboundMessageState(RouterContext ctx, long messageId, Hash from, UDPPacketReader.DataReader data, int dataFragment) throws DataFormatException
DataFormatException
- if the fragment was corruptpublic boolean receiveFragment(UDPPacketReader.DataReader data, int dataFragment)
public boolean isComplete()
public boolean isExpired()
public long getLifetime()
public void setEnqueueTime(long now)
setEnqueueTime
in interface CDQEntry
public long getEnqueueTime()
getEnqueueTime
in interface CDQEntry
public Hash getFrom()
public long getMessageId()
public int getCompleteSize()
IllegalStateException
- if released or not isComplete()public ACKBitfield createACKBitfield()
public void releaseResources()
public ByteArray[] getFragments()
IllegalStateException
- if releasedpublic int getFragmentCount()