com.h3c.of.lib.msg

## Class TableFeatureFactory

- java.lang.Object
- - com.h3c.of.lib.AbstractFactory
  - - com.h3c.of.lib.msg.TableFeatureFactory

-     public class TableFeatureFactory
      extends AbstractFactory

  A factory for `table feature properties`.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TableFeaturePropAction` | `createActionProp(ProtocolVersion pv, TableFeaturePropType type, Set<ActionType> actionTypes)` Creates a table features action property, for the given protocol version, and the specified action types.
    `static TableFeaturePropAction` | `createActionProp(ProtocolVersion pv, TableFeaturePropType type, Set<ActionType> actionTypes, List<ActExperimenter> actionExper)` Creates a table features action property, for the given protocol version, and the specified action types and experimenter action types.
    `static TableFeaturePropExper` | `createExperProp(ProtocolVersion pv, TableFeaturePropType type, ExperimenterId eid, long expDefType, byte[] data)` Creates a table features experimenter property, for the given protocol version, and the specified experimenter data.
    `static TableFeaturePropExper` | `createExperProp(ProtocolVersion pv, TableFeaturePropType type, int id, long expDefType, byte[] data)` Creates a table features experimenter property, for the given protocol version, and the specified experimenter data.
    `static TableFeaturePropInstr` | `createInstrProp(ProtocolVersion pv, TableFeaturePropType type, Set<InstructionType> ins)` Creates a table features instructions property, for the given protocol version, indicating support for the specified instruction types.
    `static TableFeaturePropInstr` | `createInstrProp(ProtocolVersion pv, TableFeaturePropType type, Set<InstructionType> ins, List<InstrExperimenter> insExp)` Creates a table features instructions property, for the given protocol version, indicating support for the specified instruction types, as well as the specified experimenter instructions.
    `static TableFeaturePropNextTable` | `createNextTablesProp(ProtocolVersion pv, TableFeaturePropType type, Set<TableId> tableIds)` Creates a table features next-tables property, for the given protocol version, and the specified table IDs.
    `static TableFeaturePropOxm` | `createOxmProp(ProtocolVersion pv, TableFeaturePropType type, Map<OxmBasicFieldType,Boolean> fields)` Creates a table features OXM property, for the given protocol version, and the specified match fields.
    `static TableFeaturePropOxm` | `createOxmProp(ProtocolVersion pv, TableFeaturePropType type, Map<OxmBasicFieldType,Boolean> fields, List<MFieldExperimenter> expFields)` Creates a table features OXM property, for the given protocol version, and the specified match fields.
    `static void` | `encodeProp(ProtocolVersion pv, TableFeatureProp prop, OfPacketWriter pkt)` Encodes a table feature property, writing it into the supplied buffer.
    `static void` | `encodePropList(ProtocolVersion pv, List<TableFeatureProp> props, OfPacketWriter pkt)` Encodes a list of table feature properties, writing them into the supplied buffer.
    `static int` | `getPropLength(TableFeatureProp prop)` Returns the length of the table feature property in bytes, when encoded.
    `static List<TableFeatureProp>` | `parsePropList(int targetRi, OfPacketReader pkt, ProtocolVersion pv)` Parses a list of Table Feature properties from the supplied buffer.
    `protected String` | `tag()` Returns an identifying tag for the table feature factory.
    `static String` | `toDebugString(int indent, List<TableFeatureProp> props)` Outputs a list of table feature properties in debug string format.
    `static String` | `toDebugString(List<TableFeatureProp> props)` Outputs a list of table feature properties in debug string format.

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

      `mpe, mpe, mpe, mpe`

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

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

- - ### Method Detail

    - #### tag

          protected String tag()

      Returns an identifying tag for the table feature factory.
      Specified by:
        `tag` in class `AbstractFactory`
      Returns:
        an identifying tag

    - #### parsePropList

          public static List<TableFeatureProp> parsePropList(int targetRi,
                                             OfPacketReader pkt,
                                             ProtocolVersion pv)
                                                      throws MessageParseException

      Parses a list of Table Feature properties from the supplied buffer. The caller must calculate and specify the target reader index of the buffer that marks the end of the list, so we know when to stop.

      Note that this method causes the reader index of the underlying `PacketBuffer` to be advanced by the length of the list, which should leave the read index at `targetRi`.

      This method delegates to `parseProp(com.h3c.of.lib.OfPacketReader, com.h3c.of.lib.ProtocolVersion)` for each individual property.

      Parameters:
        `targetRi` - the target reader index
        `pkt` - the data buffer
        `pv` - the protocol version
      Returns:
        a list of parsed table feature properties
      Throws:
        `MessageParseException` - if a problem parsing the buffer
        `VersionMismatchException` - if version is < 1.3

    - #### createInstrProp

          public static TableFeaturePropInstr createInstrProp(ProtocolVersion pv,
                                              TableFeaturePropType type,
                                              Set<InstructionType> ins)

      Creates a table features instructions property, for the given protocol version, indicating support for the specified instruction types.

      The `type` parameter should be one of:

      - INSTRUCTIONS
      - INSTRUCTIONS_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `ins` - supported instructions
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createInstrProp

          public static TableFeaturePropInstr createInstrProp(ProtocolVersion pv,
                                              TableFeaturePropType type,
                                              Set<InstructionType> ins,
                                              List<InstrExperimenter> insExp)

      Creates a table features instructions property, for the given protocol version, indicating support for the specified instruction types, as well as the specified experimenter instructions.

      The `type` parameter should be one of:

      - INSTRUCTIONS
      - INSTRUCTIONS_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `ins` - supported instructions
        `insExp` - supported experimenter instructions
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createNextTablesProp

          public static TableFeaturePropNextTable createNextTablesProp(ProtocolVersion pv,
                                                       TableFeaturePropType type,
                                                       Set<TableId> tableIds)

      Creates a table features next-tables property, for the given protocol version, and the specified table IDs.

      The `type` parameter should be one of:

      - NEXT_TABLES
      - NEXT_TABLES_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `tableIds` - the table IDs
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createActionProp

          public static TableFeaturePropAction createActionProp(ProtocolVersion pv,
                                                TableFeaturePropType type,
                                                Set<ActionType> actionTypes)

      Creates a table features action property, for the given protocol version, and the specified action types.

      The `type` parameter should be one of:

      - WRITE_ACTIONS
      - WRITE_ACTIONS_MISS
      - APPLY_ACTIONS
      - APPLY_ACTIONS_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `actionTypes` - the supported action types
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createActionProp

          public static TableFeaturePropAction createActionProp(ProtocolVersion pv,
                                                TableFeaturePropType type,
                                                Set<ActionType> actionTypes,
                                                List<ActExperimenter> actionExper)

      Creates a table features action property, for the given protocol version, and the specified action types and experimenter action types.

      The `type` parameter should be one of:

      - WRITE_ACTIONS
      - WRITE_ACTIONS_MISS
      - APPLY_ACTIONS
      - APPLY_ACTIONS_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `actionTypes` - the supported action types
        `actionExper` - the supported experimenter actions
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createOxmProp

          public static TableFeaturePropOxm createOxmProp(ProtocolVersion pv,
                                          TableFeaturePropType type,
                                          Map<OxmBasicFieldType,Boolean> fields)

      Creates a table features OXM property, for the given protocol version, and the specified match fields. A map is used to denote the supported types and whether they are maskable or not.

      The `type` parameter should be one of:

      - MATCH
      - WILDCARDS
      - WRITE_SETFIELD
      - WRITE_SETFIELD_MISS
      - APPLY_SETFIELD
      - APPLY_SETFIELD_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `fields` - the supported basic fields, and whether they are maskable
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createOxmProp

          public static TableFeaturePropOxm createOxmProp(ProtocolVersion pv,
                                          TableFeaturePropType type,
                                          Map<OxmBasicFieldType,Boolean> fields,
                                          List<MFieldExperimenter> expFields)

      Creates a table features OXM property, for the given protocol version, and the specified match fields. For the basic field types a map is used to denote the supported types and whether they are maskable or not; experimenter fields are passed in as a list.

      The `type` parameter should be one of:

      - MATCH
      - WILDCARDS
      - WRITE_SETFIELD
      - WRITE_SETFIELD_MISS
      - APPLY_SETFIELD
      - APPLY_SETFIELD_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `fields` - the supported basic fields, and whether they are maskable
        `expFields` - the supported experimenter fields
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createExperProp

          public static TableFeaturePropExper createExperProp(ProtocolVersion pv,
                                              TableFeaturePropType type,
                                              ExperimenterId eid,
                                              long expDefType,
                                              byte[] data)

      Creates a table features experimenter property, for the given protocol version, and the specified experimenter data.

      The `type` parameter should be one of:

      - EXPERIMENTER
      - EXPERIMENTER_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `eid` - the experimenter ID
        `expDefType` - the experimenter defined type
        `data` - the experimenter defined data
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### createExperProp

          public static TableFeaturePropExper createExperProp(ProtocolVersion pv,
                                              TableFeaturePropType type,
                                              int id,
                                              long expDefType,
                                              byte[] data)

      Creates a table features experimenter property, for the given protocol version, and the specified experimenter data.

      The `type` parameter should be one of:

      - EXPERIMENTER
      - EXPERIMENTER_MISS
      Parameters:
        `pv` - the protocol version
        `type` - the type of property
        `id` - the encoded experimenter ID
        `expDefType` - the experimenter defined type
        `data` - the experimenter defined data
      Returns:
        the property
      Throws:
        `VersionNotSupportedException` - if the version is not supported
        `NullPointerException` - if any required parameter is null
        `IllegalArgumentException` - if type is inappropriate

    - #### encodePropList

          public static void encodePropList(ProtocolVersion pv,
                            List<TableFeatureProp> props,
                            OfPacketWriter pkt)

      Encodes a list of table feature properties, writing them into the supplied buffer. Note that this method causes the writer index of the underlying `PacketBuffer` to be advanced by the length of all the written properties.
      Parameters:
        `pv` - the protocol version
        `props` - the properties
        `pkt` - the buffer into which the properties should be written

    - #### encodeProp

          public static void encodeProp(ProtocolVersion pv,
                        TableFeatureProp prop,
                        OfPacketWriter pkt)

      Encodes a table feature property, writing it into the supplied buffer. Note that this method causes the writer index of the underlying `PacketBuffer` to be advanced by the length of the property.
      Parameters:
        `pv` - the protocol version
        `prop` - the property
        `pkt` - the buffer into which the property is to be written

    - #### getPropLength

          public static int getPropLength(TableFeatureProp prop)

      Returns the length of the table feature property in bytes, when encoded. This method is provided to allow proper encoding of a table features multipart message body.
      Parameters:
        `prop` - the property
      Returns:
        its length in bytes, when encoded

    - #### toDebugString

          public static String toDebugString(List<TableFeatureProp> props)

      Outputs a list of table feature properties in debug string format.
      Parameters:
        `props` - the list of properties
      Returns:
        a multi-line string representation of the list of properties

    - #### toDebugString

          public static String toDebugString(int indent,
                             List<TableFeatureProp> props)

      Outputs a list of table feature properties in debug string format.
      Parameters:
        `indent` - the additional indent (number of spaces)
        `props` - the list of properties
      Returns:
        a multi-line string representation of the list of properties

Copyright © 2014. All Rights Reserved.