public final class BoshConnection extends AbstractConnection
The implementation of XEP-0124: Bidirectional-streams Over Synchronous HTTP (BOSH) and XEP-0206: XMPP Over BOSH.
| Modifier and Type | Method and Description |
|---|---|
java.util.concurrent.CompletionStage<java.lang.Void> |
closeFuture()
Returns a future which is complete, when the connection is closed.
|
long |
detach()
Detaches this BOSH session without closing (aka terminating) it.
|
void |
flush()
Flushes the connection.
|
java.net.InetSocketAddress |
getRemoteAddress()
Gets the remote address of this connection.
|
java.lang.String |
getRoute()
Gets the route.
|
java.lang.String |
getSessionId()
Gets the session id of this BOSH connection.
|
boolean |
isSecure()
Indicates whether this connection is secured by TLS/SSL.
|
boolean |
isUsingAcknowledgements()
Indicates whether this connection uses acknowledgements, e.g. by means of stream management or BOSH acks.
|
java.util.concurrent.CompletionStage<java.lang.Void> |
open(SessionOpen sessionOpen)
Opens the XML stream to the peer entity.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
send(StreamElement element)
Sends an element to the peer entity.
|
java.lang.String |
toString() |
java.util.concurrent.CompletableFuture<java.lang.Void> |
write(StreamElement streamElement)
Writes the element to the stream without really sending it.
|
close, closeAsync, closeAsync, getConfiguration, getStreamIdpublic final java.util.concurrent.CompletionStage<java.lang.Void> open(SessionOpen sessionOpen)
ConnectionOpens the XML stream to the peer entity.
sessionOpen - The session open information.public final boolean isSecure()
ConnectionIndicates whether this connection is secured by TLS/SSL.
public final java.util.concurrent.CompletionStage<java.lang.Void> closeFuture()
ConnectionReturns a future which is complete, when the connection is closed.
public final long detach()
Detaches this BOSH session without closing (aka terminating) it. This way the BOSH session is still alive on the server and can be ported over to a web page, but new BOSH requests are no longer sent by this connection.
public final java.util.concurrent.CompletableFuture<java.lang.Void> send(StreamElement element)
Connectionelement - The element.public final java.util.concurrent.CompletableFuture<java.lang.Void> write(StreamElement streamElement)
ConnectionWrites the element to the stream without really sending it. It must be flushed.
streamElement - The element.public final void flush()
ConnectionFlushes the connection. Any buffered elements written via Connection.write(StreamElement) are sent.
public final java.lang.String getSessionId()
Gets the session id of this BOSH connection.
public final java.net.InetSocketAddress getRemoteAddress()
ConnectionGets the remote address of this connection.
public final boolean isUsingAcknowledgements()
ConnectionIndicates whether this connection uses acknowledgements, e.g. by means of stream management or BOSH acks.
isUsingAcknowledgements in interface ConnectionisUsingAcknowledgements in class AbstractConnectionpublic final java.lang.String getRoute()
Gets the route.
A connection manager MAY be configured to enable sessions with more than one server in different domains. When requesting a session with such a “proxy” connection manager, a client SHOULD include a ‘route’ attribute that specifies the protocol, hostname, and port of the server with which it wants to communicate, formatted as “proto:host:port” (e.g., “xmpp:example.com:9999”).
public final java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2014–2019 XMPP.rocks. All rights reserved.