Class SMUtils

    • Constructor Detail

    • Method Detail

      • incrementHeight

        public static long incrementHeight​(long height)
        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

        public static 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.
        Parameters:
        reportedHandledCount - TODO javadoc me please
        lastKnownHandledCount - TODO javadoc me please
        Returns:
        the delta