com.h3c.of.ctl.pkt

## Interface SequencedPacketListener

- All Known Implementing Classes:
    SequencedPacketAdapter

      public interface SequencedPacketListener

  Classes implementing this interface may participate in the processing of OpenFlow Packet-In message events, orchestrated by the `PacketSequencer`.

  Packet listeners are registered with the sequencer within a specific `role`. Within each role, listeners are ordered by altitude; higher altitudes coming earlier in the sequence than lower altitudes.

- - ### Method Summary

    Methods
    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.

- - ### Method Detail

    - #### event

          boolean event(MessageContext context)

      Callback invoked when a Packet-In event is to be processed.

      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. `ADVISOR`s and `OBSERVER`s 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.

      Parameters:
        `context` - the message context
      Returns:
        true if the event was handled; false otherwise

    - #### errorEvent

          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.
      Parameters:
        `event` - the error event

Copyright © 2014. All Rights Reserved.