traffic
Class ScenarioPlayer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--traffic.ScenarioPlayer
All Implemented Interfaces:
java.lang.Runnable, UDPSocketReader

public class ScenarioPlayer
extends java.lang.Thread
implements UDPSocketReader


Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
ScenarioPlayer(SimpleUDPServer simpleServer, java.lang.String scenarioFileName, int messageSize)
          Method ScenarioPlayer : Initialise le Thread dans le cas d'un lancement mode text
ScenarioPlayer(UDPServer server, java.lang.String scenarioFileName, int messageSize, boolean control)
          Method ScenarioPlayer : Initialise le Thread dans le cas d'un lancement mode graphique
 
Method Summary
 boolean clientConnectionExistence()
           
 void controlScenarioPlay(java.lang.String c, java.io.BufferedReader br)
          Method controlScenarioPlay : dans le cadre d'une generation de trafic avec un control Bench scenario player : Les paquets envoyes vont etre formes comme suit: numeroPaquet + " " + "random data" ou la taille de l'en-tete "numeroPaquet" est fixe et est fonction de la taille du fichier
static void main(java.lang.String[] args)
           
 void run()
          Method run
 void scenarioPlay(java.lang.String c, java.io.BufferedReader br)
          Method scenarioPlay : dans le cadre d'une generation de trafic sans control avec un SimpleUDPServer
 void setMessageSize(int messageSize)
           
 boolean setScenarioFile(java.lang.String fileName)
          Method setScenarioFile.
 void wakeUp()
          Implantation.
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScenarioPlayer

public ScenarioPlayer(UDPServer server,
                      java.lang.String scenarioFileName,
                      int messageSize,
                      boolean control)
               throws java.io.FileNotFoundException
Method ScenarioPlayer : Initialise le Thread dans le cas d'un lancement mode graphique

Parameters:
server - type serveur graphique
scenarioFileName -
messageSize -
control -
Throws:
java.io.FileNotFoundException

ScenarioPlayer

public ScenarioPlayer(SimpleUDPServer simpleServer,
                      java.lang.String scenarioFileName,
                      int messageSize)
               throws java.io.FileNotFoundException
Method ScenarioPlayer : Initialise le Thread dans le cas d'un lancement mode text

Parameters:
scenarioFileName -
messageSize -
Throws:
java.io.FileNotFoundException
Method Detail

wakeUp

public void wakeUp()
Implantation.

Specified by:
wakeUp in interface UDPSocketReader

run

public void run()
Method run

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

controlScenarioPlay

public void controlScenarioPlay(java.lang.String c,
                                java.io.BufferedReader br)
Method controlScenarioPlay : dans le cadre d'une generation de trafic avec un control Bench scenario player : Les paquets envoyes vont etre formes comme suit: numeroPaquet + " " + "random data" ou la taille de l'en-tete "numeroPaquet" est fixe et est fonction de la taille du fichier

Parameters:
c - to read the scenario file
br -

scenarioPlay

public void scenarioPlay(java.lang.String c,
                         java.io.BufferedReader br)
                  throws java.lang.IllegalArgumentException
Method scenarioPlay : dans le cadre d'une generation de trafic sans control avec un SimpleUDPServer

Parameters:
c -
br -
Throws:
java.lang.IllegalArgumentException

clientConnectionExistence

public boolean clientConnectionExistence()

setScenarioFile

public boolean setScenarioFile(java.lang.String fileName)
                        throws java.io.FileNotFoundException
Method setScenarioFile.

Parameters:
fileName -
Returns:
boolean
Throws:
java.io.FileNotFoundException

setMessageSize

public void setMessageSize(int messageSize)

main

public static void main(java.lang.String[] args)
                 throws java.net.SocketException,
                        java.io.FileNotFoundException
java.net.SocketException
java.io.FileNotFoundException