Class AMPExtension

    • Constructor Detail

      • AMPExtension

        public AMPExtension​(String from,
                            String to,
                            AMPExtension.Status status)
        Create a new AMPExtension instance with defined from, to and status attributes. Used to create incoming packets.
        Parameters:
        from - jid that triggered this amp callback.
        to - receiver of this amp receipt.
        status - status of this amp receipt.
      • AMPExtension

        public AMPExtension()
        Create a new amp request extension to be used with outgoing message.
    • Method Detail

      • getFrom

        public String getFrom()
        Get the JID that triggered this AMP callback.
        Returns:
        jid that triggered this amp callback.
      • getTo

        public String getTo()
        Get the receiver of this AMP receipt.
        Returns:
        receiver of this amp receipt.
      • getRules

        public List<AMPExtension.RulegetRules()
        Returns a unmodifiable List of the rules in the packet.
        Returns:
        a unmodifiable List of the rules in the packet.
      • addRule

        public void addRule​(AMPExtension.Rule rule)
        Adds a rule to the amp element. Amp can have any number of rules.
        Parameters:
        rule - the rule to add.
      • getRulesCount

        public int getRulesCount()
        Returns a count of the rules in the AMP packet.
        Returns:
        the number of rules in the AMP packet.
      • setPerHop

        public void setPerHop​(boolean enabled)
        Sets this amp ruleset to be "per-hop".
        Parameters:
        enabled - true if "per-hop" should be enabled
      • isPerHop

        public boolean isPerHop()
        Returns true is this ruleset is "per-hop".
        Returns:
        true is this ruleset is "per-hop".
      • getElementName

        public String getElementName()
        Returns the XML element name of the extension sub-packet root element. Always returns "amp"
        Specified by:
        getElementName in interface NamedElement
        Returns:
        the XML element name of the stanza extension.
      • getNamespace

        public String getNamespace()
        Returns the XML namespace of the extension sub-packet root element. According the specification the namespace is always "http://jabber.org/protocol/xhtml-im"
        Specified by:
        getNamespace in interface FullyQualifiedElement
        Returns:
        the XML namespace of the stanza extension.
      • toXML

        public String toXML​(XmlEnvironment enclosingNamespace)
        Returns the XML representation of a XHTML extension according the specification.
        Specified by:
        toXML in interface Element