com.h3c.sdn.ctl.diag

## Class DiagPacket

- java.lang.Object
- - com.h3c.sdn.ctl.diag.DiagPacket

- All Implemented Interfaces:
    PacketModel

      public class DiagPacket
      extends Object
      implements PacketModel

  Contains the packet, packet identifier and last sent time stamp.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DiagPacket(Packet packet, String uid)` Constructs a packet model with the specified packet and an identifier which should be generated via nextId().

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getId(String uid)` Returns the packet identifier as an integer.
    `Set<DataPathId>` | `getRegisteredPosts()` Returns the set of registered observation posts.
    `long` | `lastSent()` Returns the time stamp when the packet was last sent.
    `Map<String,OfmPacketIn>` | `observationsPosts()` Returns the map of device dpid and the packet-in message received from that dpid.
    `Packet` | `packet()` Returns the packet associated with this packet model.
    `void` | `registerObservationPost(DataPathId dataPathId)` Registers the observation with the specified data path identifier.
    `void` | `stampTime()` Sets the time stamp to the current system time when the packet is sent out to the network.
    `String` | `toString()`
    `String` | `uid()` Returns the unique packet model identifier.
    `void` | `unregisterObservationPost(DataPathId dataPathId)` Unregisters the observation with the specified data path identifier.
    `void` | `updateObservationPost(DataPathId dataPathId, OfmPacketIn ofmPacketIn)` Updates the observation post with the corresponding open flow packet in.

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

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

- - ### Constructor Detail

    - #### DiagPacket

          public DiagPacket(Packet packet,
                    String uid)

      Constructs a packet model with the specified packet and an identifier which should be generated via nextId(). increment identifier.
      Parameters:
        `packet` - the `Packet`
        `uid` - the packet model identifier string

  - ### Method Detail

    - #### uid

          public String uid()

      Returns the unique packet model identifier.
      Specified by:
        `uid` in interface `PacketModel`
      Returns:
        the packet model identifier

    - #### packet

          public Packet packet()

      Returns the packet associated with this packet model.
      Specified by:
        `packet` in interface `PacketModel`
      Returns:
        the packet of this model object

    - #### lastSent

          public long lastSent()

      Returns the time stamp when the packet was last sent.
      Specified by:
        `lastSent` in interface `PacketModel`
      Returns:
        time stamp it was last sent

    - #### stampTime

          public void stampTime()

      Sets the time stamp to the current system time when the packet is sent out to the network.
      Specified by:
        `stampTime` in interface `PacketModel`

    - #### getId

          public int getId(String uid)

      Description copied from interface: `PacketModel`
      Returns the packet identifier as an integer.
      Specified by:
        `getId` in interface `PacketModel`
      Parameters:
        `uid` - the identifier that was supposed to be generated by nextId()
      Returns:
        the identifier number

    - #### observationsPosts

          public Map<String,OfmPacketIn> observationsPosts()

      Returns the map of device dpid and the packet-in message received from that dpid.
      Specified by:
        `observationsPosts` in interface `PacketModel`
      Returns:
        the map of dpid and packet-in message

    - #### updateObservationPost

          public void updateObservationPost(DataPathId dataPathId,
                                   OfmPacketIn ofmPacketIn)

      Description copied from interface: `PacketModel`
      Updates the observation post with the corresponding open flow packet in.
      Specified by:
        `updateObservationPost` in interface `PacketModel`
      Parameters:
        `dataPathId` - the data path identifier of the observation post
        `ofmPacketIn` - the test open flow packet in received from this post

    - #### registerObservationPost

          public void registerObservationPost(DataPathId dataPathId)

      Description copied from interface: `PacketModel`
      Registers the observation with the specified data path identifier.
      Specified by:
        `registerObservationPost` in interface `PacketModel`
      Parameters:
        `dataPathId` - the data path identifier of the observation post

    - #### unregisterObservationPost

          public void unregisterObservationPost(DataPathId dataPathId)

      Description copied from interface: `PacketModel`
      Unregisters the observation with the specified data path identifier.
      Specified by:
        `unregisterObservationPost` in interface `PacketModel`
      Parameters:
        `dataPathId` - the data path identifier of the observation post

    - #### getRegisteredPosts

          public Set<DataPathId> getRegisteredPosts()

      Description copied from interface: `PacketModel`
      Returns the set of registered observation posts.
      Specified by:
        `getRegisteredPosts` in interface `PacketModel`
      Returns:
        the set of registered observation posts

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014. All Rights Reserved.