Package rocks.xmpp.core.net
Class TcpConnection
- java.lang.Object
-
- rocks.xmpp.core.net.AbstractConnection
-
- rocks.xmpp.core.net.TcpConnection
-
- All Implemented Interfaces:
AutoCloseable
,Connection
,StreamHandler
- Direct Known Subclasses:
NettyChannelConnection
,SocketConnection
public abstract class TcpConnection extends AbstractConnection
Defines characteristics of a TCP binding, like stream encryption via TLS and stream compression.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
compressConnection(String method, Runnable onSuccess)
Compresses the connection.abstract void
secureConnection()
Secures the connection with TLS.-
Methods inherited from class rocks.xmpp.core.net.AbstractConnection
close, closeAsync, closeAsync, getConfiguration, getStreamId, handleElement, isClosed, isUsingAcknowledgements
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.core.net.Connection
closeFuture, flush, getRemoteAddress, isSecure, open, send, write
-
-
-
-
Method Detail
-
secureConnection
public abstract void secureConnection() throws Exception
Secures the connection with TLS.- Throws:
Exception
- Any exception which may occur during TLS handshake.
-
compressConnection
public abstract void compressConnection(String method, Runnable onSuccess) throws Exception
Compresses the connection.- Parameters:
method
- The compression method.onSuccess
- Invoked after the compression method has been chosen, but before compression is applied.- Throws:
Exception
- Any exception which may occur during compression.
-
-