Class HistoryRequest

java.lang.Object
org.jivesoftware.openfire.muc.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 Summary

    Constructors
    Constructor
    Description
    HistoryRequest(org.dom4j.Element userFragment)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the total number of characters to receive in the history.
    int
    Returns the total number of messages to receive in the history.
    int
    Returns the number of seconds to use to filter the messages received during that time.
    Returns the since date to use to filter the messages received during that time.
    void
    sendHistory(MUCOccupant occupant, MUCRoomHistory roomHistory)
    Sends the smallest amount of traffic that meets any combination of the requested criteria.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HistoryRequest

      public HistoryRequest(org.dom4j.Element userFragment)
  • Method Details

    • 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(MUCOccupant occupant, MUCRoomHistory roomHistory)
      Sends the smallest amount of traffic that meets any combination of the requested criteria.
      Parameters:
      occupant - the user that will receive the history.
      roomHistory - the history of the room.