Class ScenarioHandler
java.lang.Object
java.lang.Thread
org.opendaylight.openflowjava.protocol.impl.clients.ScenarioHandler
- All Implemented Interfaces:
Runnable
Scenario handler thread.
- Author:
- michal.polkorab
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionScenarioHandler(Deque<ClientEvent> scenario) Constructor.ScenarioHandler(Deque<ClientEvent> scenario, int freeze, long sleepBetweenTries) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddOfMsg(byte[] message) Adds a message.Returns the scenario.booleanisEmpty()Returns true if scenario is done / empty.booleanbooleanReturns true is scenario is finished.voidrun()voidsetCtx(io.netty.channel.ChannelHandlerContext ctx) Sets the ChannelHandlerContext.voidsetScenario(Deque<ClientEvent> scenario) Sets the scenario.Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, suspend, toString, yield
-
Constructor Details
-
ScenarioHandler
Constructor.- Parameters:
scenario-Deque
-
ScenarioHandler
-
-
Method Details
-
run
public void run() -
isEmpty
public boolean isEmpty()Returns true if scenario is done / empty. -
getScenario
Returns the scenario. -
setScenario
Sets the scenario.- Parameters:
scenario- scenario filled with desired events
-
setCtx
public void setCtx(io.netty.channel.ChannelHandlerContext ctx) Sets the ChannelHandlerContext.- Parameters:
ctx- context which will be used for sending messages (SendEvents)
-
addOfMsg
public void addOfMsg(byte[] message) Adds a message.- Parameters:
message- received message that is compared to expected message
-
isScenarioFinished
public boolean isScenarioFinished()Returns true is scenario is finished. -
isFinishedOK
public boolean isFinishedOK()
-