Class NetworkAdminSpeedTestScheduledTestImpl.SpeedTestDownloadState
- java.lang.Object
-
- com.biglybt.core.networkmanager.admin.impl.NetworkAdminSpeedTestScheduledTestImpl.SpeedTestDownloadState
-
- All Implemented Interfaces:
ParameterListener
,DownloadManagerListener
- Enclosing class:
- NetworkAdminSpeedTestScheduledTestImpl
class NetworkAdminSpeedTestScheduledTestImpl.SpeedTestDownloadState extends java.lang.Object implements ParameterListener, DownloadManagerListener
Preservers the state of all the downloads before the speed test started.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
autoSpeedEnabled
(package private) boolean
autoSpeedSeedingEnabled
(package private) boolean
LANSpeedEnabled
(package private) int
maxDownloadKbs
(package private) int
maxUploadKbs
(package private) int
maxUploadSeedingKbs
static java.lang.String
TORRENT_DOWNLOAD_LIMIT
static java.lang.String
TORRENT_UPLOAD_LIMIT
private java.util.Map
torrentLimits
-
Constructor Summary
Constructors Constructor Description SpeedTestDownloadState()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
downloadAdded(Download download)
void
downloadRemoved(Download download)
private Download[]
getAllDownloads()
Get all the Download keys in this Map.private int
getDownloadDetails(Download d, java.lang.String param)
Get the upload or download limit for this Download object before the test started.void
parameterChanged(java.lang.String name)
Called, when a parameter has changed.private void
restoreGlobalLimits()
Call this method after a speed test completes to restore the global limits.private void
restoreIndividualLimits()
Call this method after the speed test is completed to restore the individual download limits before the test started.void
restoreLimits()
private void
saveGlobalLimits()
Get the global limits from the TransferSpeedValidator class.void
saveLimits()
private void
setDownloadDetails(Download d, int uploadLimit, int downloadLimit)
Save the upload/download limits of this Download object before the test started.
-
-
-
Field Detail
-
torrentLimits
private final java.util.Map torrentLimits
-
TORRENT_UPLOAD_LIMIT
public static final java.lang.String TORRENT_UPLOAD_LIMIT
- See Also:
- Constant Field Values
-
TORRENT_DOWNLOAD_LIMIT
public static final java.lang.String TORRENT_DOWNLOAD_LIMIT
- See Also:
- Constant Field Values
-
maxUploadKbs
int maxUploadKbs
-
maxUploadSeedingKbs
int maxUploadSeedingKbs
-
maxDownloadKbs
int maxDownloadKbs
-
autoSpeedEnabled
boolean autoSpeedEnabled
-
autoSpeedSeedingEnabled
boolean autoSpeedSeedingEnabled
-
LANSpeedEnabled
boolean LANSpeedEnabled
-
-
Method Detail
-
parameterChanged
public void parameterChanged(java.lang.String name)
Description copied from interface:ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.- Specified by:
parameterChanged
in interfaceParameterListener
- Parameters:
name
- the name of the parameter that has changed
-
downloadAdded
public void downloadAdded(Download download)
- Specified by:
downloadAdded
in interfaceDownloadManagerListener
-
downloadRemoved
public void downloadRemoved(Download download)
- Specified by:
downloadRemoved
in interfaceDownloadManagerListener
-
saveLimits
public void saveLimits()
-
restoreLimits
public void restoreLimits()
-
saveGlobalLimits
private void saveGlobalLimits()
Get the global limits from the TransferSpeedValidator class. Call before starting a speed test.
-
restoreGlobalLimits
private void restoreGlobalLimits()
Call this method after a speed test completes to restore the global limits.
-
restoreIndividualLimits
private void restoreIndividualLimits()
Call this method after the speed test is completed to restore the individual download limits before the test started.
-
setDownloadDetails
private void setDownloadDetails(Download d, int uploadLimit, int downloadLimit)
Save the upload/download limits of this Download object before the test started.- Parameters:
d
- - DownloaduploadLimit
- - intdownloadLimit
- - int
-
getDownloadDetails
private int getDownloadDetails(Download d, java.lang.String param)
Get the upload or download limit for this Download object before the test started.- Parameters:
d
- - Downloadparam
- - String- Returns:
- - limit as int.
-
getAllDownloads
private Download[] getAllDownloads()
Get all the Download keys in this Map.- Returns:
- - Download[]
-
-