public class NettyChannelConnection extends AbstractConnection implements TcpBinding
A NIO connection based on Netty.
| Constructor and Description |
|---|
NettyChannelConnection(io.netty.channel.Channel channel,
StreamHandler streamHandler,
java.util.function.BiConsumer<java.lang.String,StreamElement> onRead,
java.util.function.Supplier<javax.xml.bind.Unmarshaller> unmarshallerSupplier,
java.util.function.BiConsumer<java.lang.String,StreamElement> onWrite,
java.util.function.Supplier<javax.xml.bind.Marshaller> marshallerSupplier,
java.util.function.Consumer<java.lang.Throwable> onException,
ConnectionConfiguration connectionConfiguration) |
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<java.lang.Void> |
closeFuture() |
void |
compressConnection(java.lang.String method,
java.lang.Runnable onSuccess)
Compresses the connection.
|
void |
flush() |
java.net.InetSocketAddress |
getRemoteAddress() |
boolean |
isSecure() |
java.util.concurrent.CompletionStage<java.lang.Void> |
open(SessionOpen sessionOpen) |
void |
secureConnection() |
java.util.concurrent.CompletionStage<java.lang.Void> |
send(StreamElement streamElement) |
java.lang.String |
toString() |
java.util.concurrent.CompletionStage<java.lang.Void> |
write(StreamElement streamElement) |
close, closeAsync, closeAsync, getConfiguration, getStreamId, isUsingAcknowledgementsequals, getClass, hashCode, notify, notifyAll, wait, wait, waitclose, closeAsync, closeAsync, getConfiguration, getStreamId, isUsingAcknowledgementspublic NettyChannelConnection(io.netty.channel.Channel channel,
StreamHandler streamHandler,
java.util.function.BiConsumer<java.lang.String,StreamElement> onRead,
java.util.function.Supplier<javax.xml.bind.Unmarshaller> unmarshallerSupplier,
java.util.function.BiConsumer<java.lang.String,StreamElement> onWrite,
java.util.function.Supplier<javax.xml.bind.Marshaller> marshallerSupplier,
java.util.function.Consumer<java.lang.Throwable> onException,
ConnectionConfiguration connectionConfiguration)
public final java.net.InetSocketAddress getRemoteAddress()
getRemoteAddress in interface Connectionpublic final java.util.concurrent.CompletionStage<java.lang.Void> open(SessionOpen sessionOpen)
open in interface Connectionpublic final java.util.concurrent.CompletionStage<java.lang.Void> send(StreamElement streamElement)
send in interface Connectionpublic final java.util.concurrent.CompletionStage<java.lang.Void> write(StreamElement streamElement)
write in interface Connectionpublic final void flush()
flush in interface Connectionpublic void secureConnection()
throws java.lang.Exception
secureConnection in interface TcpBindingjava.lang.Exceptionpublic final void compressConnection(java.lang.String method,
java.lang.Runnable onSuccess)
Compresses the connection.
compressConnection in interface TcpBindingmethod - The compression method. Supported methods are: “zlib”, “deflate” and “gzip”.onSuccess - Invoked after the compression method has been chosen, but before compression is applied.java.lang.IllegalArgumentException - If the compression method is unknown.public final boolean isSecure()
isSecure in interface Connectionpublic final java.util.concurrent.CompletionStage<java.lang.Void> closeFuture()
closeFuture in interface Connectionpublic final java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2019 XMPP.rocks. All rights reserved.