public interface TxRxControl
This interface has two functions:
Note that the messages reported through this mechanism include
pseudo-messages marking the initial connection requests from the switches,
as well as the "handshaking" and "heartbeat" messages handled internally by
the controller. These messages are not visible above
ControllerService
.
The intended use of this mechanism is to allow a logging service to record all the OpenFlow messages for a brief span of time, for field support or debugging purposes.
ControllerMx
Modifier and Type | Method and Description |
---|---|
boolean |
isEmpty()
Returns
true if the TX/RX queue contains no elements. |
boolean |
isRecording()
Returns true if TX/RX messages are being recorded.
|
boolean |
isTriggerWaiting()
Returns true if a trigger has been set, but has not yet fired.
|
MessageEvent |
poll(long timeoutMs)
Retrieves and removes the head of the TX/RX message event queue,
waiting up to the specified number of milliseconds for an element
to become available.
|
int |
size()
Returns the number of elements in the TX/RX queue.
|
void |
startRecording(int seconds)
Enables message recording for the specified amount of time, starting
immediately.
|
void |
stopRecording()
Shuts off recording of messages immediately, and clears any trigger
that might have been set.
|
MessageEvent |
take()
Retrieves and removes the head of the TX/RX message event queue,
waiting if necessary until an element becomes available.
|
void |
triggerRecording(TxRxTrigger trigger,
int seconds)
Enables message recording for the specified amount of time, starting
when the specified trigger condition is met.
|
void startRecording(int seconds)
An exception will be thrown if we are already recording, or if a
trigger has been set and is waiting to fire. To clear
this condition, call stopRecording()
.
seconds
- the number of seconds to elapse before message
recording is shut offIllegalArgumentException
- if seconds is < 1IllegalStateException
- if recording is already in progressvoid triggerRecording(TxRxTrigger trigger, int seconds)
An exception will be thrown if we are already recording, or if a
trigger has been set and is waiting to fire. To clear
this condition, call stopRecording()
.
This is a place holder method: not yet implemented.
trigger
- the condition required to trigger the start of
recordingseconds
- the number of seconds to elapse after recording has
started, before message recording is shut offNullPointerException
- if trigger is nullIllegalArgumentException
- if seconds is < 1IllegalStateException
- if recording is already in progressvoid stopRecording()
boolean isRecording()
true
if TX/RX messages are being recordedboolean isTriggerWaiting()
true
if a trigger is set but has not been firedMessageEvent take() throws InterruptedException
This method blocks if there are no elements in the queue.
InterruptedException
- if interrupted while waitingMessageEvent poll(long timeoutMs) throws InterruptedException
timeoutMs
- the maximum number of milliseconds to waitnull
if the specified
wait time elapses before an element is availableInterruptedException
- if interrupted while waitingint size()
boolean isEmpty()
true
if the TX/RX queue contains no elements.true
if the queue contains no elementsCopyright © 2015. All Rights Reserved.