|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Thread
testEnvironment.ClientSimulator
final class ClientSimulator
Simulates a Client
s behavior using its
InputStream
and OutputStream
according to the
following logic: "Send K
bytes of data with a delay of
L
ms between sending, M
times."
K
, L
and M
are taken from the
property file (TestEnvironmentProperties.txt
).
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary | |
---|---|
private static InternalInformationPortController |
internalInformationPort
Reference on component InternalInformationPort . |
private static java.util.logging.Logger |
LOGGER
Logger used to log and display information. |
private java.security.Key[] |
publicKeysOfMixes
Public keys of the mix used to encrypt messages. |
private static java.util.Random |
random
Random number generator. |
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
protected |
ClientSimulator()
Generates a new ClientSimulator that can be used to
simulates a Client s behavior using its
InputStream and OutputStream according to the
following logic: "Send K bytes of data with a delay of
L ms between sending, M times." |
Method Summary | |
---|---|
private byte[] |
generateRandomMessage(int size)
Generates a random byte message (each byte represents a number between 0 and 9 (both inclusive; ANSI)). |
private static java.security.PublicKey[] |
getPublicKeys()
Retrieves the public keys of all mixes in the cascade (address of first mix must be specified in property file) for later encryption. |
private static int |
getUpperBound(java.lang.String expression)
Returns x from a bypassed String of from
RANDOM-x , where x is a number (e. g. |
protected static int |
getVariable(java.lang.String variableKey)
Returns the value of one of the variables X, Y, Z, K, L, or
M from property file (as specified by the bypassed value). |
void |
run()
Simulates a Client 's behavior. |
Methods inherited from class java.lang.Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static InternalInformationPortController internalInformationPort
InternalInformationPort
.
Used to display and/or log data and read general settings.
private static final java.util.logging.Logger LOGGER
private static java.util.Random random
private java.security.Key[] publicKeysOfMixes
Constructor Detail |
---|
protected ClientSimulator()
ClientSimulator
that can be used to
simulates a Client
s behavior using its
InputStream
and OutputStream
according to the
following logic: "Send K
bytes of data with a delay of
L
ms between sending, M
times."
K
, L
and M
are taken from the
property file (TestEnvironmentProperties.txt
).
Method Detail |
---|
public void run()
Client
's behavior.
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private byte[] generateRandomMessage(int size)
size
- Length of the random byte message to be created.
protected static int getVariable(java.lang.String variableKey)
X, Y, Z, K, L,
or
M
from property file (as specified by the bypassed value).
variableKey
- Name (=key) of the variable (=property) to be
returned.
private static int getUpperBound(java.lang.String expression)
x
from a bypassed String of from
RANDOM-x
, where x
is a number (e. g.
"RANDOM-1000"). Used to get the upper bound for a randomly chosen value
for one of the variables X, Y, Z, K, L,
or M
as specified by the user in property file.
expression
- String containing the upper bound.
private static java.security.PublicKey[] getPublicKeys()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |