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, wait
closeFuture, flush, getRemoteAddress, isSecure, open, send, write
public final ConnectionConfiguration getConfiguration()
Connection
Gets the configuration used to create this connection.
getConfiguration
in interface Connection
public boolean isUsingAcknowledgements()
Connection
Indicates whether this connection uses acknowledgements, e.g. by means of stream management or BOSH acks.
isUsingAcknowledgements
in interface Connection
public final java.lang.String getStreamId()
Connection
Gets the stream id of this connection.
getStreamId
in interface Connection
public final java.util.concurrent.CompletionStage<java.lang.Void> closeAsync()
Connection
Asynchronously 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 Connection
Connection.close()
public final java.util.concurrent.CompletionStage<java.lang.Void> closeAsync(StreamError streamError)
Connection
Asynchronously closes the connection with a stream error.
closeAsync
in interface Connection
Connection.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.AutoCloseable
close
in interface Connection
java.lang.Exception
- If the close failed.closeAsync()
Copyright © 2014–2019 XMPP.rocks. All rights reserved.