com.h3c.of.sw

## Class CfgHello

- java.lang.Object
- - com.h3c.of.sw.CfgHello

-     public class CfgHello
      extends Object

  Encapsulates configuration information about the version(s) the mock switch announces it supports, via its HELLO message to the controller.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CfgHello.Behavior` Mock switch's behavior in sending the HELLO message.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CfgHello(CfgHello.Behavior sendHow, ProtocolVersion... pvs)` Configures the mock-switch outbound HELLO message.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `OfmHello` | `createHelloMsg()` Creates the HELLO message to send to the controller, based on the configuration.
    `CfgHello.Behavior` | `getBehavior()` Returns the required behavior of the switch when sending its HELLO.
    `ProtocolVersion` | `getMaxVersion()` Returns the highest protocol version configured.
    `Set<ProtocolVersion>` | `getVersions()` Returns the set of supported versions.
    `boolean` | `isLegacy()` Returns true if the legacy flag is latched.
    `CfgHello` | `legacy()` Latch HELLO to be the "legacy" format; that is, not the 1.3.1 structure with versionBitmap.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### CfgHello

          public CfgHello(CfgHello.Behavior sendHow,
                  ProtocolVersion... pvs)

      Configures the mock-switch outbound HELLO message. The sending behavior determines whether the switch will send the HELLO message immediately after the connection is established (eagerly), or whether it will wait until it receives the HELLO message from the controller (lazily).
      Parameters:
        `sendHow` - HELLO sending behavior
        `pvs` - protocol versions reported as supported

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### legacy

          public CfgHello legacy()

      Latch HELLO to be the "legacy" format; that is, not the 1.3.1 structure with versionBitmap.
      Returns:
        self; for chaining
      Throws:
        `IllegalStateException` - if more than one version was specified in the constructor

    - #### createHelloMsg

          public OfmHello createHelloMsg()

      Creates the HELLO message to send to the controller, based on the configuration.
      Returns:
        the HELLO message to send

    - #### getMaxVersion

          public ProtocolVersion getMaxVersion()

      Returns the highest protocol version configured.
      Returns:
        the max version

    - #### getBehavior

          public CfgHello.Behavior getBehavior()

      Returns the required behavior of the switch when sending its HELLO.
      Returns:
        the HELLO send behavior

    - #### getVersions

          public Set<ProtocolVersion> getVersions()

      Returns the set of supported versions.
      Returns:
        the supported versions

    - #### isLegacy

          public boolean isLegacy()

      Returns true if the legacy flag is latched. That is, the generated HELLO message will not contain the "version bitmap" hello element.
      Returns:
        true if legacy

Copyright © 2014. All Rights Reserved.