org.licas

## Class MessageStore

- java.lang.Object
- - org.licas.MessageStore

-     public class MessageStore
      extends java.lang.Object

  Stores information on earlier invoked or transitional method processes.
  Author:
    Kieran Greer

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MessageStore()` Create a new instance of MessageStore.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addCommID(java.lang.String commID, MessageInfo messageInfo)` Add a communication id with its related client reference.
    `void` | `addMethodTransit(java.lang.String replyID)` Add a reply id to indicate that it has been registered, but not necessarily completed execution yet.
    `void` | `addSavedReply(java.lang.String replyID, java.lang.Object reply)` Add a reply id with its related method reply.
    `MessageInfo` | `getCommClient(java.lang.String commID)` Get the client message info for the communication id.
    `java.util.ArrayList<java.lang.String>` | `getCommIDs()` Get the list of current communication IDs.
    `java.util.ArrayList<java.lang.String>` | `getReplyIDs()` Get the list of current reply IDs.
    `MessageInfo` | `getSavedReply(java.lang.String replyID)` Get and remove the reply object for the reply id.
    `boolean` | `hasCommID(java.lang.String commID)` Return true if the communication ID is saved.
    `boolean` | `hasSavedReply(java.lang.String replyID)` Return true if the method reply is saved.
    `boolean` | `inTransit(java.lang.String replyID)` Return true if the method reply has been registered and/or may have completed.
    `void` | `removeCommID(java.lang.String commID)` Remove the communication ID from the stored list.
    `void` | `removeReplyID(java.lang.String replyID)` Remove the reply ID from the registered and stored lists, plus any stored object.

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

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

- - ### Constructor Detail

    - #### MessageStore

          public MessageStore()

      Create a new instance of MessageStore.

  - ### Method Detail

    - #### hasCommID

          public boolean hasCommID(java.lang.String commID)

      Return true if the communication ID is saved.
      Parameters:
        `commID` - the id to check for.
      Returns:
        true if communicationIDs contains it, false otherwise.

    - #### inTransit

          public boolean inTransit(java.lang.String replyID)

      Return true if the method reply has been registered and/or may have completed.
      Parameters:
        `replyID` - the id to check for.
      Returns:
        true if transitReplies or savedReplies contains it, false otherwise.

    - #### hasSavedReply

          public boolean hasSavedReply(java.lang.String replyID)

      Return true if the method reply is saved.
      Parameters:
        `replyID` - the id to check for.
      Returns:
        true if savedReplies contains it, false otherwise.

    - #### getCommIDs

          public java.util.ArrayList<java.lang.String> getCommIDs()

      Get the list of current communication IDs.
      Returns:
        the key set to communicationIDs.

    - #### getReplyIDs

          public java.util.ArrayList<java.lang.String> getReplyIDs()

      Get the list of current reply IDs.
      Returns:
        the key set to savedReplies.

    - #### addCommID

          public void addCommID(java.lang.String commID,
                                MessageInfo messageInfo)

      Add a communication id with its related client reference.
      Parameters:
        `commID` - a unique comm id for the client.
        `messageInfo` - the client reference - URI or other. Can also be timestamped.

    - #### removeCommID

          public void removeCommID(java.lang.String commID)

      Remove the communication ID from the stored list.
      Parameters:
        `commID` - the id to remove.

    - #### getCommClient

          public MessageInfo getCommClient(java.lang.String commID)

      Get the client message info for the communication id.
      Parameters:
        `commID` - the id to check for.
      Returns:
        a stored messageInfo with the client reference, or null if one does not exist.

    - #### addSavedReply

          public void addSavedReply(java.lang.String replyID,
                                    java.lang.Object reply)

      Add a reply id with its related method reply.
      Parameters:
        `replyID` - a unique reply id for the client.
        `reply` - the reply object to store.

    - #### addMethodTransit

          public void addMethodTransit(java.lang.String replyID)

      Add a reply id to indicate that it has been registered, but not necessarily completed execution yet.
      Parameters:
        `replyID` - a unique reply id for the client.

    - #### removeReplyID

          public void removeReplyID(java.lang.String replyID)

      Remove the reply ID from the registered and stored lists, plus any stored object.
      Parameters:
        `replyID` - the id to remove.

    - #### getSavedReply

          public MessageInfo getSavedReply(java.lang.String replyID)

      Get and remove the reply object for the reply id.
      Parameters:
        `replyID` - the id to check for.
      Returns:
        a stored method reply, or null if one does not exist.