public final class StreamManager extends StreamFeatureNegotiator
This class enables stream management during stream negotiation, if the stream management feature has been enabled before login:
xmppSession.enableFeature(StreamManagement.NAMESPACE);
StreamFeatureNegotiator.Status| Modifier and Type | Method and Description |
|---|---|
boolean |
canProcess(Object element)
Checks, whether the element can be processed by the feature negotiator.
|
Predicate<Stanza> |
getRequestStrategy()
Gets the request strategy.
|
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.
|
StreamFeatureNegotiator.Status |
processNegotiation(Object element)
Processes a feature protocol element or the feature element itself.
|
void |
reset()
Resets any client enabled state.
|
AsyncResult<Boolean> |
resume()
Resumes the stream.
|
void |
setRequestStrategy(Predicate<Stanza> requestStrategy)
Sets the request strategy.
|
addFeatureListener, getFeatureClass, needsRestartisEnabled, setEnabledpublic final StreamFeatureNegotiator.Status processNegotiation(Object element) throws StreamNegotiationException
StreamFeatureNegotiatorprocessNegotiation in class StreamFeatureNegotiatorelement - The XML element, which belongs to the feature negotiation, e.g. <challenge/> for SASL negotiation or the feature element itself, e.g. <mechanisms/>.StreamNegotiationException - Any exception which might be thrown during a feature negotiation. Note that any exception thrown during the feature negotiation process is thrown by the XmppSession.connect() method and therefore will abort the connection process.public final boolean canProcess(Object element)
StreamFeatureNegotiatorcanProcess in class StreamFeatureNegotiatorelement - 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()
public void markUnacknowledged(Stanza stanza)
stanza - The stanza.public final Predicate<Stanza> getRequestStrategy()
RequestStrategiespublic final void setRequestStrategy(Predicate<Stanza> requestStrategy)
requestStrategy - The request strategy.RequestStrategiespublic final boolean isActive()
public final boolean isResumable()
public final String getStreamManagementId()
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()
public AsyncResult<Boolean> resume()
Copyright © 2014–2016 XMPP.rocks. All rights reserved.