Class BoshConnection

    • 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.
      • 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.
      • detach

        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.
        Returns:
        The current request ID (RID) which was used for the last BOSH request.
        See Also:
        https://conversejs.org/docs/html/#prebinding-and-single-session-support
      • send

        public final CompletableFuture<Void> send​(StreamElement element)
        Description copied from interface: Connection
        Sends an element to the peer entity. This is basically a short cut for write + flush.
        Parameters:
        element - The element.
        Returns:
        The future representing the send process and which allows to cancel it.
      • write

        public final CompletableFuture<Void> write​(StreamElement streamElement)
        Description copied from interface: Connection
        Writes the element to the stream without really sending it. It must be flushed.
        Parameters:
        streamElement - The element.
        Returns:
        The send future.
      • getSessionId

        public final String getSessionId()
        Gets the session id of this BOSH connection.
        Returns:
        The session id.
      • getRemoteAddress

        public final InetSocketAddress getRemoteAddress()
        Description copied from interface: Connection
        Gets the remote address of this connection.
        Returns:
        The remote address.
      • getRoute

        public final 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").

        Returns:
        The route.