public abstract class AbstractConnection extends java.lang.Object implements Connection
An abstract connection implementation.
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the connection.
|
java.util.concurrent.CompletionStage<java.lang.Void> |
closeAsync()
Asynchronously closes the connection.
|
java.util.concurrent.CompletionStage<java.lang.Void> |
closeAsync(StreamError streamError)
Asynchronously closes the connection with a stream error.
|
ConnectionConfiguration |
getConfiguration()
Gets the configuration used to create this connection.
|
java.lang.String |
getStreamId()
Gets the stream id of this connection.
|
boolean |
isUsingAcknowledgements()
Indicates whether this connection uses acknowledgements, e.g. by means of stream management or BOSH acks.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcloseFuture, flush, getRemoteAddress, isSecure, open, send, writepublic final ConnectionConfiguration getConfiguration()
ConnectionGets the configuration used to create this connection.
getConfiguration in interface Connectionpublic boolean isUsingAcknowledgements()
ConnectionIndicates whether this connection uses acknowledgements, e.g. by means of stream management or BOSH acks.
isUsingAcknowledgements in interface Connectionpublic final java.lang.String getStreamId()
ConnectionGets the stream id of this connection.
getStreamId in interface Connectionpublic final java.util.concurrent.CompletionStage<java.lang.Void> closeAsync()
ConnectionAsynchronously closes the connection.
Closing usually involves a round-trip with the peer on the XMPP layer first by sending a closing stream element, then waiting on the response and then closing the underlying transport layer.
Implementations wait a maximum of 500ms for the XMPP level close.
closeAsync in interface ConnectionConnection.close()public final java.util.concurrent.CompletionStage<java.lang.Void> closeAsync(StreamError streamError)
ConnectionAsynchronously closes the connection with a stream error.
closeAsync in interface ConnectionConnection.closeAsync()public final void close()
throws java.lang.Exception
Closes the connection. This method blocks until everything is closed (max. 1s).
close in interface java.lang.AutoCloseableclose in interface Connectionjava.lang.Exception - If the close failed.closeAsync()Copyright © 2014–2019 XMPP.rocks. All rights reserved.