com.h3c.of.sw

## Class CfgFeat

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

-     public class CfgFeat
      extends Object

  Encapsulates the feature configuration of a mock-switch.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `CfgFeat()` No-args constructor to allow incremental creation.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Set<PortConfig>` | `getPortConfig()` Returns the default port config flags.
    `Set<PortConfig>` | `getPortConfig(int index)` Returns the port config flags for the given port index.
    `int` | `getPortCount()` Returns the port count.
    `Set<PortFeature>` | `getPortFeatures()` Returns the port feature flags.
    `Set<PortFeature>` | `getPortFeatures(int index)` Returns the port feature flags for the given port index.
    `MacPrefix` | `getPortMac()` Returns the port MAC prefix used to configure the port MACs.
    `Set<SupportedAction>` | `getSuppActs()` Returns the set of supported actions.
    `void` | `overridePortConfig(int index, Set<PortConfig> portConfig)` Overrides the default port config for the given port index.
    `void` | `overridePortFeatures(int index, Set<PortFeature> features)` Overrides the default port features for the given port index.
    `static long` | `pickCurrentSpeed(PortFeature rate)` Using the specified rate, divides by 2 to provide a fake current port speed value.
    `static long` | `pickMaxSpeed(PortFeature rate)` Uses the specified rate to return a fake max port speed value.
    `static PortFeature` | `pickRate(Set<PortFeature> portFeatures)` Picks the first Rate flag and returns it.
    `void` | `setPortConfig(Set<PortConfig> portConfig)` Sets the default port config.
    `void` | `setPortCount(int portCount)` Sets the port count.
    `void` | `setPortFeatures(Set<PortFeature> portFeatures)` Sets the default port features.
    `void` | `setPortMac(MacPrefix pfx)` Sets the port MAC prefix.
    `void` | `setSuppActs(Set<SupportedAction> suppActs)` Sets the supported actions.
    `String` | `toString()`

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

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

- - ### Constructor Detail

    - #### CfgFeat

          public CfgFeat()

      No-args constructor to allow incremental creation.

  - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getSuppActs

          public Set<SupportedAction> getSuppActs()

      Returns the set of supported actions. Should be null, unless the switch being modeled is 1.0.
      Returns:
        the supported actions, or null

    - #### getPortCount

          public int getPortCount()

      Returns the port count.
      Returns:
        the port count

    - #### getPortMac

          public MacPrefix getPortMac()

      Returns the port MAC prefix used to configure the port MACs.
      Returns:
        the port MAC prefix

    - #### getPortConfig

          public Set<PortConfig> getPortConfig()

      Returns the default port config flags.
      Returns:
        the port configuration flags

    - #### getPortConfig

          public Set<PortConfig> getPortConfig(int index)

      Returns the port config flags for the given port index. The indices run from 0 to `portCount` - 1.
      Parameters:
        `index` - the port index
      Returns:
        the port configuration
      Throws:
        `IllegalArgumentException` - if the index is out of range

    - #### getPortFeatures

          public Set<PortFeature> getPortFeatures()

      Returns the port feature flags. Note that this structure is duplicated across all reported ports.
      Returns:
        the port feature flags

    - #### getPortFeatures

          public Set<PortFeature> getPortFeatures(int index)

      Returns the port feature flags for the given port index. The indices run from 0 to `portCount` - 1.
      Parameters:
        `index` - the port index
      Returns:
        the port features
      Throws:
        `IllegalArgumentException` - if the index is out of range

    - #### setSuppActs

          public void setSuppActs(Set<SupportedAction> suppActs)

      Sets the supported actions. Only applies to 1.0 switches.
      Parameters:
        `suppActs` - the supported actions

    - #### setPortCount

          public void setPortCount(int portCount)

      Sets the port count. Valid values are from 1 to 255.
      Parameters:
        `portCount` - the number of ports

    - #### setPortMac

          public void setPortMac(MacPrefix pfx)

      Sets the port MAC prefix. This should be of size 5.
      Parameters:
        `pfx` - the port mac prefix

    - #### setPortConfig

          public void setPortConfig(Set<PortConfig> portConfig)

      Sets the default port config.
      Parameters:
        `portConfig` - the default port config

    - #### overridePortConfig

          public void overridePortConfig(int index,
                                Set<PortConfig> portConfig)

      Overrides the default port config for the given port index.
      Parameters:
        `index` - the port index
        `portConfig` - the port config for that port

    - #### setPortFeatures

          public void setPortFeatures(Set<PortFeature> portFeatures)

      Sets the default port features.
      Parameters:
        `portFeatures` - the default port features

    - #### overridePortFeatures

          public void overridePortFeatures(int index,
                                  Set<PortFeature> features)

      Overrides the default port features for the given port index.
      Parameters:
        `index` - the port index
        `features` - the port features for that port

    - #### pickRate

          public static PortFeature pickRate(Set<PortFeature> portFeatures)

      Picks the first Rate flag and returns it.
      Parameters:
        `portFeatures` - the port features to examine
      Returns:
        the first rate constant found

    - #### pickCurrentSpeed

          public static long pickCurrentSpeed(PortFeature rate)

      Using the specified rate, divides by 2 to provide a fake current port speed value.
      Parameters:
        `rate` - port rate
      Returns:
        fake current port speed

    - #### pickMaxSpeed

          public static long pickMaxSpeed(PortFeature rate)

      Uses the specified rate to return a fake max port speed value.
      Parameters:
        `rate` - port rate
      Returns:
        fake max port speed

Copyright © 2014. All Rights Reserved.