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.Builder, Thread.State, Thread.UncaughtExceptionHandler
-
Field Summary
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
Constructor Summary
ConstructorDescriptionScenarioHandler
(Deque<ClientEvent> scenario) Constructor.ScenarioHandler
(Deque<ClientEvent> scenario, int freeze, long sleepBetweenTries) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addOfMsg
(byte[] message) Adds a message.Returns the scenario.boolean
isEmpty()
Returns true if scenario is done / empty.boolean
boolean
Returns true is scenario is finished.void
run()
void
setCtx
(io.netty.channel.ChannelHandlerContext ctx) Sets the ChannelHandlerContext.void
setScenario
(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, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, stop, suspend, threadId, 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()
-