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

public class Messageextends 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).
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) byte[]
    Ya body.
    (package private) byte
    Message type byte.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new Message with default type and body.
  • Method Summary

    All Methods
    Modifier and Type
    Method
    Description
    byte[]
    Get Message body as array.
    byte
    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 Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • _yType

      byte _yType
      Message type byte.
    • _yaBody

      byte[] _yaBody
      Ya body.
  • Constructor Details

    • Message

      public Message()
      Creates a new Message with default type and body.
  • Method Details

    • getType

      public byte getType()
      Get Message Type.
      Returns:
      byte indicating Message Type
    • setType

      public void setType(byte bParamType)
      Set Message Type.
      Parameters:
      bParamType - byte indicating Message Type
    • getBody

      public byte[] getBody()
      Get Message body as array.
      Returns:
      byte array message body
    • 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:
      baParamBody - message body byte array
      iParamSize - byte array size
    • initBodySize

      public void initBodySize(int iParamSize)
      Utility method to initialize Message body.
      Parameters:
      iParamSize - byte array size