Class StreamManager

java.lang.Object
org.jivesoftware.openfire.streammanagement.StreamManager

public class StreamManager extends Object
XEP-0198 Stream Manager. Handles client/server messages acknowledgement.
Author:
jonnyheavey
  • Field Details

  • Constructor Details

    • StreamManager

      public StreamManager(LocalSession session)
  • Method Details

    • isStreamManagementActive

      public static boolean isStreamManagementActive()
    • getResume

      public boolean getResume()
      Returns true if a stream is resumable.
      Returns:
      True if a stream is resumable.
    • process

      public void process(org.dom4j.Element element)
      Processes a stream management element.
      Parameters:
      element - The stream management element to be processed.
    • formalClose

      public void formalClose()
      Called when a session receives a closing stream tag, this prevents the session from being detached.
    • sendServerAcknowledgement

      public void sendServerAcknowledgement()
      Sends XEP-0198 acknowledgement <a /> to client from server
    • sentStanza

      public void sentStanza(org.xmpp.packet.Packet packet)
      Registers that Openfire sends a stanza to the client (which is expected to be acknowledged later).
      Parameters:
      packet - The stanza that is sent.
    • onClose

      public void onClose(PacketRouter router, org.xmpp.packet.JID serverAddress)
    • onResume

      public void onResume(org.xmpp.packet.JID serverAddress, long h)
    • isEnabled

      public boolean isEnabled()
      Determines whether Stream Management enabled for session this manager belongs to.
      Returns:
      true when stream management is enabled, otherwise false.
    • incrementServerProcessedStanzas

      public void incrementServerProcessedStanzas()
      Increments the count of stanzas processed by the server since Stream Management was enabled.
    • getTerminationDelegates

      public Set<TerminationDelegate> getTerminationDelegates()
      Returns a defensive copy of all delegates that can determine if a detached session can be terminated.
      Returns:
      all delegates that can determine if a detached session can be terminated.
    • addTerminationDelegate

      public void addTerminationDelegate(@Nonnull TerminationDelegate delegate)
      Adds a new delegate that can determine if a detached session can be terminated. When no such delegate is registered for a session, the server default behavior will determine if a detached session can be terminated. This method will add delegates, unless the new delegate is equal to a previously registered delegate. In such case, this method will silently ignore the invocation.
      Parameters:
      delegate - the delegate to register with the session
    • removeTerminationDelegate

      public void removeTerminationDelegate(@Nonnull TerminationDelegate delegate)
      Removes a delegate that can determine if a detached session can be terminated. When no such delegate is registered for a session, the server default behavior will determine if a detached session can be terminated. This method will silently ignore an invocation to remove a delegate that was not registered with the session.
      Parameters:
      delegate - the delegate to register with the session