org.licas

## Class MessageInfo

- java.lang.Object
- - org.licas.MessageInfo

-     public class MessageInfo
      extends java.lang.Object

  This class stores information communication messages, or message objects in general. This can be used to model agent-like messages with communication IDs and even state transitions. Two states are stored - one is for the current message communication thread and one is for the autonomic component itself. If the component is processing more than one message, then its state does not have to relate to this message or process in particular. This class only provides the variable fields. To actually implement state transitions, etc., requires additional coding.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageInfo(java.lang.Object theMessage)` Create a new instance of MessageInfo.
    `MessageInfo(java.lang.String theCommID, java.lang.Object theMessage)` Create a new instance of MessageInfo.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `clone()` Get a copy of this `MessageInfo` object.
    `java.lang.String` | `getCommID()` Get the message communication ID.
    `java.lang.String` | `getInOut()` Get the input-output status of the message.
    `java.lang.Object` | `getMessage()` Get the message.
    `java.lang.String` | `getMessageState()` Get the state for the function that is being executed.
    `java.lang.String` | `getServiceState()` Get the state for the auto service component itself.
    `long` | `getTimeStamp()` Get the time the message was logged at.
    `boolean` | `isSameID(MessageInfo thisMessage)` Return true if this message has the same ID as the one passed in.
    `boolean` | `isSameObj(MessageInfo thisMessage)` Return true if this message is the same object the one passed in.
    `void` | `setCommID(java.lang.String theCommID)` Set the message communication ID.
    `void` | `setInOut(java.lang.String theInOut)` Set whether an input or an output message type.
    `void` | `setMessage(java.lang.Object theMessage)` Set the message value.
    `void` | `setMessageState(java.lang.String theMessageState)` Set the state for the current function that is being executed.
    `void` | `setServiceState(java.lang.String theServiceState)` Set the state for the auto service component itself.
    `void` | `setTimeStamp()` Set the time stamp for the message.
    `void` | `setTimeStamp(long theTimeStamp)` Set the time stamp for the message.

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

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

- - ### Constructor Detail

    - #### MessageInfo

          public MessageInfo(java.lang.Object theMessage)

      Create a new instance of MessageInfo.
      Parameters:
        `theMessage` - the message.

    - #### MessageInfo

          public MessageInfo(java.lang.String theCommID,
                             java.lang.Object theMessage)

      Create a new instance of MessageInfo.
      Parameters:
        `theCommID` - a message communication ID or key.
        `theMessage` - the message. The can also be a client URI.

  - ### Method Detail

    - #### setMessage

          public void setMessage(java.lang.Object theMessage)

      Set the message value.
      Parameters:
        `theMessage` - the value of message.

    - #### getMessage

          public java.lang.Object getMessage()

      Get the message.
      Returns:
        the value of message.

    - #### setCommID

          public void setCommID(java.lang.String theCommID)

      Set the message communication ID.
      Parameters:
        `theCommID` - the communication ID.

    - #### getCommID

          public java.lang.String getCommID()

      Get the message communication ID.
      Returns:
        the value of commID.

    - #### setTimeStamp

          public void setTimeStamp()

      Set the time stamp for the message. This can be set only once. It is stored in the form of milliseconds created from `Date.getTime()`.

    - #### setTimeStamp

          public void setTimeStamp(long theTimeStamp)

      Set the time stamp for the message. This can be set only once. It should be in the form of milliseconds created from `Date.getTime()`.
      Parameters:
        `theTimeStamp` - a time stamp for the message instance.

    - #### getTimeStamp

          public long getTimeStamp()

      Get the time the message was logged at. This should be in the form of milliseconds from `Date.getTime()`.
      Returns:
        the time stamp value.

    - #### setInOut

          public void setInOut(java.lang.String theInOut)

      Set whether an input or an output message type. Can be either `AiConst`.`INPUT`, or `OUTPUT`.
      Parameters:
        `theInOut` - the value indicating an input or an output message type.

    - #### getInOut

          public java.lang.String getInOut()

      Get the input-output status of the message.
      Returns:
        the value of inOut.

    - #### setMessageState

          public void setMessageState(java.lang.String theMessageState)

      Set the state for the current function that is being executed.
      Parameters:
        `theMessageState` - the service function state.

    - #### getMessageState

          public java.lang.String getMessageState()

      Get the state for the function that is being executed.
      Returns:
        the value of messageState.

    - #### setServiceState

          public void setServiceState(java.lang.String theServiceState)

      Set the state for the auto service component itself.
      Parameters:
        `theServiceState` - the auto component's state.

    - #### getServiceState

          public java.lang.String getServiceState()

      Get the state for the auto service component itself.
      Returns:
        the value of serviceState.

    - #### isSameObj

          public boolean isSameObj(MessageInfo thisMessage)

      Return true if this message is the same object the one passed in.
      Parameters:
        `thisMessage` - the message to compare to.
      Returns:
        true if the same based on Object similarity values.

    - #### isSameID

          public boolean isSameID(MessageInfo thisMessage)

      Return true if this message has the same ID as the one passed in.
      Parameters:
        `thisMessage` - the message to compare to.
      Returns:
        true if the same, based on ID values.

    - #### clone

          public java.lang.Object clone()

      Get a copy of this `MessageInfo` object.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:
        a copy of this object, with a direct message reference.