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

java.lang.Object
  extended by com.aelitis.azureus.core.speedmanager.impl.v2.SpeedManagerAlgorithmProviderPingMap
All Implemented Interfaces:
SpeedManagerAlgorithmProvider, COConfigurationListener

public class SpeedManagerAlgorithmProviderPingMap
extends Object
implements SpeedManagerAlgorithmProvider, COConfigurationListener

Created on Aug 5, 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
 
Fields inherited from interface com.aelitis.azureus.core.speedmanager.impl.SpeedManagerAlgorithmProvider
UPDATE_PERIOD_MILLIS
 
Method Summary
 void calculate(SpeedManagerPingSource[] sources)
          Called whenever a new set of ping values is available for processing
 void configurationSaved()
           
 void destroy()
           
 boolean getAdjustsDownloadLimits()
          Indicates whether or not the provider is adjusting download as well as upload limits
 int getCurrentChokeSpeed()
          Returns the current view of when choking occurs
 int getCurrentPingMillis()
           
 int getIdlePingMillis()
          Various getters for interesting info shown in stats view
 int getMaxPingMillis()
           
 int getMaxUploadSpeed()
           
protected  void log(String str)
           
 void pingSourceFailed(SpeedManagerPingSource source)
          Ping source has failed
 void pingSourceFound(SpeedManagerPingSource source, boolean is_replacement)
          Called when a new source of ping times has been found
 void reset()
          Reset any state to start of day values
 void updateStats()
          Called periodically (see period above) to allow stats to be updated.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

destroy

public void destroy()
Specified by:
destroy in interface SpeedManagerAlgorithmProvider

configurationSaved

public void configurationSaved()
Specified by:
configurationSaved in interface COConfigurationListener

reset

public void reset()
Reset any state to start of day values

Specified by:
reset in interface SpeedManagerAlgorithmProvider

updateStats

public void updateStats()
Called periodically (see period above) to allow stats to be updated.

Specified by:
updateStats in interface SpeedManagerAlgorithmProvider

pingSourceFound

public void pingSourceFound(SpeedManagerPingSource source,
                            boolean is_replacement)
Called when a new source of ping times has been found

Specified by:
pingSourceFound in interface SpeedManagerAlgorithmProvider
Parameters:
source - -
is_replacement - One of the initial sources or a replacement for a failed one

pingSourceFailed

public void pingSourceFailed(SpeedManagerPingSource source)
Ping source has failed

Specified by:
pingSourceFailed in interface SpeedManagerAlgorithmProvider
Parameters:
source - -

calculate

public void calculate(SpeedManagerPingSource[] sources)
Called whenever a new set of ping values is available for processing

Specified by:
calculate in interface SpeedManagerAlgorithmProvider
Parameters:
sources - -

getIdlePingMillis

public int getIdlePingMillis()
Various getters for interesting info shown in stats view

Specified by:
getIdlePingMillis in interface SpeedManagerAlgorithmProvider
Returns:
-

getCurrentPingMillis

public int getCurrentPingMillis()
Specified by:
getCurrentPingMillis in interface SpeedManagerAlgorithmProvider

getMaxPingMillis

public int getMaxPingMillis()
Specified by:
getMaxPingMillis in interface SpeedManagerAlgorithmProvider

getCurrentChokeSpeed

public int getCurrentChokeSpeed()
Returns the current view of when choking occurs

Specified by:
getCurrentChokeSpeed in interface SpeedManagerAlgorithmProvider
Returns:
speed in bytes/sec

getMaxUploadSpeed

public int getMaxUploadSpeed()
Specified by:
getMaxUploadSpeed in interface SpeedManagerAlgorithmProvider

getAdjustsDownloadLimits

public boolean getAdjustsDownloadLimits()
Description copied from interface: SpeedManagerAlgorithmProvider
Indicates whether or not the provider is adjusting download as well as upload limits

Specified by:
getAdjustsDownloadLimits in interface SpeedManagerAlgorithmProvider
Returns:

log

protected void log(String str)