com.h3c.of.lib.mp

## Class MBodyPortStats

- java.lang.Object
- - com.h3c.of.lib.OpenflowStructure
  - - com.h3c.of.lib.mp.MBodyPortStats

- All Implemented Interfaces:
    MultipartBody, Structure
  Direct Known Subclasses:
    MBodyMutablePortStats

      public class MBodyPortStats
      extends OpenflowStructure
      implements MultipartBody

  Represents a port stats element; part of a reply to a port-stats request multipart message; Since 1.0.
  See Also:
    `MBodyPortStatsRequest`

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `MBodyPortStats.Array` Represents an array of port stats elements.
    `static class` | `MBodyPortStats.MutableArray` A mutable array of port stats elements.

  - ### Field Summary

    - ### Fields inherited from class com.h3c.of.lib.OpenflowStructure

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `MBodyPortStats(ProtocolVersion pv)` Constructs a multipart body PORT_STATS type.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getCollisions()` Returns the number of collisions; Since 1.0.
    `long` | `getDurationNsec()` Returns the time this port has been alive in nanoseconds beyond `getDurationSec()`; Since 1.3.
    `long` | `getDurationSec()` Returns the time this port has been alive in seconds; Since 1.3.
    `BigPortNumber` | `getPort()` Returns the port to which the statistics belong; Since 1.0.
    `long` | `getRxBytes()` Returns the number of bytes received by this port; Since 1.0.
    `long` | `getRxCRCErr()` Returns the number of packets received with CRC error; Since 1.0.
    `long` | `getRxDropped()` Returns the number of packets dropped by this port at the receiving end; Since 1.0.
    `long` | `getRxErrors()` Returns the number of packets received with error; Since 1.0.
    `long` | `getRxFrameErr()` Returns the number of packets received with frame alignment error; Since 1.0.
    `long` | `getRxOverErr()` Returns the number of packets received with overrun error; Since 1.0.
    `long` | `getRxPackets()` Returns the number of packets received by this port; Since 1.0.
    `int` | `getTotalLength()` Returns the total length of the body, in bytes.
    `long` | `getTxBytes()` Returns the number of bytes transmitted by this port; Since 1.0.
    `long` | `getTxDropped()` Returns the number of packets dropped by this port at transmitting end; Since 1.0.
    `long` | `getTxErrors()` Returns the number of packets transmitted with errors; Since 1.0.
    `long` | `getTxPackets()` Returns the number of packets transmitted by this port; Since 1.0.
    `String` | `toDebugString()` Returns a string representation useful for debugging.
    `String` | `toDebugString(int indent)` Returns a multi-line representation of this Port Stats object.
    `String` | `toString()`
    `void` | `validate()` Validates this structure for completeness and throws an exception if the structure is considered "not complete".

    - ### Methods inherited from class com.h3c.of.lib.OpenflowStructure

      `getVersion, hex, hex`

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

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

    - ### Methods inherited from interface com.h3c.of.lib.Structure

      `getVersion`

- - ### Constructor Detail

    - #### MBodyPortStats

          public MBodyPortStats(ProtocolVersion pv)

      Constructs a multipart body PORT_STATS type.
      Parameters:
        `pv` - the protocol version

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `OpenflowStructure`

    - #### validate

          public void validate()
                        throws IncompleteStructureException

      Description copied from class: `OpenflowStructure`
      Validates this structure for completeness and throws an exception if the structure is considered "not complete".

      This default implementation does nothing, i.e. default behavior is that structures are considered complete.

      Subclasses should override this method to check that mandatory fields or other internal state is present, throwing an exception if it is not.

      Specified by:
        `validate` in interface `MultipartBody`
      Overrides:
        `validate` in class `OpenflowStructure`
      Throws:
        `IncompleteStructureException` - if the structure is not complete

    - #### getTotalLength

          public int getTotalLength()

      Description copied from interface: `MultipartBody`
      Returns the total length of the body, in bytes.
      Specified by:
        `getTotalLength` in interface `MultipartBody`
      Returns:
        the total length of the body

    - #### toDebugString

          public String toDebugString()

      Description copied from class: `OpenflowStructure`
      Returns a string representation useful for debugging. This default implementation delegates to `OpenflowStructure.toString()`, but subclasses are free to override this behavior.
      Specified by:
        `toDebugString` in interface `Structure`
      Overrides:
        `toDebugString` in class `OpenflowStructure`
      Returns:
        a (possibly multi-line) string representation of this message

    - #### toDebugString

          public String toDebugString(int indent)

      Returns a multi-line representation of this Port Stats object.
      Parameters:
        `indent` - the additional indent (number of spaces)
      Returns:
        a multi-line representation

    - #### getPort

          public BigPortNumber getPort()

      Returns the port to which the statistics belong; Since 1.0.

      A value of `Port.ANY` indicates no restriction. Note that in 1.0, port numbers are u16.

      Returns:
        the port to which the statistics belong

    - #### getRxPackets

          public long getRxPackets()

      Returns the number of packets received by this port; Since 1.0.
      Returns:
        the number of packets

    - #### getTxPackets

          public long getTxPackets()

      Returns the number of packets transmitted by this port; Since 1.0.
      Returns:
        the number of packets

    - #### getRxBytes

          public long getRxBytes()

      Returns the number of bytes received by this port; Since 1.0.
      Returns:
        the number of bytes

    - #### getTxBytes

          public long getTxBytes()

      Returns the number of bytes transmitted by this port; Since 1.0.
      Returns:
        the number of bytes

    - #### getRxDropped

          public long getRxDropped()

      Returns the number of packets dropped by this port at the receiving end; Since 1.0.
      Returns:
        the number of dropped packets

    - #### getTxDropped

          public long getTxDropped()

      Returns the number of packets dropped by this port at transmitting end; Since 1.0.
      Returns:
        the number of dropped packets

    - #### getRxErrors

          public long getRxErrors()

      Returns the number of packets received with error; Since 1.0.
      Returns:
        the number of error packets

    - #### getTxErrors

          public long getTxErrors()

      Returns the number of packets transmitted with errors; Since 1.0.
      Returns:
        the number of error packets

    - #### getRxFrameErr

          public long getRxFrameErr()

      Returns the number of packets received with frame alignment error; Since 1.0.
      Returns:
        the number of frame alignment error packets

    - #### getRxOverErr

          public long getRxOverErr()

      Returns the number of packets received with overrun error; Since 1.0.
      Returns:
        the number of overrun error packets

    - #### getRxCRCErr

          public long getRxCRCErr()

      Returns the number of packets received with CRC error; Since 1.0.
      Returns:
        the number of CRC error packets

    - #### getCollisions

          public long getCollisions()

      Returns the number of collisions; Since 1.0.
      Returns:
        the number of collisions

    - #### getDurationSec

          public long getDurationSec()

      Returns the time this port has been alive in seconds; Since 1.3. This value is u32.
      Returns:
        the time the port has been alive (seconds)

    - #### getDurationNsec

          public long getDurationNsec()

      Returns the time this port has been alive in nanoseconds beyond `getDurationSec()`; Since 1.3. This value is u32.
      Returns:
        the additional time the port has been alive (nanoseconds)

Copyright © 2014. All Rights Reserved.