Class StanzaForwardingManager

  • All Implemented Interfaces:
    ExtensionProtocol, DiscoverableInfo

    public final class StanzaForwardingManager
    extends Manager
    implements ExtensionProtocol, DiscoverableInfo
    This manager allows forwarding stanzas to other XMPP entities.

    Enabling this manager simply indicates support for the stanza forwarding extension in a service discovery response and has no further effect.

    By default, stanza forwarding support is not enabled.

    In order to check for a forwarded stanza, simply check for the Forwarded extension:

    
     Forwarded forwarded = message.getExtension(Forwarded.class);
     if (forwarded != null) {
         Message forwardedMessage = forwarded.getMessage();
     }
     
    • Method Detail

      • forwardMessage

        public void forwardMessage​(Message message,
                                   Jid to)
        Forwards a message to another XMPP entity.
        Parameters:
        message - The original message.
        to - The receiver.
      • getNamespace

        public final String getNamespace()
        Description copied from interface: ExtensionProtocol
        The protocol's main namespace. This is used to uniquely identify the extension protocol.
        Specified by:
        getNamespace in interface ExtensionProtocol
        Returns:
        The main namespace.