Class StompServer
- java.lang.Object
-
- io.vertx.mutiny.ext.stomp.StompServer
-
public class StompServer extends Object
Defines a STOMP server. STOMP servers delegates to aStompServerHandler
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 theoriginal
non Mutiny-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<StompServer>
__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description StompServer(io.vertx.ext.stomp.StompServer delegate)
StompServer(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
actualPort()
io.smallrye.mutiny.Uni<Void>
close()
Closes the server.Void
closeAndAwait()
Blocking variant ofclose()
.void
closeAndForget()
Variant ofclose()
that ignores the result of the operation.static StompServer
create(Vertx vertx)
static StompServer
create(Vertx vertx, io.vertx.ext.stomp.StompServerOptions options)
static StompServer
create(Vertx vertx, NetServer netServer)
static StompServer
create(Vertx vertx, NetServer net, io.vertx.ext.stomp.StompServerOptions options)
boolean
equals(Object o)
io.vertx.ext.stomp.StompServer
getDelegate()
StompServer
handler(StompServerHandler handler)
int
hashCode()
boolean
isListening()
io.smallrye.mutiny.Uni<StompServer>
listen()
Connects the STOMP server default port (61613) and network interface (0.0.0.0
).io.smallrye.mutiny.Uni<StompServer>
listen(int port)
Connects the STOMP server to the given port.io.smallrye.mutiny.Uni<StompServer>
listen(int port, String host)
Connects the STOMP server to the given port / interface.StompServer
listenAndAwait()
Blocking variant oflisten()
.StompServer
listenAndAwait(int port)
Blocking variant oflisten(int)
.StompServer
listenAndAwait(int port, String host)
Blocking variant oflisten(int,String)
.StompServer
listenAndForget()
Variant oflisten()
that ignores the result of the operation.StompServer
listenAndForget(int port)
Variant oflisten(int)
that ignores the result of the operation.StompServer
listenAndForget(int port, String host)
Variant oflisten(int,String)
that ignores the result of the operation.static StompServer
newInstance(io.vertx.ext.stomp.StompServer arg)
io.vertx.ext.stomp.StompServerOptions
options()
StompServerHandler
stompHandler()
String
toString()
Vertx
vertx()
io.vertx.core.Handler<ServerWebSocket>
webSocketHandler()
StompServer
writingFrameHandler(Consumer<ServerFrame> handler)
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<StompServer> __TYPE_ARG
-
-
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()
-
create
public static StompServer create(Vertx vertx, io.vertx.ext.stomp.StompServerOptions options)
- Parameters:
vertx
- the vert.x instance to useoptions
- the server options- Returns:
- the created
StompServer
-
create
public static StompServer create(Vertx vertx, NetServer netServer)
- Parameters:
vertx
- the vert.x instance to usenetServer
- 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 usenet
- the Net server used by the STOMP serveroptions
- 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
-
handler
public StompServer handler(StompServerHandler handler)
- Parameters:
handler
- the handler- Returns:
- the current
StompServer
-
listen
@CheckReturnValue 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 oflisten()
.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 oflisten()
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 fromlisten()
but you don't need to compose it with other operations.- Returns:
- the instance of StompServer to chain method calls.
-
listen
@CheckReturnValue 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 oflisten(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 oflisten(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 fromlisten(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
@CheckReturnValue 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 porthost
- 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 oflisten(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 porthost
- the host / interface- Returns:
- the StompServer instance produced by the operation.
-
listenAndForget
public StompServer listenAndForget(int port, String host)
Variant oflisten(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 fromlisten(int,String)
but you don't need to compose it with other operations.- Parameters:
port
- the porthost
- the host / interface- Returns:
- the instance of StompServer to chain method calls.
-
close
@CheckReturnValue 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 ofclose()
.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()
-
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.
-
stompHandler
public StompServerHandler stompHandler()
- Returns:
- the
StompServerHandler
used by this server.
-
webSocketHandler
public io.vertx.core.Handler<ServerWebSocket> webSocketHandler()
- Returns:
- the handler that can be passed to
HttpServer.webSocketHandler(java.util.function.Consumer<io.vertx.mutiny.core.http.ServerWebSocket>)
.
-
writingFrameHandler
public StompServer writingFrameHandler(Consumer<ServerFrame> handler)
- Parameters:
handler
- the handler, must not benull
- Returns:
-
newInstance
public static StompServer newInstance(io.vertx.ext.stomp.StompServer arg)
-
-