com.h3c.of.lib.msg

## Class Role

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

- All Implemented Interfaces:
    Message, Structure
  Direct Known Subclasses:
    OfmRoleReply, OfmRoleRequest

      public abstract class Role
      extends OpenflowMessage

  Base class for OfmRoleRequest and OfmRoleReply.

- - ### 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
    --- | ---
    `long` | `getGenerationId()` Returns master election generation ID; Since 1.2.
    `ControllerRole` | `getRole()` Returns the controller role; Since 1.2.
    `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

    - #### getRole

          public ControllerRole getRole()

      Returns the controller role; Since 1.2.
      Returns:
        the controller role

    - #### getGenerationId

          public long getGenerationId()

      Returns master election generation ID; Since 1.2.
      Returns:
        the generation ID

Copyright © 2014. All Rights Reserved.