com.aelitis.azureus.core.speedmanager.impl
Class SpeedManagerImpl
java.lang.Object
com.aelitis.azureus.core.speedmanager.impl.SpeedManagerImpl
- All Implemented Interfaces:
- SpeedManagerAlgorithmProviderAdapter, SpeedManager, AEDiagnosticsEvidenceGenerator
public class SpeedManagerImpl
- extends Object
- implements SpeedManager, SpeedManagerAlgorithmProviderAdapter, AEDiagnosticsEvidenceGenerator
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UPDATE_PERIOD_MILLIS
protected static final int UPDATE_PERIOD_MILLIS
- See Also:
- Constant Field Values
CONFIG_VERSION_STR
public static final String CONFIG_VERSION_STR
- See Also:
- Constant Field Values
CONFIG_VERSION
public static final String CONFIG_VERSION
- See Also:
- Constant Field Values
SpeedManagerImpl
public SpeedManagerImpl(AzureusCore _core,
SpeedManagerAdapter _adapter)
getSpeedManager
public SpeedManager getSpeedManager()
- Specified by:
getSpeedManager
in interface SpeedManagerAlgorithmProviderAdapter
getASN
public String getASN()
- Specified by:
getASN
in interface SpeedManager
getEstimatedUploadCapacityBytesPerSec
public SpeedManagerLimitEstimate getEstimatedUploadCapacityBytesPerSec()
- Specified by:
getEstimatedUploadCapacityBytesPerSec
in interface SpeedManager
setEstimatedUploadCapacityBytesPerSec
public void setEstimatedUploadCapacityBytesPerSec(int bytes_per_sec,
float metric)
- Specified by:
setEstimatedUploadCapacityBytesPerSec
in interface SpeedManager
getEstimatedDownloadCapacityBytesPerSec
public SpeedManagerLimitEstimate getEstimatedDownloadCapacityBytesPerSec()
- Specified by:
getEstimatedDownloadCapacityBytesPerSec
in interface SpeedManager
setEstimatedDownloadCapacityBytesPerSec
public void setEstimatedDownloadCapacityBytesPerSec(int bytes_per_sec,
float metric)
- Specified by:
setEstimatedDownloadCapacityBytesPerSec
in interface SpeedManager
reset
public void reset()
- Specified by:
reset
in interface SpeedManager
enableOrAlgChanged
protected void enableOrAlgChanged()
createTransientPingMapper
public SpeedManagerPingMapper createTransientPingMapper()
- Description copied from interface:
SpeedManagerAlgorithmProviderAdapter
- Creates a mapper starting from current time. Must be destroyed by calling "destroy" when
done with
- Specified by:
createTransientPingMapper
in interface SpeedManagerAlgorithmProviderAdapter
- Returns:
destroy
protected void destroy(SpeedManagerPingMapper mapper)
setSpeedTester
public void setSpeedTester(DHTSpeedTester _tester)
- Specified by:
setSpeedTester
in interface SpeedManager
addPingHistory
protected void addPingHistory(int rtt,
boolean re_base)
isAvailable
public boolean isAvailable()
- Specified by:
isAvailable
in interface SpeedManager
setEnabled
public void setEnabled(boolean _enabled)
- Specified by:
setEnabled
in interface SpeedManager
setEnabledSupport
protected void setEnabledSupport(boolean _enabled)
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interface SpeedManager
getSpeedTester
public DHTSpeedTester getSpeedTester()
- Specified by:
getSpeedTester
in interface SpeedManager
getPingSources
public SpeedManagerPingSource[] getPingSources()
- Specified by:
getPingSources
in interface SpeedManager
getActiveMapper
public SpeedManagerPingMapper getActiveMapper()
- Specified by:
getActiveMapper
in interface SpeedManager
getPingMapper
public SpeedManagerPingMapper getPingMapper()
- Specified by:
getPingMapper
in interface SpeedManagerAlgorithmProviderAdapter
getMappers
public SpeedManagerPingMapper[] getMappers()
- Specified by:
getMappers
in interface SpeedManager
getIdlePingMillis
public int getIdlePingMillis()
getCurrentPingMillis
public int getCurrentPingMillis()
getMaxPingMillis
public int getMaxPingMillis()
getCurrentChokeSpeed
public int getCurrentChokeSpeed()
- Returns the current view of when choking occurs
- Returns:
- speed in bytes/sec
getMaxUploadSpeed
public int getMaxUploadSpeed()
getCurrentUploadLimit
public int getCurrentUploadLimit()
- Specified by:
getCurrentUploadLimit
in interface SpeedManagerAlgorithmProviderAdapter
setCurrentUploadLimit
public void setCurrentUploadLimit(int bytes_per_second)
- Specified by:
setCurrentUploadLimit
in interface SpeedManagerAlgorithmProviderAdapter
getCurrentDownloadLimit
public int getCurrentDownloadLimit()
- Specified by:
getCurrentDownloadLimit
in interface SpeedManagerAlgorithmProviderAdapter
setCurrentDownloadLimit
public void setCurrentDownloadLimit(int bytes_per_second)
- Specified by:
setCurrentDownloadLimit
in interface SpeedManagerAlgorithmProviderAdapter
getCurrentProtocolUploadSpeed
public int getCurrentProtocolUploadSpeed()
- Specified by:
getCurrentProtocolUploadSpeed
in interface SpeedManagerAlgorithmProviderAdapter
getCurrentDataUploadSpeed
public int getCurrentDataUploadSpeed()
- Specified by:
getCurrentDataUploadSpeed
in interface SpeedManagerAlgorithmProviderAdapter
getCurrentDataDownloadSpeed
public int getCurrentDataDownloadSpeed()
- Specified by:
getCurrentDataDownloadSpeed
in interface SpeedManagerAlgorithmProviderAdapter
getCurrentProtocolDownloadSpeed
public int getCurrentProtocolDownloadSpeed()
- Specified by:
getCurrentProtocolDownloadSpeed
in interface SpeedManagerAlgorithmProviderAdapter
setLoggingEnabled
public void setLoggingEnabled(boolean enabled)
log
public void log(String str)
- Specified by:
log
in interface SpeedManagerAlgorithmProviderAdapter
informDownCapChanged
protected void informDownCapChanged()
informUpCapChanged
protected void informUpCapChanged()
informListeners
protected void informListeners(int type)
addListener
public void addListener(SpeedManagerListener l)
- Specified by:
addListener
in interface SpeedManager
removeListener
public void removeListener(SpeedManagerListener l)
- Specified by:
removeListener
in interface SpeedManager
generate
public void generate(IndentWriter writer)
- Specified by:
generate
in interface AEDiagnosticsEvidenceGenerator