com.h3c.of.sw

## Class BankDefn

- java.lang.Object
- - com.h3c.of.sw.AbstractDefn
  - - com.h3c.of.sw.BankDefn

-     public class BankDefn
      extends AbstractDefn

  Reads in a Switch Bank definition / scenario file, encapsulating the information.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `BankDefn.SwitchInfo` Encapsulates a binding of switch variable name to definition filename.

  - ### Field Summary

    - ### Fields inherited from class com.h3c.of.sw.AbstractDefn

      `EOL, EOLI, EOLI_DASH, reader`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BankDefn(String path, boolean showOutput)` Constructs a switch-bank definition reader, for the given file path.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MockOpenflowSwitch` | `findSwitch(DataPathId dpid)` Returns the mock switch with the specified datapath id.
    `MockOpenflowSwitch` | `findSwitch(String var)` Returns the mock switch with the specified scenario variable name.
    `List<ScenarioCommand>` | `getCommands()` Returns an unmodifiable view of the scenario commands.
    `List<BankDefn.SwitchInfo>` | `getSwitches()` Returns an unmodifiable view of the switch bindings.
    `String` | `toDebugString()` Provides a multi-line string representation of this definition, suitable for debugging.

    - ### Methods inherited from class com.h3c.of.sw.AbstractDefn

      `getPath, toString`

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

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

- - ### Constructor Detail

    - #### BankDefn

          public BankDefn(String path,
                  boolean showOutput)

      Constructs a switch-bank definition reader, for the given file path.
      Parameters:
        `path` - the bank definition file pathname
        `showOutput` - true if output is enabled

  - ### Method Detail

    - #### toDebugString

          public String toDebugString()

      Description copied from class: `AbstractDefn`
      Provides a multi-line string representation of this definition, suitable for debugging.
      Overrides:
        `toDebugString` in class `AbstractDefn`
      Returns:
        a multi-line string representation

    - #### getSwitches

          public List<BankDefn.SwitchInfo> getSwitches()

      Returns an unmodifiable view of the switch bindings.
      Returns:
        the switch bindings

    - #### getCommands

          public List<ScenarioCommand> getCommands()

      Returns an unmodifiable view of the scenario commands.
      Returns:
        the scenario commands

    - #### findSwitch

          public MockOpenflowSwitch findSwitch(DataPathId dpid)

      Returns the mock switch with the specified datapath id. If no such switch is configured, an exception is thrown.
      Parameters:
        `dpid` - the datapath ID to match
      Returns:
        the corresponding switch
      Throws:
        `NullPointerException` - if dpid is null
        `IllegalArgumentException` - if dpid does not match a configured switch

    - #### findSwitch

          public MockOpenflowSwitch findSwitch(String var)

      Returns the mock switch with the specified scenario variable name. If no such switch is configured, an exception is thrown.
      Parameters:
        `var` - the variable name for the switch
      Returns:
        the corresponding switch
      Throws:
        `NullPointerException` - if var is null
        `IllegalArgumentException` - if var does not match a configured switch

Copyright © 2014. All Rights Reserved.