|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.i2p.router.transport.udp.InboundMessageState
class InboundMessageState
Hold the raw data fragments of an inbound message. Warning - there is no synchronization in this class, take care in InboundMessageFragments to avoid use-after-release, etc.
Field Summary | |
---|---|
static int |
MAX_FRAGMENTS
|
static int |
MAX_PARTIAL_BITFIELD_BYTES
10 |
Constructor Summary | |
---|---|
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. |
Method Summary | |
---|---|
ACKBitfield |
createACKBitfield()
FIXME synch here or PeerState.fetchPartialACKs() |
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int MAX_FRAGMENTS
public static final int MAX_PARTIAL_BITFIELD_BYTES
Constructor Detail |
---|
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 corruptMethod Detail |
---|
public boolean receiveFragment(UDPPacketReader.DataReader data, int dataFragment) throws DataFormatException
DataFormatException
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 void drop()
drop
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()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |