com.h3c.of.lib.msg

## Class HelloElementFactory

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

-     public class HelloElementFactory
      extends AbstractFactory

  Provides facilities for parsing, creating and encoding `HelloElement` instances.

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static HelloElement` | `createVersionBitmapElement(Set<ProtocolVersion> suppVers)` Creates a VERSION BITMAP hello element for the given supported versions.
    `static void` | `encodeElement(HelloElement elem, OfPacketWriter pkt)` Encodes a hello element, writing it into the supplied buffer.
    `static void` | `encodeElementList(List<HelloElement> elems, OfPacketWriter pkt)` Encodes a list of hello elements, writing it into the supplied buffer.
    `protected String` | `tag()` Returns an identifying tag for the hello element factory.

    - ### 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 hello element factory.
      Specified by:
        `tag` in class `AbstractFactory`
      Returns:
        an identifying tag

    - #### createVersionBitmapElement

          public static HelloElement createVersionBitmapElement(Set<ProtocolVersion> suppVers)

      Creates a VERSION BITMAP hello element for the given supported versions. Note that the `ProtocolVersion` in the header of the `OfmHello` message must be set to the highest version listed in the bitmap; so that version is embedded in this element structure so that it can be retrieved easily when constructing the HELLO message.
      Parameters:
        `suppVers` - supported versions
      Returns:
        the element
      Throws:
        `NullPointerException` - if suppVers is null
        `IllegalArgumentException` - if suppVers is empty

    - #### encodeElement

          public static void encodeElement(HelloElement elem,
                           OfPacketWriter pkt)

      Encodes a hello element, 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 element.
      Parameters:
        `elem` - the hello element
        `pkt` - the buffer into which the element is to be written

    - #### encodeElementList

          public static void encodeElementList(List<HelloElement> elems,
                               OfPacketWriter pkt)

      Encodes a list of hello elements, 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 written elements.
      Parameters:
        `elems` - the list of hello elements
        `pkt` - the buffer into which the elements are to be written

Copyright © 2014. All Rights Reserved.