public class SequencedPacketAdapter extends Object implements SequencedPacketListener
SequencedPacketListener that provides default
implementations of the event methods. This class can be extended as an
alternative to implementing SequencedPacketListener directly,
allowing subclasses to rely on the default behavior of methods they don't
want to implement themselves.| Constructor and Description |
|---|
SequencedPacketAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
errorEvent(ErrorEvent event)
This callback will be invoked if an unexpected error occurred during
the sequencer's attempt to send the Packet-Out message back
to the datapath via the controller, as a result of the packet listener
returning
true from its event() callback. |
boolean |
event(MessageContext context)
Callback invoked when a Packet-In event is to be processed.
|
public boolean event(MessageContext context)
The supplied context contains the message event, and is used to capture any processing hints that might be required downstream. This includes possibly modifying a "work-in-progress" Packet-Out message attached to the context.
A value of true should be returned (by a DIRECTOR) to
indicate to the sequencer that the Packet-Out message is ready
to be dispatched back to the source datapath. ADVISORs and
OBSERVERs should always return false.
Note that even after a listener indicates that the packet has been handled, the context is still passed down the chain of listeners; it is expected that no further processing will be done by downstream listeners, other than observing the result of processing.
This default implementation does nothing with the supplied context
and always returns false.
event in interface SequencedPacketListenercontext - the message contextpublic void errorEvent(ErrorEvent event)
true from its event() callback.
This default implementation does nothing with the supplied event.
errorEvent in interface SequencedPacketListenerevent - the error eventCopyright © 2014. All Rights Reserved.