com.h3c.of.lib.msg

## Class OfmMultipartReply

- java.lang.Object
- - com.h3c.nbio.AbstractMessage
  - - com.h3c.of.lib.msg.OpenflowMessage
    - - com.h3c.of.lib.msg.OfmMultipartReply

- All Implemented Interfaces:
    Message, Structure
  Direct Known Subclasses:
    OfmMutableMultipartReply

      public class OfmMultipartReply
      extends OpenflowMessage

  Represents an OpenFlow MULTIPART_REPLY message; Since 1.3 (but see note).

  Important Note: Although MULTIPART_REPLY messages were only added to the protocol at 1.3, they are semantically equivalent to the (now deprecated) STATS_REPLY messages in 1.0, 1.1 and 1.2.

  For example, to create a "switch description reply" message (Stats-Reply/DESC) to send back to the controller from a mock-switch implementation emulating an OpenFlow 1.0 switch, one would do the following:

       OfmMultipartRequest request = ...;  // the message we are replying to

       OfmMutableMultipartReply reply = (OfmMutableMultipartReply)
            MessageFactory.create(MULTIPART_REPLY, request);

       MBodyMutableDesc desc = (MBodyMutableDesc)
            MpBodyFactory.createReplyBody(DESC);
       desc.mfrDesc(...).hwDesc(...).swDesc(...)
           .serialNum(...).dpDesc(...);

       reply.body((MultipartBody) desc.toImmutable());
       OpenflowMessage msgToSend = reply.toImmutable();

  When the message is encoded, the `MessageFactory` will use the version of the message to decide whether to encode it as a MULTIPART_REPLY or a STATS_REPLY.
  See Also:
    `OfmMultipartRequest`

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class com.h3c.of.lib.msg.OpenflowMessage

      `OpenflowMessage.Header`

  - ### Field Summary

    - ### Fields inherited from class com.h3c.nbio.AbstractMessage

      `length`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultipartBody` | `getBody()` Returns the body of the message; Since 1.3.
    `Set<MultipartReplyFlag>` | `getFlags()` Returns the set of multipart message reply flags; Since 1.3.
    `MultipartType` | `getMultipartType()` Returns the multipart message type; Since 1.3.
    `boolean` | `hasMore()` Returns `true` if the `MultipartReplyFlag.REPLY_MORE` flag is present.
    `String` | `toDebugString()` Returns a string representation useful for debugging.
    `String` | `toString()`
    `void` | `validate()` Validates this message for completeness and throws an exception if the message is considered "not complete".

    - ### Methods inherited from class com.h3c.of.lib.msg.OpenflowMessage

      `decodeHeader, getType, getVersion, getXid, hex, hex, length`

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

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

- - ### Method Detail

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `OpenflowMessage`

    - #### toDebugString

          public String toDebugString()

      Description copied from class: `OpenflowMessage`
      Returns a string representation useful for debugging. This default implementation delegates to `OpenflowMessage.toString()`, but subclasses are free to override this behavior.
      Specified by:
        `toDebugString` in interface `Structure`
      Overrides:
        `toDebugString` in class `OpenflowMessage`
      Returns:
        a (possibly multi-line) string representation of this message

    - #### validate

          public void validate()
                        throws IncompleteMessageException

      Description copied from class: `OpenflowMessage`
      Validates this message for completeness and throws an exception if the message is considered "not complete".

      This default implementation does nothing, i.e. default behavior is that messages are considered complete.

      Subclasses should override this method to check that mandatory fields or other internal state is present, throwing an exception if it is not.

      Overrides:
        `validate` in class `OpenflowMessage`
      Throws:
        `IncompleteMessageException` - if the message is not complete

    - #### getMultipartType

          public MultipartType getMultipartType()

      Returns the multipart message type; Since 1.3.
      Returns:
        the multipart message type.

    - #### getFlags

          public Set<MultipartReplyFlag> getFlags()

      Returns the set of multipart message reply flags; Since 1.3.
      Returns:
        the set of flags

    - #### hasMore

          public boolean hasMore()

      Returns `true` if the `MultipartReplyFlag.REPLY_MORE` flag is present.

      The presence of this flag indicates to the receiver that more (related) multipart-replies are on their way; Only the last reply in such a sequence will have this flag `false` (cleared).

      Returns:
        true

    - #### getBody

          public MultipartBody getBody()

      Returns the body of the message; Since 1.3.
      Returns:
        the body of the message

Copyright © 2014. All Rights Reserved.