Class StompServer


  • public class StompServer
    extends Object
    Defines a STOMP server. STOMP servers delegates to a StompServerHandler that let customize the behavior of the server. By default, it uses a handler compliant with the STOMP specification, but let you change anything.

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

    • Constructor Detail

      • StompServer

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

        public StompServer​(Object delegate)
    • Method Detail

      • getDelegate

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

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

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

        public static StompServer create​(Vertx vertx,
                                         NetServer netServer)
        Parameters:
        vertx - the vert.x instance to use
        netServer - the Net server used by the STOMP server
        Returns:
        the created StompServer
      • create

        public static StompServer create​(Vertx vertx,
                                         NetServer net,
                                         io.vertx.ext.stomp.StompServerOptions options)
        Parameters:
        vertx - the vert.x instance to use
        net - the Net server used by the STOMP server
        options - the server options
        Returns:
        the created StompServer
      • create

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

        public io.smallrye.mutiny.Uni<StompServer> listen()
        Connects the STOMP server default port (61613) and network interface (0.0.0.0). Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

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

        public StompServer listenAndAwait()
        Blocking variant of listen().

        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 StompServer instance produced by the operation.
      • listenAndForget

        public StompServer listenAndForget()
        Variant of listen() that ignores the result of the operation.

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

        Returns:
        the instance of StompServer to chain method calls.
      • listen

        public io.smallrye.mutiny.Uni<StompServer> listen​(int port)
        Connects the STOMP server to the given port. This method use the default host (0.0.0.0). Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

        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 port
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • listenAndAwait

        public StompServer listenAndAwait​(int port)
        Blocking variant of listen(int).

        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 port
        Returns:
        the StompServer instance produced by the operation.
      • listenAndForget

        public StompServer listenAndForget​(int port)
        Variant of listen(int) that ignores the result of the operation.

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

        Parameters:
        port - the port
        Returns:
        the instance of StompServer to chain method calls.
      • listen

        public io.smallrye.mutiny.Uni<StompServer> listen​(int port,
                                                          String host)
        Connects the STOMP server to the given port / interface. Once the socket it bounds calls the given handler with the result. The result may be a failure if the socket is already used.

        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 port
        host - the host / interface
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • listenAndAwait

        public StompServer listenAndAwait​(int port,
                                          String host)
        Blocking variant of listen(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 port
        host - the host / interface
        Returns:
        the StompServer instance produced by the operation.
      • listenAndForget

        public StompServer listenAndForget​(int port,
                                           String host)
        Variant of listen(int,String) that ignores the result of the operation.

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

        Parameters:
        port - the port
        host - the host / interface
        Returns:
        the instance of StompServer to chain method calls.
      • close

        public io.smallrye.mutiny.Uni<Void> close()
        Closes the server.

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

        public Void closeAndAwait()
        Blocking variant of close().

        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 Void instance produced by the operation.
      • closeAndForget

        public void closeAndForget()
        Variant of close() that ignores the result of the operation.

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

      • isListening

        public boolean isListening()
        Returns:
        true if the server is listening, false otherwise
      • actualPort

        public int actualPort()
        Returns:
        the port
      • options

        public io.vertx.ext.stomp.StompServerOptions options()
        Returns:
        the server options
      • vertx

        public Vertx vertx()
        Returns:
        the instance of vert.x used by the server.
      • writingFrameHandler

        public StompServer writingFrameHandler​(Consumer<ServerFrame> handler)
        Parameters:
        handler - the handler, must not be null
        Returns:
      • newInstance

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