Interface MessageTable

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void checkConsumedMemory()
      Checks whether the consumed memory is allowed and performs the appropriate actions.
      int clean​(long currentTime, DMQManager dmqManager)
      Cleans the table from invalid messages.
      Message get​(String msgId)
      Returns the specified message.
      int getConsumedMemory()
      Returns the amount of memory in bytes consumed by this message table.
      Map<String,​Message> getMap()
      Returns a map of messages from this table indexed by their message identifiers.
      void put​(Message msg)
      Adds a message in this table.
      void remove​(String msgId)
      Removes the specified message.
      int size()
      Returns the exact number of all the messages that are contained by this table.
    • Method Detail

      • getConsumedMemory

        int getConsumedMemory()
        Returns the amount of memory in bytes consumed by this message table.
        Returns:
        amount of memory in bytes
      • put

        void put​(Message msg)
        Adds a message in this table.
        Parameters:
        msg - the message to be added
      • checkConsumedMemory

        void checkConsumedMemory()
        Checks whether the consumed memory is allowed and performs the appropriate actions.
      • get

        Message get​(String msgId)
        Returns the specified message.
        Parameters:
        msgId - the identifier of the message to return
        Returns:
        the specified message
      • clean

        int clean​(long currentTime,
                  DMQManager dmqManager)
        Cleans the table from invalid messages. The detected invalid messages should be removed from the table, deleted if necessary (if persistent), and added to the dead message queue manager. The number of messages to be checked depends on the implementation, i.e. all the messages from the table do not have to be checked.
        Parameters:
        currentTime - the time from which messages are considered invalid
        dmqManager - the dead message queue manager
        Returns:
        the number of invalid messages
      • remove

        void remove​(String msgId)
        Removes the specified message.
        Parameters:
        msgId - the identifier of the message to remove
      • size

        int size()
        Returns the exact number of all the messages that are contained by this table.
        Returns:
        the number of messages in this table
      • getMap

        Map<String,​Message> getMap()
        Returns a map of messages from this table indexed by their message identifiers. A subset of the messages may be returned depending on the implementation. All the messages from the table do not have to be returned.
        Returns:
        a map of messages from this table.