com.aelitis.azureus.core.speedmanager.impl.v2
Class PingSpaceMonitor

java.lang.Object
  extended by com.aelitis.azureus.core.speedmanager.impl.v2.PingSpaceMonitor

public class PingSpaceMonitor
extends Object

Created on Jun 29, 2007 Created by Alan Snyder Copyright (C) Azureus Software, Inc, All Rights Reserved.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


Field Summary
static int DOWNLOAD
           
static int NONE
           
static int UPLOAD
           
 
Constructor Summary
PingSpaceMonitor(int _maxGoodPing, int _minBadPing, TransferMode mode)
           
 
Method Summary
 boolean addToPingMapData(int lastMetricValue, TransferMode mode)
          Do a check and decide if the limits should be dropped.
 int getNewLimit()
           
 int limitType()
           
 void reset(TransferMode mode)
           
 void resetNewLimit()
          Call after getting new limits.
 void setCurrentTransferRates(int downRate, int upRate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPLOAD

public static final int UPLOAD
See Also:
Constant Field Values

DOWNLOAD

public static final int DOWNLOAD
See Also:
Constant Field Values

NONE

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

PingSpaceMonitor

public PingSpaceMonitor(int _maxGoodPing,
                        int _minBadPing,
                        TransferMode mode)
Method Detail

setCurrentTransferRates

public void setCurrentTransferRates(int downRate,
                                    int upRate)
Parameters:
downRate - -
upRate - -

addToPingMapData

public boolean addToPingMapData(int lastMetricValue,
                                TransferMode mode)
Do a check and decide if the limits should be dropped.

Parameters:
lastMetricValue - -
mode - - the TransferMode
Returns:
- true if the limits should be dropped.

reset

public void reset(TransferMode mode)

getNewLimit

public int getNewLimit()

limitType

public int limitType()

resetNewLimit

public void resetNewLimit()
Call after getting new limits.