com.aelitis.azureus.core.networkmanager.impl
Class TransferProcessor

java.lang.Object
  extended by com.aelitis.azureus.core.networkmanager.impl.TransferProcessor

public class TransferProcessor
extends Object


Field Summary
static int TYPE_DOWNLOAD
           
static int TYPE_UPLOAD
           
 
Constructor Summary
TransferProcessor(int _processor_type, LimitedRateGroup max_rate_limit, boolean multi_threaded)
          Create new transfer processor for the given read/write type, limited to the given max rate.
 
Method Summary
 void addRateLimiter(NetworkConnectionBase connection, LimitedRateGroup group)
           
 void deregisterPeerConnection(NetworkConnectionBase connection)
          Cancel upload handling for the given peer connection.
 void downgradePeerConnection(NetworkConnectionBase connection)
          Downgrade the given connection back to a normal-speed transfer handler.
 List<NetworkConnectionBase> getConnections()
           
 RateHandler getRateHandler()
           
 RateHandler getRateHandler(NetworkConnectionBase connection)
           
 boolean isRegistered(NetworkConnectionBase connection)
           
 void registerPeerConnection(NetworkConnectionBase connection, boolean upload)
          Register peer connection for upload handling.
 void removeRateLimiter(NetworkConnectionBase connection, LimitedRateGroup group)
           
 void setRateLimiterFreezeState(boolean frozen)
           
 void upgradePeerConnection(NetworkConnectionBase connection, int partition_id)
          Upgrade the given connection to a high-speed transfer handler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_UPLOAD

public static final int TYPE_UPLOAD
See Also:
Constant Field Values

TYPE_DOWNLOAD

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

TransferProcessor

public TransferProcessor(int _processor_type,
                         LimitedRateGroup max_rate_limit,
                         boolean multi_threaded)
Create new transfer processor for the given read/write type, limited to the given max rate.

Parameters:
processor_type - read or write processor
max_rate_limit - to use
Method Detail

registerPeerConnection

public void registerPeerConnection(NetworkConnectionBase connection,
                                   boolean upload)
Register peer connection for upload handling. NOTE: The given max rate limit is ignored until the connection is upgraded.

Parameters:
connection - to register
group - rate limit group

getConnections

public List<NetworkConnectionBase> getConnections()

isRegistered

public boolean isRegistered(NetworkConnectionBase connection)

deregisterPeerConnection

public void deregisterPeerConnection(NetworkConnectionBase connection)
Cancel upload handling for the given peer connection.

Parameters:
connection - to cancel

setRateLimiterFreezeState

public void setRateLimiterFreezeState(boolean frozen)

addRateLimiter

public void addRateLimiter(NetworkConnectionBase connection,
                           LimitedRateGroup group)

removeRateLimiter

public void removeRateLimiter(NetworkConnectionBase connection,
                              LimitedRateGroup group)

upgradePeerConnection

public void upgradePeerConnection(NetworkConnectionBase connection,
                                  int partition_id)
Upgrade the given connection to a high-speed transfer handler.

Parameters:
connection - to upgrade

downgradePeerConnection

public void downgradePeerConnection(NetworkConnectionBase connection)
Downgrade the given connection back to a normal-speed transfer handler.

Parameters:
connection - to downgrade

getRateHandler

public RateHandler getRateHandler()

getRateHandler

public RateHandler getRateHandler(NetworkConnectionBase connection)