Class NetworkAdminSpeedTestScheduledTestImpl
java.lang.Object
com.biglybt.core.networkmanager.admin.impl.NetworkAdminSpeedTestScheduledTestImpl
- All Implemented Interfaces:
NetworkAdminSpeedTestScheduledTest
public class NetworkAdminSpeedTestScheduledTestImpl
extends Object
implements NetworkAdminSpeedTestScheduledTest
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) classPreservers the state of all the downloads before the speed test started. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) booleanprivate byte[]private static final long(package private) longprivate Stringprivate final CopyOnWriteList(package private) long(package private) final PluginInterfaceprivate static final longprivate static final long(package private) TOTorrent(package private) final NetworkAdminSpeedTesterImplprivate static final int -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNetworkAdminSpeedTestScheduledTestImpl(PluginInterface _plugin, NetworkAdminSpeedTesterImpl _tester) -
Method Summary
Modifier and TypeMethodDescriptionvoidabort()voidvoidprivate MapRead from URL and return byte array.longlongThese are the limits up to which the test can run, not the result of the testprivate StringgetVersionFromJAR(File jar_file) private MaphandleChallengeFromSpeedTestService(File jar_file, Map result) voidprotected voidprotected voidreportStage(String str) protected voidRestore all the downloads the state before the speed test started.private booleanschedule()Request a test from the speed testing service, handle the "challenge" if request and then get the id for the test.private MapsendRequest(Map request) (package private) voidprotected voidPreserve all the data about the downloads while the test is running.booleanstart()
-
Field Details
-
REQUEST_TEST
private static final long REQUEST_TEST- See Also:
-
CHALLENGE_REPLY
private static final long CHALLENGE_REPLY- See Also:
-
TEST_RESULT
private static final long TEST_RESULT- See Also:
-
ZERO_DOWNLOAD_SETTING
private static final int ZERO_DOWNLOAD_SETTING- See Also:
-
plugin
-
tester
-
detectedRouter
-
preTestSettings
-
challenge_id
private byte[] challenge_id -
delay_millis
long delay_millis -
max_speed
long max_speed -
test_torrent
TOTorrent test_torrent -
aborted
volatile boolean aborted -
listeners
-
-
Constructor Details
-
NetworkAdminSpeedTestScheduledTestImpl
protected NetworkAdminSpeedTestScheduledTestImpl(PluginInterface _plugin, NetworkAdminSpeedTesterImpl _tester)
-
-
Method Details
-
getTester
- Specified by:
getTesterin interfaceNetworkAdminSpeedTestScheduledTest
-
getMaxUpBytePerSec
public long getMaxUpBytePerSec()Description copied from interface:NetworkAdminSpeedTestScheduledTestThese are the limits up to which the test can run, not the result of the test- Specified by:
getMaxUpBytePerSecin interfaceNetworkAdminSpeedTestScheduledTest- Returns:
-
getMaxDownBytePerSec
public long getMaxDownBytePerSec()- Specified by:
getMaxDownBytePerSecin interfaceNetworkAdminSpeedTestScheduledTest
-
start
public boolean start()- Specified by:
startin interfaceNetworkAdminSpeedTestScheduledTest
-
abort
public void abort()- Specified by:
abortin interfaceNetworkAdminSpeedTestScheduledTest
-
abort
-
schedule
private boolean schedule()Request a test from the speed testing service, handle the "challenge" if request and then get the id for the test. Per spec all request are BEncoded maps.- Returns:
- boolean - true if the test has been reserved with the service.
-
getVersionFromJAR
-
handleChallengeFromSpeedTestService
- Parameters:
jar_file- - File Azureus jar used to load classes.result- - Map from the previous response- Returns:
- Map - from the current response.
- Throws:
IOException
-
sendResult
-
sendRequest
- Throws:
IOException
-
getBEncodedMapFromRequest
Read from URL and return byte array.- Parameters:
url- -- Returns:
- byte[] of the results. Max size currently 100k.
- Throws:
IOException- -
-
resetSpeedLimits
protected void resetSpeedLimits()Restore all the downloads the state before the speed test started. -
setSpeedLimits
protected void setSpeedLimits()Preserve all the data about the downloads while the test is running. -
reportStage
-
reportComplete
protected void reportComplete() -
addListener
- Specified by:
addListenerin interfaceNetworkAdminSpeedTestScheduledTest
-
removeListener
- Specified by:
removeListenerin interfaceNetworkAdminSpeedTestScheduledTest
-