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 Object
implements ParameterListener, DownloadManagerListener
Preservers the state of all the downloads before the speed test started.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
downloadAdded
(Download download) void
downloadRemoved
(Download download) private Download[]
Get all the Download keys in this Map.private int
getDownloadDetails
(Download d, String param) Get the upload or download limit for this Download object before the test started.void
parameterChanged
(String name) Called, when a parameter has changed.private void
Call this method after a speed test completes to restore the global limits.private void
Call this method after the speed test is completed to restore the individual download limits before the test started.void
private void
Get the global limits from the TransferSpeedValidator class.void
private void
setDownloadDetails
(Download d, int uploadLimit, int downloadLimit) Save the upload/download limits of this Download object before the test started.
-
Field Details
-
torrentLimits
-
TORRENT_UPLOAD_LIMIT
- See Also:
-
TORRENT_DOWNLOAD_LIMIT
- See Also:
-
maxUploadKbs
int maxUploadKbs -
maxUploadSeedingKbs
int maxUploadSeedingKbs -
maxDownloadKbs
int maxDownloadKbs -
autoSpeedEnabled
boolean autoSpeedEnabled -
autoSpeedSeedingEnabled
boolean autoSpeedSeedingEnabled -
LANSpeedEnabled
boolean LANSpeedEnabled
-
-
Constructor Details
-
SpeedTestDownloadState
public SpeedTestDownloadState()
-
-
Method Details
-
parameterChanged
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
- Specified by:
downloadAdded
in interfaceDownloadManagerListener
-
downloadRemoved
- 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
Save the upload/download limits of this Download object before the test started.- Parameters:
d
- - DownloaduploadLimit
- - intdownloadLimit
- - int
-
getDownloadDetails
Get the upload or download limit for this Download object before the test started.- Parameters:
d
- - Downloadparam
- - String- Returns:
- - limit as int.
-
getAllDownloads
Get all the Download keys in this Map.- Returns:
- - Download[]
-