public final class WebSocketConnection extends Connection
WebSocketConnectionConfiguration,
XMPP Subprotocol for WebSocket| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
connect(rocks.xmpp.addr.Jid from,
String namespace,
Consumer<rocks.xmpp.addr.Jid> onStreamOpened)
Connects to the server and provides an optional 'from' attribute.
|
String |
getStreamId()
Gets the stream id of this connection.
|
boolean |
isSecure()
Indicates whether this connection is secured by TLS/SSL.
|
boolean |
isUsingAcknowledgements()
Indicates, whether this connection is using acknowledgements.
|
CompletableFuture<Void> |
send(StreamElement streamElement)
Sends an element over this connection.
|
String |
toString() |
getConfiguration, getHostname, getPort, getProxypublic final CompletableFuture<Void> send(StreamElement streamElement)
Connectionsend in class ConnectionstreamElement - The element.public final void connect(rocks.xmpp.addr.Jid from,
String namespace,
Consumer<rocks.xmpp.addr.Jid> onStreamOpened)
throws IOException
Connectionconnect in class Connectionfrom - The 'from' attribute.namespace - The content namespace, e.g. "jabber:client".onStreamOpened - The callback which gets notified when the stream gets opened, i.e. when the server has responded with a stream header. The parameter of the consumer is the stream id.IOException - If no connection could be established, e.g. due to unknown host.public final boolean isSecure()
ConnectionisSecure in class Connectionpublic final String getStreamId()
ConnectiongetStreamId in class Connectionpublic final boolean isUsingAcknowledgements()
ConnectionTCP and WebSocket connections use XEP-0198: Stream Management to acknowledge stanzas.
BOSH connections use another mechanism for acknowledgements, described in XEP-0124 § 9. Acknowledgements.
isUsingAcknowledgements in class ConnectionCopyright © 2014–2017 XMPP.rocks. All rights reserved.