public final class CompressionManager extends StreamFeatureNegotiator
If you enable this manager, stream compression will be used, if available. Note that stream compression should not be used, when you use TLS.XMPP Core [1] specifies the use of Transport Layer Security (TLS; see RFC 5246 [2]) for encryption of XML streams, and TLS includes the ability to compress encrypted traffic (see RFC 3749 [3]). However, not all computing platforms are able to implement TLS, and traffic compression may be desirable for communication by applications on such computing platforms. This document defines a mechanism for negotiating the compression of XML streams outside the context of TLS.
StreamFeatureNegotiator.Status| Modifier and Type | Field and Description |
|---|---|
static CompressionMethod |
DEFLATE
Deprecated.
|
static CompressionMethod |
GZIP
Deprecated.
|
static CompressionMethod |
ZLIB
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canProcess(Object element)
Checks, whether the element can be processed by the feature negotiator.
|
List<CompressionMethod> |
getConfiguredCompressionMethods()
Gets the configured compression methods.
|
CompressionMethod |
getNegotiatedCompressionMethod()
Gets the negotiated compression method.
|
boolean |
needsRestart()
Checks, if the feature needs a stream restart after it has been successfully negotiated.
|
StreamFeatureNegotiator.Status |
processNegotiation(Object element)
Processes a feature protocol element or the feature element itself.
|
addFeatureListener, getFeatureClassisEnabled, setEnabled@Deprecated public static final CompressionMethod ZLIB
CompressionMethod.ZLIB@Deprecated public static final CompressionMethod GZIP
CompressionMethod.GZIP@Deprecated public static final CompressionMethod DEFLATE
CompressionMethod.DEFLATEpublic 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 needsRestart()
By default this method returns false.
needsRestart in class StreamFeatureNegotiatorpublic 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 CompressionMethod getNegotiatedCompressionMethod()
public final List<CompressionMethod> getConfiguredCompressionMethods()
Copyright © 2014–2016 XMPP.rocks. All rights reserved.