Class AbstractConnection

    • Method Detail

      • isUsingAcknowledgements

        public boolean isUsingAcknowledgements()
        Description copied from interface: Connection
        Indicates whether this connection uses acknowledgements, e.g. by means of stream management or BOSH acks.
        Specified by:
        isUsingAcknowledgements in interface Connection
        Returns:
        If this connection uses acknowledgements.
      • handleElement

        public boolean handleElement​(Object streamElement)
        Description copied from interface: StreamHandler
        Handles an inbound stream element.
        Specified by:
        handleElement in interface StreamHandler
        Parameters:
        streamElement - The stream element.
        Returns:
        True, if the stream must be restarted.
      • getStreamId

        public final String getStreamId()
        Description copied from interface: Connection
        Gets the stream id of this connection.
        Specified by:
        getStreamId in interface Connection
        Returns:
        The stream id.
      • closeAsync

        public final CompletionStage<Void> closeAsync()
        Description copied from interface: 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.

        Specified by:
        closeAsync in interface Connection
        Returns:
        The future, which is complete, when the connection is closed.
        See Also:
        Connection.close()
      • closeAsync

        public final CompletionStage<Void> closeAsync​(StreamError streamError)
        Description copied from interface: Connection
        Asynchronously closes the connection with a stream error.
        Specified by:
        closeAsync in interface Connection
        Parameters:
        streamError - The stream error, which is sent before closing the stream.
        Returns:
        The completion stage, which is complete, when the connection is closed.
        See Also:
        Connection.closeAsync()
      • isClosed

        public final boolean isClosed()
        If the connection is closed.
        Returns:
        True, if closed.