Class NetworkAdminSpeedTesterBTImpl
- java.lang.Object
-
- com.biglybt.core.networkmanager.admin.impl.NetworkAdminSpeedTesterImpl
-
- com.biglybt.core.networkmanager.admin.impl.NetworkAdminSpeedTesterBTImpl
-
- All Implemented Interfaces:
NetworkAdminSpeedTester
public class NetworkAdminSpeedTesterBTImpl extends NetworkAdminSpeedTesterImpl implements NetworkAdminSpeedTester
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
NetworkAdminSpeedTesterBTImpl.BitTorrentResult
private class
NetworkAdminSpeedTesterBTImpl.TorrentSpeedTestMonitorThread
-------------------- helper class to monitor test.
-
Field Summary
Fields Modifier and Type Field Description (package private) boolean
aborted
(package private) java.lang.String
deferred_abort
static java.lang.String
DOWNLOAD_AVE
static java.lang.String
DOWNLOAD_STD_DEV
(package private) static NetworkAdminSpeedTesterResult
lastResult
private PluginInterface
plugin
private static TorrentAttribute
speedTestAttrib
(package private) boolean
test_completed
private boolean
test_started
(package private) static int
testMode
static java.lang.String
UPLOAD_AVE
static java.lang.String
UPLOAD_STD_DEV
(package private) boolean
use_crypto
-
Fields inherited from interface com.biglybt.core.networkmanager.admin.NetworkAdminSpeedTester
TEST_TYPE_DOWNLOAD_ONLY, TEST_TYPE_UPLOAD_ONLY, TEST_TYPES
-
-
Constructor Summary
Constructors Constructor Description NetworkAdminSpeedTesterBTImpl(PluginInterface pi)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
abort(java.lang.String reason)
protected void
abort(java.lang.String reason, java.lang.Throwable cause)
(package private) static java.lang.Double
autoboxDouble(double d)
(package private) static java.lang.Long
autoboxLong(long l)
private static long
autoboxLong(java.lang.Long l)
(package private) static long
autoboxLong(java.lang.Object o)
void
complete(NetworkAdminSpeedTesterResult result)
protected static NetworkAdminSpeedTesterResult
getLastResult()
int
getMode()
NetworkAdminSpeedTesterResult
getResult()
Get the result forint
getTestType()
boolean
getUseCrypto()
protected static void
initialise()
void
setMode(int mode)
(package private) static int
setStartPieceBasedOnMode(int mode, int totalPieces)
Depending on the mode we want to upload all the set all, none or only half the pieces to done.void
setUseCrypto(boolean _use_crypto)
void
start(TOTorrent tot)
The downloads have been stopped just need to do the testing.protected static void
startUp()
-
Methods inherited from class com.biglybt.core.networkmanager.admin.impl.NetworkAdminSpeedTesterImpl
addListener, removeListener, sendResultToListeners, sendStageUpdateToListeners
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.biglybt.core.networkmanager.admin.NetworkAdminSpeedTester
addListener, removeListener
-
-
-
-
Field Detail
-
DOWNLOAD_AVE
public static final java.lang.String DOWNLOAD_AVE
- See Also:
- Constant Field Values
-
UPLOAD_AVE
public static final java.lang.String UPLOAD_AVE
- See Also:
- Constant Field Values
-
DOWNLOAD_STD_DEV
public static final java.lang.String DOWNLOAD_STD_DEV
- See Also:
- Constant Field Values
-
UPLOAD_STD_DEV
public static final java.lang.String UPLOAD_STD_DEV
- See Also:
- Constant Field Values
-
testMode
static int testMode
-
speedTestAttrib
private static TorrentAttribute speedTestAttrib
-
lastResult
static NetworkAdminSpeedTesterResult lastResult
-
plugin
private final PluginInterface plugin
-
test_started
private boolean test_started
-
test_completed
boolean test_completed
-
use_crypto
boolean use_crypto
-
aborted
volatile boolean aborted
-
deferred_abort
java.lang.String deferred_abort
-
-
Constructor Detail
-
NetworkAdminSpeedTesterBTImpl
public NetworkAdminSpeedTesterBTImpl(PluginInterface pi)
- Parameters:
pi
- - PluginInterface is used to get Manager classes.
-
-
Method Detail
-
initialise
protected static void initialise()
-
startUp
protected static void startUp()
-
getLastResult
protected static NetworkAdminSpeedTesterResult getLastResult()
-
getTestType
public int getTestType()
- Specified by:
getTestType
in interfaceNetworkAdminSpeedTester
-
setMode
public void setMode(int mode)
- Specified by:
setMode
in interfaceNetworkAdminSpeedTester
-
getMode
public int getMode()
- Specified by:
getMode
in interfaceNetworkAdminSpeedTester
-
setUseCrypto
public void setUseCrypto(boolean _use_crypto)
- Specified by:
setUseCrypto
in interfaceNetworkAdminSpeedTester
-
getUseCrypto
public boolean getUseCrypto()
- Specified by:
getUseCrypto
in interfaceNetworkAdminSpeedTester
-
start
public void start(TOTorrent tot)
The downloads have been stopped just need to do the testing.- Parameters:
tot
- - Torrent recieved from testing service.
-
complete
public void complete(NetworkAdminSpeedTesterResult result)
-
abort
protected void abort(java.lang.String reason, java.lang.Throwable cause)
- Specified by:
abort
in classNetworkAdminSpeedTesterImpl
-
abort
public void abort(java.lang.String reason)
- Specified by:
abort
in classNetworkAdminSpeedTesterImpl
-
getResult
public NetworkAdminSpeedTesterResult getResult()
Get the result for- Returns:
- Result object of speed test.
-
setStartPieceBasedOnMode
static int setStartPieceBasedOnMode(int mode, int totalPieces)
Depending on the mode we want to upload all the set all, none or only half the pieces to done.- Parameters:
mode
- - int that maps to NetworkAdminSpeedTestScheduler.TEST_TYPE...totalPieces
- - total pieces in this test torrent.- Returns:
- - int - the starting piece number to setDone to true.
-
autoboxLong
static long autoboxLong(java.lang.Object o)
-
autoboxLong
private static long autoboxLong(java.lang.Long l)
-
autoboxLong
static java.lang.Long autoboxLong(long l)
-
autoboxDouble
static java.lang.Double autoboxDouble(double d)
-
-