com.h3c.of.ctl.pkt

## Class SequencedPacketAdapter

- java.lang.Object
- - com.h3c.of.ctl.pkt.SequencedPacketAdapter

- All Implemented Interfaces:
    SequencedPacketListener

      public class SequencedPacketAdapter
      extends Object
      implements SequencedPacketListener

  An adapter for `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 Summary

    Constructors
    Constructor and Description
    `SequencedPacketAdapter()`

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

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SequencedPacketAdapter

          public SequencedPacketAdapter()

  - ### Method Detail

    - #### event

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

      This default implementation does nothing with the supplied context and always returns `false`.

      Specified by:
        `event` in interface `SequencedPacketListener`
      Parameters:
        `context` - the message context
      Returns:
        false

    - #### errorEvent

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

      This default implementation does nothing with the supplied event.

      Specified by:
        `errorEvent` in interface `SequencedPacketListener`
      Parameters:
        `event` - the error event

Copyright © 2014. All Rights Reserved.