Package rocks.xmpp.extensions.compress
Class CompressionManager
- java.lang.Object
-
- rocks.xmpp.extensions.compress.CompressionManager
-
- All Implemented Interfaces:
StreamFeatureNegotiator<CompressionFeature>
public final class CompressionManager extends Object implements StreamFeatureNegotiator<CompressionFeature>
Manages stream compression as described in XEP-0138: Stream Compression.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.
-
-
Constructor Summary
Constructors Constructor Description CompressionManager(Session session, TcpConnection tcpConnection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<CompressionMethod>
getConfiguredCompressionMethods()
Gets the configured compression methods.CompressionMethod
getNegotiatedCompressionMethod()
Gets the negotiated compression method.StreamNegotiationResult
processNegotiation(Object element)
Processes a feature protocol element or the feature element itself.
-
-
-
Constructor Detail
-
CompressionManager
public CompressionManager(Session session, TcpConnection tcpConnection)
-
-
Method Detail
-
processNegotiation
public final StreamNegotiationResult processNegotiation(Object element) throws StreamNegotiationException
Description copied from interface:StreamFeatureNegotiator
Processes a feature protocol element or the feature element itself.- Specified by:
processNegotiation
in interfaceStreamFeatureNegotiator<CompressionFeature>
- Parameters:
element
- The XML element, which belongs to the feature negotiation, e.g.<challenge/>
for SASL negotiation or the feature element itself, e.g.<mechanisms/>
.- Returns:
- The result of the feature negotiation.
- Throws:
StreamNegotiationException
- Any exception which might be thrown during a feature negotiation.
-
getNegotiatedCompressionMethod
public final CompressionMethod getNegotiatedCompressionMethod()
Gets the negotiated compression method.- Returns:
- The negotiated compression method.
-
getConfiguredCompressionMethods
public final List<CompressionMethod> getConfiguredCompressionMethods()
Gets the configured compression methods.- Returns:
- The configured compression method.
-
-