Class HistoryRequest


  • public class HistoryRequest
    extends Object
    Represents the amount of history requested by an occupant while joining a room. There are basically four ways to control the amount of history that a user may receive. Those are: limit by the maximum limit of characters to receive, limit by a maximum number of stanzas to receive, limit to receive only the messages before a given date or of the last X seconds.

    A user may combine any of these four methods. The idea is that the user will receive the smallest amount of traffic so the amount of history to collect will stop as soon as any of the requested method has reached its limit.

    Author:
    Gaston Dombiak
    • Constructor Detail

      • HistoryRequest

        public HistoryRequest​(org.dom4j.Element userFragment)
    • Method Detail

      • getMaxChars

        public int getMaxChars()
        Returns the total number of characters to receive in the history.
        Returns:
        total number of characters to receive in the history.
      • getMaxStanzas

        public int getMaxStanzas()
        Returns the total number of messages to receive in the history.
        Returns:
        the total number of messages to receive in the history.
      • getSeconds

        public int getSeconds()
        Returns the number of seconds to use to filter the messages received during that time. In other words, only the messages received in the last "X" seconds will be included in the history.
        Returns:
        the number of seconds to use to filter the messages received during that time.
      • getSince

        public Date getSince()
        Returns the since date to use to filter the messages received during that time. In other words, only the messages received since the datetime specified will be included in the history.
        Returns:
        the since date to use to filter the messages received during that time.
      • sendHistory

        public void sendHistory​(MUCRole joinRole,
                                MUCRoomHistory roomHistory)
        Sends the smallest amount of traffic that meets any combination of the requested criteria.
        Parameters:
        joinRole - the user that will receive the history.
        roomHistory - the history of the room.