edu.internet2.ndt

## Class Message

- java.lang.Object
- - edu.internet2.ndt.Message

-     public class Message
      extends Object

  Class to define Message. Messages are composed of a "type" and a body. Some examples of message types are: COMM_FAILURE, SRV_QUEUE, MSG_LOGIN, TEST_PREPARE. Messages are defined to have a "length" field too. Currently, 2 bytes of the message body" byte array are often used to store length (For example, second/third array positions)

  TODO for a later release: It may be worthwhile exploring whether MessageTypes could be merged here instead of being located in NDTConstants. Message/Type could also be made into an enumeration and checks for the current MessageType being assigned could be incorporated.

  See Also:
    `for more Message Types.`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) byte[]` | `_yaBody`
    `(package private) byte` | `_yType`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Message()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBody()` Get Message body as array
    `byte` | `getType()` Get Message Type
    `void` | `initBodySize(int iParamSize)` Utility method to initialize Message body
    `void` | `setBody(byte[] baParamBody)` Set Message body, given a byte array input
    `void` | `setBody(byte[] baParamBody, int iParamSize)` Set Message body, given a byte array and a size parameter.
    `void` | `setType(byte bParamType)` Set Message Type

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

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

- - ### Field Detail

    - #### _yaBody

          byte[] _yaBody

    - #### _yType

          byte _yType

  - ### Constructor Detail

    - #### Message

          public Message()

  - ### Method Detail

    - #### getBody

          public byte[] getBody()

      Get Message body as array
      Returns:
        byte array message body

    - #### getType

          public byte getType()

      Get Message Type
      Returns:
        byte indicating Message Type

    - #### initBodySize

          public void initBodySize(int iParamSize)

      Utility method to initialize Message body
      Parameters:
        `iParamSize` - byte array size

    - #### setBody

          public void setBody(byte[] baParamBody)

      Set Message body, given a byte array input
      Parameters:
        `baParamBody` - message body byte array

    - #### setBody

          public void setBody(byte[] baParamBody,
                              int iParamSize)

      Set Message body, given a byte array and a size parameter. This may be useful if user wants to initialize the message, and then continue to populate it later. This method is unused currently.
      Parameters:
        `iParamSize` - byte array size
        `baParamBody` - message body byte array

    - #### setType

          public void setType(byte bParamType)

      Set Message Type
      Parameters:
        `bParamType` - byte indicating Message Type