public final class StreamManager extends ClientStreamFeatureNegotiator<StreamManagement>
Manages the stream as described in XEP-0198: Stream Management.
This class enables stream management during stream negotiation, if the stream management feature has been enabled before login:
xmppSession.enableFeature(StreamManagement.NAMESPACE);
Modifier and Type | Method and Description |
---|---|
boolean |
canProcess(java.lang.Object element)
Checks, whether the element can be processed by the feature negotiator.
|
java.util.function.Predicate<Stanza> |
getRequestStrategy()
Gets the request strategy.
|
java.lang.String |
getStreamManagementId()
Gets the “SM-ID”.
|
void |
incrementInboundStanzaCount()
Increments the inbound stanza count.
|
boolean |
isActive()
Returns true, as soon as the server has enabled stream management, i.e. if both client and server are using stream management.
|
boolean |
isResumable()
If the server will allow the stream to be resumed.
|
void |
markUnacknowledged(Stanza stanza)
Marks a stanza as unacknowledged.
|
StreamNegotiationResult |
processNegotiation(java.lang.Object element)
Processes a feature protocol element or the feature element itself.
|
void |
reset()
Resets any client enabled state.
|
AsyncResult<java.lang.Boolean> |
resume()
Resumes the stream.
|
void |
setRequestStrategy(java.util.function.Predicate<Stanza> requestStrategy)
Sets the request strategy.
|
getFeatureClass
isEnabled, setEnabled
public final StreamNegotiationResult processNegotiation(java.lang.Object element)
StreamFeatureNegotiator
Processes a feature protocol element or the feature element itself.
element
- The XML element, which belongs to the feature negotiation, e.g. <challenge/>
for SASL negotiation or the feature element itself, e.g. <mechanisms/>
.public final boolean canProcess(java.lang.Object element)
StreamFeatureNegotiator
Checks, whether the element can be processed by the feature negotiator.
element
- The feature protocol element, e.g. <challenge/>
. The element is never the feature element itself, e.g. <mechanisms/>
, which is advertised in the <stream:features/>
element.public final void incrementInboundStanzaCount()
Increments the inbound stanza count.
public void markUnacknowledged(Stanza stanza)
Marks a stanza as unacknowledged.
stanza
- The stanza.public final java.util.function.Predicate<Stanza> getRequestStrategy()
Gets the request strategy.
RequestStrategies
public final void setRequestStrategy(java.util.function.Predicate<Stanza> requestStrategy)
Sets the request strategy.
requestStrategy
- The request strategy.RequestStrategies
public final boolean isActive()
Returns true, as soon as the server has enabled stream management, i.e. if both client and server are using stream management.
public final boolean isResumable()
If the server will allow the stream to be resumed.
public final java.lang.String getStreamManagementId()
Gets the “SM-ID”.
The ‘id’ attribute defines a unique identifier for purposes of stream management (an “SM-ID”). The SM-ID MUST be generated by the server. The client MUST consider the SM-ID to be opaque and therefore MUST NOT assign any semantic meaning to the SM-ID.
public void reset()
Resets any client enabled state.
public AsyncResult<java.lang.Boolean> resume()
Resumes the stream.
Copyright © 2014–2019 XMPP.rocks. All rights reserved.