com.h3c.of.lib.dt

## Class DataPathInfoAdapter

- java.lang.Object
- - com.h3c.of.lib.dt.DataPathInfoAdapter

- All Implemented Interfaces:
    DataPathInfo

      public class DataPathInfoAdapter
      extends Object
      implements DataPathInfo

  An adapter for the `DataPathInfo` API, provided specifically for unit tests to use, to insulate themselves from changes in the API.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataPathInfoAdapter()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<Capability>` | `capabilities()` Returns the capabilities supported by the switch.
    `String` | `dpDesc()` Returns the datapath description
    `DataPathId` | `dpid()` Returns the datapath identifier.
    `long` | `lastMessageAt()` Returns the time of the last message received from the datapath (on any connection).
    `ProtocolVersion` | `negotiated()` Returns the version of the OpenFlow protocol that the datapath has negotiated with the controller, via the exchange of Hello messages (on the "main" connection).
    `long` | `numBuffers()` Returns the maximum number of packets the switch can buffer at once.
    `int` | `numTables()` Returns the number of tables supported by the switch.
    `List<Port>` | `ports()` Returns the current known state of all the OpenFlow ports on the datapath.
    `long` | `readyAt()` Returns the time at which the datapath completed the handshake with the controller (on the "main" connection).
    `IpAddress` | `remoteAddress()` Returns the IP address of the switch (on the "main" connection).
    `PortNumber` | `remotePort()` Returns the TCP port for the switch's "main" connection.
    `void` | `setDpDesc(String desc)` Set the datapath description

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

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

- - ### Constructor Detail

    - #### DataPathInfoAdapter

          public DataPathInfoAdapter()

  - ### Method Detail

    - #### dpid

          public DataPathId dpid()

      Description copied from interface: `DataPathInfo`
      Returns the datapath identifier.
      Specified by:
        `dpid` in interface `DataPathInfo`
      Returns:
        the datapath ID

    - #### negotiated

          public ProtocolVersion negotiated()

      Description copied from interface: `DataPathInfo`
      Returns the version of the OpenFlow protocol that the datapath has negotiated with the controller, via the exchange of Hello messages (on the "main" connection).
      Specified by:
        `negotiated` in interface `DataPathInfo`
      Returns:
        the negotiated protocol version

    - #### readyAt

          public long readyAt()

      Description copied from interface: `DataPathInfo`
      Returns the time at which the datapath completed the handshake with the controller (on the "main" connection).
      Specified by:
        `readyAt` in interface `DataPathInfo`
      Returns:
        the "datapath ready" timestamp

    - #### lastMessageAt

          public long lastMessageAt()

      Description copied from interface: `DataPathInfo`
      Returns the time of the last message received from the datapath (on any connection).
      Specified by:
        `lastMessageAt` in interface `DataPathInfo`
      Returns:
        the "last message" timestamp

    - #### ports

          public List<Port> ports()

      Description copied from interface: `DataPathInfo`
      Returns the current known state of all the OpenFlow ports on the datapath. This method is guaranteed to always return a list.
      Specified by:
        `ports` in interface `DataPathInfo`
      Returns:
        the known state of the ports

    - #### numBuffers

          public long numBuffers()

      Description copied from interface: `DataPathInfo`
      Returns the maximum number of packets the switch can buffer at once.
      Specified by:
        `numBuffers` in interface `DataPathInfo`
      Returns:
        the number of packet buffers

    - #### numTables

          public int numTables()

      Description copied from interface: `DataPathInfo`
      Returns the number of tables supported by the switch.
      Specified by:
        `numTables` in interface `DataPathInfo`
      Returns:
        the number of tables

    - #### capabilities

          public Set<Capability> capabilities()

      Description copied from interface: `DataPathInfo`
      Returns the capabilities supported by the switch.
      Specified by:
        `capabilities` in interface `DataPathInfo`
      Returns:
        the set of capabilities

    - #### remoteAddress

          public IpAddress remoteAddress()

      Description copied from interface: `DataPathInfo`
      Returns the IP address of the switch (on the "main" connection).
      Specified by:
        `remoteAddress` in interface `DataPathInfo`
      Returns:
        the switch IP address

    - #### remotePort

          public PortNumber remotePort()

      Description copied from interface: `DataPathInfo`
      Returns the TCP port for the switch's "main" connection.
      Specified by:
        `remotePort` in interface `DataPathInfo`
      Returns:
        the switch TCP port

    - #### dpDesc

          public String dpDesc()

      Description copied from interface: `DataPathInfo`
      Returns the datapath description
      Specified by:
        `dpDesc` in interface `DataPathInfo`
      Returns:
        the datapath description

    - #### setDpDesc

          public void setDpDesc(String desc)

      Description copied from interface: `DataPathInfo`
      Set the datapath description
      Specified by:
        `setDpDesc` in interface `DataPathInfo`
      Parameters:
        `desc` - the description

Copyright © 2014. All Rights Reserved.