public class JSONDelayEmulator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DELAY_STR
The JSON key for the delay value.
|
Constructor and Description |
---|
JSONDelayEmulator() |
Modifier and Type | Method and Description |
---|---|
static void |
emulateConfigFileDelays(InterfaceDelayEmulator<?> pingNodeConfig,
double variation) |
static void |
emulateDelays()
Enables delay emulation at receiver.
|
protected static long |
getEmulatedDelay() |
static long |
getEmulatedDelay(org.json.JSONObject jsonData)
Receiver calls this method to toString delay that is to be emulated, and
delays processing the packet by that amount.
|
static long |
getEmulatedDelay(java.lang.String strData) |
static boolean |
isDelayEmulated() |
static void |
putEmulatedDelay(java.lang.Object id,
org.json.JSONObject jsonData)
Sender calls this method to put delay value in the json object before
json object is sent.
|
static void |
setBaseDelay(long d) |
static void |
setVariation(double v) |
static void |
stop()
Stops the underlying timer thread.
|
public static final java.lang.String DELAY_STR
public static void emulateDelays()
public static void emulateConfigFileDelays(InterfaceDelayEmulator<?> pingNodeConfig, double variation)
pingNodeConfig
- variation
- public static boolean isDelayEmulated()
public static void stop()
public static void putEmulatedDelay(java.lang.Object id, org.json.JSONObject jsonData)
id
- jsonData
- public static long getEmulatedDelay(org.json.JSONObject jsonData)
jsonData
- public static long getEmulatedDelay(java.lang.String strData)
strData
- protected static long getEmulatedDelay()
public static void setBaseDelay(long d)
d
- public static void setVariation(double v)
v
-