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 Details

    • torrentLimits

      private final Map torrentLimits
    • TORRENT_UPLOAD_LIMIT

      public static final String TORRENT_UPLOAD_LIMIT
      See Also:
    • TORRENT_DOWNLOAD_LIMIT

      public static final String 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

      public void parameterChanged(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 interface ParameterListener
      Parameters:
      name - the name of the parameter that has changed
    • downloadAdded

      public void downloadAdded(Download download)
      Specified by:
      downloadAdded in interface DownloadManagerListener
    • downloadRemoved

      public void downloadRemoved(Download download)
      Specified by:
      downloadRemoved in interface DownloadManagerListener
    • 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 - - Download
      uploadLimit - - int
      downloadLimit - - int
    • getDownloadDetails

      private int getDownloadDetails(Download d, String param)
      Get the upload or download limit for this Download object before the test started.
      Parameters:
      d - - Download
      param - - String
      Returns:
      - limit as int.
    • getAllDownloads

      private Download[] getAllDownloads()
      Get all the Download keys in this Map.
      Returns:
      - Download[]