com.h3c.of.ctl.flow

## Interface FlowTracker

-     public interface FlowTracker

  Provides basic flow management for the controller.

  Facilitates:

  - the getting of flow statistics from a datapath, for one or all flow tables
  - the sending of flows to a datapath

  When sending messages, `MessageFuture`s are used to allow the caller to determine the outcome of the request either synchronously or asynchronously, at their preference.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `List<MBodyFlowStats>` | `getFlowStats(DataPathId dpid, TableId tableId)` Returns flows installed in the specified table of the given datapath.
    `MessageFuture` | `sendFlowMod(OfmFlowMod flowMod, DataPathId dpid)` Sends the given FlowMod message to the specified datapath.

- - ### Method Detail

    - #### getFlowStats

          List<MBodyFlowStats> getFlowStats(DataPathId dpid,
                                          TableId tableId)

      Returns flows installed in the specified table of the given datapath. If the table ID is not given (i.e. `tableId` is `null`) then all tables are assumed.

      If the specified table ID is `TableId.ALL`, all flows from all tables will be returned. Note that table ID is ignored for OpenFlow 1.0 devices.

      Note that this is a synchronous call that blocks until all the flow statistics replies have returned from the datapath.

      Parameters:
        `dpid` - the datapath from which the flows are requested
        `tableId` - the ID of the flow table
      Returns:
        the list of flow statistics
      Throws:
        `NullPointerException` - if dpid is null
        `NotFoundException` - if the specified datapath does not exist

    - #### sendFlowMod

          MessageFuture sendFlowMod(OfmFlowMod flowMod,
                                  DataPathId dpid)
                                    throws OpenflowException

      Sends the given FlowMod message to the specified datapath. A message future is returned, to allow the caller to discover the outcome of the request once it has been satisfied.

      Adds the specified flow to the given datapath if the message's command is `ADD`. Deletes the specified flow from the given datapath if the message's command is `DELETE`.

      Parameters:
        `flowMod` - the FlowMod message to send
        `dpid` - the target datapath
      Returns:
        a message future
      Throws:
        `NullPointerException` - if either parameter is null
        `IllegalArgumentException` - if flowMod is mutable
        `NotFoundException` - if the specified datapath does not exist
        `OpenflowException` - if there was an issue sending the message
      See Also:
        `FlowModCommand`

Copyright © 2014. All Rights Reserved.