Class ResumeRequest
java.lang.Object
org.jivesoftware.openfire.streammanagement.ResumeRequest
Represents a XEP-0198 stream resumption request: the data carried by a
<resume/> element.
This is used by both variants of stream resumption defined by XEP-0198:
- the traditional flow, in which the client sends a top-level
<resume/>element after having established a stream (see § 5, "Resumption"); and - the inline flow, in which the
<resume/>element is instead nested inside a SASL2 (XEP-0388)<authenticate/>element (see § 9.2, "Inline Stream Resumption").
<resume xmlns='urn:xmpp:sm:3' h='some-sequence-number' previd='some-long-sm-id'/>
-
Method Summary
Modifier and TypeMethodDescriptionstatic ResumeRequestfrom(org.dom4j.Element resumeElement) Parses a (traditional, top-level) XEP-0198<resume/>element.static ResumeRequestfromSasl2Authenticate(org.dom4j.Element authenticateElement) Parses the inline XEP-0198<resume/>content of a SASL2<authenticate/>element.longgetH()Returns the sequence number of the last stanza that the client received from the server over the former stream.Returns the Stream Management namespace that the client used for this request.Returns the SM-ID of the former stream that the client wishes to resume.toString()
-
Method Details
-
from
@Nonnull public static ResumeRequest from(@Nonnull org.dom4j.Element resumeElement) throws MalformedResumeRequestException Parses a (traditional, top-level) XEP-0198<resume/>element.- Parameters:
resumeElement- the<resume/>element (cannot be null).- Returns:
- the parsed request (never null).
- Throws:
MalformedResumeRequestException- if the element is malformed.
-
fromSasl2Authenticate
@Nullable public static ResumeRequest fromSasl2Authenticate(@Nonnull org.dom4j.Element authenticateElement) throws MalformedResumeRequestException Parses the inline XEP-0198<resume/>content of a SASL2<authenticate/>element. Returnsnullwhen the element carries no<resume/>child (in a namespace recognized as a Stream Management namespace), in which case there is nothing for the caller to act on.- Parameters:
authenticateElement- the<authenticate/>element (cannot be null).- Returns:
- the parsed request, or
nullif the element carries no inline resume request. - Throws:
MalformedResumeRequestException- if a<resume/>element is present but is malformed.
-
getPrevId
Returns the SM-ID of the former stream that the client wishes to resume.- Returns:
- the (still Base64-encoded) SM-ID.
-
getH
public long getH()Returns the sequence number of the last stanza that the client received from the server over the former stream.- Returns:
- a non-negative sequence number.
-
getNamespace
Returns the Stream Management namespace that the client used for this request.- Returns:
- a Stream Management namespace.
-
toString
-