Class StanzaIDUtil
java.lang.Object
org.jivesoftware.openfire.stanzaid.StanzaIDUtil
Utility methods that implement XEP-0359: Unique and Stable Stanza IDs.
- Author:
- Guus der Kinderen, guus.der.kinderen@gmail.com
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.xmpp.packet.PacketensureUniqueAndStableStanzaID(org.xmpp.packet.Packet packet, org.xmpp.packet.JID self) Modifies the stanza that's passed as a packet by adding a Stanza ID on behalf of what is assumed to be a local entity.static StringfindFirstUniqueAndStableStanzaID(org.xmpp.packet.Packet packet, String by) Returns the first stable and unique stanza-id value from the packet, that is defined for a particular 'by' value.
-
Constructor Details
-
StanzaIDUtil
public StanzaIDUtil()
-
-
Method Details
-
ensureUniqueAndStableStanzaID
public static org.xmpp.packet.Packet ensureUniqueAndStableStanzaID(org.xmpp.packet.Packet packet, org.xmpp.packet.JID self) Modifies the stanza that's passed as a packet by adding a Stanza ID on behalf of what is assumed to be a local entity.- Parameters:
packet- The inbound packet (cannot be null).self- The ID of the 'local' entity that will generate the stanza ID (cannot be null).- Returns:
- the updated packet
- See Also:
-
findFirstUniqueAndStableStanzaID
Returns the first stable and unique stanza-id value from the packet, that is defined for a particular 'by' value. This method does not evaluate 'origin-id' elements in the packet.- Parameters:
packet- The stanza (cannot be null).by- The 'by' value for which to return the ID (cannot be null or an empty string).- Returns:
- The unique and stable ID, or null if no such ID is found.
-