Package net.i2p.router.tunnel
Class PendingGatewayMessage
- java.lang.Object
-
- net.i2p.router.tunnel.PendingGatewayMessage
-
- All Implemented Interfaces:
CDQEntry
- Direct Known Subclasses:
OutboundGatewayMessage
class PendingGatewayMessage extends Object implements CDQEntry
Stores all the state for an unsent or partially-sent message- Since:
- 0.9.3 refactored from TunnelGateway.Pending
-
-
Field Summary
Fields Modifier and Type Field Description protected long
_created
protected long
_expiration
protected int
_fragmentNumber
protected long
_messageId
protected int
_offset
protected byte[]
_remaining
protected Hash
_toRouter
protected TunnelId
_toTunnel
-
Constructor Summary
Constructors Constructor Description PendingGatewayMessage(I2NPMessage message, Hash toRouter, TunnelId toTunnel)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMessageId(long id)
Add an ID to the list of the TunnelDataMssages this message was fragmented into.void
drop()
For CDQbyte[]
getData()
raw unfragmented message to sendlong
getEnqueueTime()
For CDQlong
getExpiration()
int
getFragmentNumber()
which fragment are we working on (0 for the first fragment)long
getLifetime()
long
getMessageId()
List<Long>
getMessageIds()
The IDs of the TunnelDataMssages this message was fragmented into.int
getOffset()
index into the data to be sentHash
getToRouter()
may be nullTunnelId
getToTunnel()
may be nullvoid
incrementFragmentNumber()
ok, fragment sent, increment what the next will bevoid
setEnqueueTime(long now)
For CDQvoid
setOffset(int offset)
move the offsetString
toString()
-
-
-
Field Detail
-
_toRouter
protected final Hash _toRouter
-
_toTunnel
protected final TunnelId _toTunnel
-
_messageId
protected final long _messageId
-
_expiration
protected final long _expiration
-
_remaining
protected final byte[] _remaining
-
_offset
protected int _offset
-
_fragmentNumber
protected int _fragmentNumber
-
_created
protected final long _created
-
-
Constructor Detail
-
PendingGatewayMessage
public PendingGatewayMessage(I2NPMessage message, Hash toRouter, TunnelId toTunnel)
-
-
Method Detail
-
getToRouter
public Hash getToRouter()
may be null
-
getToTunnel
public TunnelId getToTunnel()
may be null
-
getMessageId
public long getMessageId()
-
getExpiration
public long getExpiration()
-
getData
public byte[] getData()
raw unfragmented message to send
-
getOffset
public int getOffset()
index into the data to be sent
-
setOffset
public void setOffset(int offset)
move the offset
-
getLifetime
public long getLifetime()
-
getFragmentNumber
public int getFragmentNumber()
which fragment are we working on (0 for the first fragment)
-
incrementFragmentNumber
public void incrementFragmentNumber()
ok, fragment sent, increment what the next will be
-
addMessageId
public void addMessageId(long id)
Add an ID to the list of the TunnelDataMssages this message was fragmented into. Unused except in notePreprocessing() calls for debugging
-
getMessageIds
public List<Long> getMessageIds()
The IDs of the TunnelDataMssages this message was fragmented into. Unused except in notePreprocessing() calls for debugging
-
setEnqueueTime
public void setEnqueueTime(long now)
For CDQ- Specified by:
setEnqueueTime
in interfaceCDQEntry
- Since:
- 0.9.3
-
getEnqueueTime
public long getEnqueueTime()
For CDQ- Specified by:
getEnqueueTime
in interfaceCDQEntry
- Since:
- 0.9.3
-
-