Class StompClient


  • public class StompClient
    extends Object
    Defines a STOMP client.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • StompClient

        public StompClient​(io.vertx.ext.stomp.StompClient delegate)
      • StompClient

        public StompClient​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.ext.stomp.StompClient getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • create

        public static StompClient create​(Vertx vertx)
        Parameters:
        vertx - the vert.x instance to use
        Returns:
        the created StompClient
      • create

        public static StompClient create​(Vertx vertx,
                                         io.vertx.ext.stomp.StompClientOptions options)
        Parameters:
        vertx - the vert.x instance to use
        options - the options
        Returns:
        the created StompClient
      • connect

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<StompClientConnection> connect​(int port,
                                                                     String host)
        Connects to the server.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        port - the server port
        host - the server host
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • connectAndAwait

        public StompClientConnection connectAndAwait​(int port,
                                                     String host)
        Blocking variant of connect(int,String).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        port - the server port
        host - the server host
        Returns:
        the StompClientConnection instance produced by the operation.
      • connectAndForget

        public StompClient connectAndForget​(int port,
                                            String host)
        Variant of connect(int,String) that ignores the result of the operation.

        This method subscribes on the result of connect(int,String), but discards the outcome (item or failure). This method is useful to trigger the asynchronous operation from connect(int,String) but you don't need to compose it with other operations.

        Parameters:
        port - the server port
        host - the server host
        Returns:
        the instance of StompClient to chain method calls.
      • connect

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<StompClientConnection> connect​(NetClient net)
        Connects to the server.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        net - the NET client to use
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • connectAndAwait

        public StompClientConnection connectAndAwait​(NetClient net)
        Blocking variant of connect(io.vertx.mutiny.core.net.NetClient).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        net - the NET client to use
        Returns:
        the StompClientConnection instance produced by the operation.
      • connect

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<StompClientConnection> connect​(int port,
                                                                     String host,
                                                                     NetClient net)
        Connects to the server.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        port - the server port
        host - the server host
        net - the NET client to use
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • connectAndAwait

        public StompClientConnection connectAndAwait​(int port,
                                                     String host,
                                                     NetClient net)
        Blocking variant of connect(int,String,io.vertx.mutiny.core.net.NetClient).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        port - the server port
        host - the server host
        net - the NET client to use
        Returns:
        the StompClientConnection instance produced by the operation.
      • connect

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<StompClientConnection> connect()
        Connects to the server using the host and port configured in the client's options.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • connectAndAwait

        public StompClientConnection connectAndAwait()
        Blocking variant of connect(int, java.lang.String).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Returns:
        the StompClientConnection instance produced by the operation.
      • receivedFrameHandler

        public StompClient receivedFrameHandler​(Consumer<io.vertx.ext.stomp.Frame> handler)
        Parameters:
        handler - the handler
        Returns:
      • writingFrameHandler

        public StompClient writingFrameHandler​(Consumer<io.vertx.ext.stomp.Frame> handler)
        Parameters:
        handler - the handler
        Returns:
      • errorFrameHandler

        public StompClient errorFrameHandler​(Consumer<io.vertx.ext.stomp.Frame> handler)
        Parameters:
        handler - the handler
        Returns:
      • close

        public void close()
      • options

        public io.vertx.ext.stomp.StompClientOptions options()
        Returns:
        the client's options.
      • vertx

        public Vertx vertx()
        Returns:
        the vert.x instance used by the client.
      • isClosed

        public boolean isClosed()
        Returns:
        whether or not the client is connected to the server.
      • newInstance

        public static StompClient newInstance​(io.vertx.ext.stomp.StompClient arg)