Package rocks.xmpp.websocket.net
Class WebSocketConnection
- java.lang.Object
-
- rocks.xmpp.core.net.AbstractConnection
-
- rocks.xmpp.websocket.net.WebSocketConnection
-
- All Implemented Interfaces:
AutoCloseable
,Connection
,StreamHandler
- Direct Known Subclasses:
JakartaWebSocketConnection
public abstract class WebSocketConnection extends AbstractConnection
Abstract base class for WebSocket connections.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>
closeFuture()
Returns a future which is complete, when the connection is closed.boolean
isSecure()
Indicates whether this connection is secured by TLS/SSL.CompletionStage<Void>
open(SessionOpen sessionOpen)
Opens the XML stream to the peer entity.CompletionStage<Void>
send(StreamElement streamElement)
Sends an element to the peer entity.-
Methods inherited from class rocks.xmpp.core.net.AbstractConnection
close, closeAsync, closeAsync, getConfiguration, getStreamId, handleElement, isClosed, isUsingAcknowledgements
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface rocks.xmpp.core.net.Connection
flush, getRemoteAddress, write
-
-
-
-
Method Detail
-
open
public final CompletionStage<Void> open(SessionOpen sessionOpen)
Description copied from interface:Connection
Opens the XML stream to the peer entity.- Parameters:
sessionOpen
- The session open information.- Returns:
- The completion stage, which is complete, if the session has been opened, i.e. the element has been sent.
-
send
public final CompletionStage<Void> send(StreamElement streamElement)
Description copied from interface:Connection
- Parameters:
streamElement
- The element.- Returns:
- The future representing the send process and which allows to cancel it.
-
isSecure
public final boolean isSecure()
Description copied from interface:Connection
Indicates whether this connection is secured by TLS/SSL.- Returns:
- True, if this connection is secured.
-
closeFuture
public final CompletionStage<Void> closeFuture()
Description copied from interface:Connection
Returns a future which is complete, when the connection is closed.- Returns:
- The close future.
-
-