Package org.jivesoftware.smack.sm
Class SMUtils
java.lang.Object
org.jivesoftware.smack.sm.SMUtils
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic long
calculateDelta
(long reportedHandledCount, long lastKnownHandledCount) Calculates the delta of the last known stanza handled count and the new reported stanza handled count while considering that the new value may be wrapped after 2^32-1.static long
incrementHeight
(long height) Increment the Stream Management height counter.
-
Constructor Details
-
SMUtils
public SMUtils()
-
-
Method Details
-
incrementHeight
Increment the Stream Management height counter. Quoting XEP-198 4.: "In the unlikely case that the number of stanzas handled during a stream management session exceeds the number of digits that can be represented by the unsignedInt datatype as specified in XML Schema Part 2 [10] (i.e., 2^32), the value of 'h' SHALL be reset from 2^32-1 back to zero (rather than being incremented to 2^32)."- Parameters:
height
- TODO javadoc me please- Returns:
- the incremented height
-
calculateDelta
Calculates the delta of the last known stanza handled count and the new reported stanza handled count while considering that the new value may be wrapped after 2^32-1.- Parameters:
reportedHandledCount
- TODO javadoc me pleaselastKnownHandledCount
- TODO javadoc me please- Returns:
- the delta
-