net.i2p.router.tunnel
Class TrivialPreprocessor

java.lang.Object
  extended bynet.i2p.router.tunnel.TrivialPreprocessor
All Implemented Interfaces:
TunnelGateway.QueuePreprocessor
Direct Known Subclasses:
TrivialRouterPreprocessor

public class TrivialPreprocessor
extends java.lang.Object
implements TunnelGateway.QueuePreprocessor

Do the simplest thing possible for preprocessing - for each message available, turn it into the minimum number of fragmented preprocessed blocks, sending each of those out. This does not coallesce message fragments or delay for more optimal throughput.


Field Summary
(package private) static int PREPROCESSED_SIZE
           
 
Constructor Summary
TrivialPreprocessor(I2PAppContext ctx)
           
 
Method Summary
protected  void notePreprocessing(long messageId, int numFragments)
           
 boolean preprocessQueue(java.util.List pending, TunnelGateway.Sender sender, TunnelGateway.Receiver rec)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PREPROCESSED_SIZE

static final int PREPROCESSED_SIZE
See Also:
Constant Field Values
Constructor Detail

TrivialPreprocessor

public TrivialPreprocessor(I2PAppContext ctx)
Method Detail

preprocessQueue

public boolean preprocessQueue(java.util.List pending,
                               TunnelGateway.Sender sender,
                               TunnelGateway.Receiver rec)
Specified by:
preprocessQueue in interface TunnelGateway.QueuePreprocessor
Parameters:
pending - list of Pending objects for messages either unsent or partly sent. This list should be update with any values removed (the preprocessor owns the lock)
Returns:
true if we should delay before preprocessing again

notePreprocessing

protected void notePreprocessing(long messageId,
                                 int numFragments)