Package io.vertx.rxjava3.ext.stomp
Class StompClient
- java.lang.Object
-
- io.vertx.rxjava3.ext.stomp.StompClient
-
-
Field Summary
Fields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<StompClient>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description StompClient(StompClient delegate)StompClient(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Completableclose()Closes the client.Single<StompClientConnection>connect()Connects to the server using the host and port configured in the client's options.Single<StompClientConnection>connect(int port, String host)Connects to the server.static StompClientcreate(Vertx vertx)Creates aStompClientusing the default implementation.static StompClientcreate(Vertx vertx, StompClientOptions options)Creates aStompClientusing the default implementation.booleanequals(Object o)StompClienterrorFrameHandler(Handler<Frame> handler)A general error frame handler.StompClientexceptionHandler(Handler<Throwable> handler)Sets an exception handler notified for TCP-level errors.StompClientgetDelegate()inthashCode()booleanisClosed()static StompClientnewInstance(StompClient arg)StompClientOptionsoptions()StompClientreceivedFrameHandler(Handler<Frame> handler)Configures a received handler that gets notified when a STOMP frame is received by the client.CompletablerxClose()Closes the client.Single<StompClientConnection>rxConnect()Connects to the server using the host and port configured in the client's options.Single<StompClientConnection>rxConnect(int port, String host)Connects to the server.StringtoString()Vertxvertx()StompClientwritingFrameHandler(Handler<Frame> handler)Configures a writing handler that gets notified when a STOMP frame is written on the wire.
-
-
-
Field Detail
-
__TYPE_ARG
public static final io.vertx.lang.rx.TypeArg<StompClient> __TYPE_ARG
-
-
Constructor Detail
-
StompClient
public StompClient(StompClient delegate)
-
StompClient
public StompClient(Object delegate)
-
-
Method Detail
-
getDelegate
public StompClient getDelegate()
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
create
public static StompClient create(Vertx vertx)
Creates aStompClientusing the default implementation.- Parameters:
vertx- the vert.x instance to use- Returns:
- the created
StompClient
-
create
public static StompClient create(Vertx vertx, StompClientOptions options)
Creates aStompClientusing the default implementation.- Parameters:
vertx- the vert.x instance to useoptions- the options- Returns:
- the created
StompClient
-
connect
public Single<StompClientConnection> connect(int port, String host)
Connects to the server.- Parameters:
port- the server porthost- the server host- Returns:
- a future notified with the connection result
-
rxConnect
public Single<StompClientConnection> rxConnect(int port, String host)
Connects to the server.- Parameters:
port- the server porthost- the server host- Returns:
- a future notified with the connection result
-
connect
public Single<StompClientConnection> connect()
Connects to the server using the host and port configured in the client's options.- Returns:
- a future notified with the connection result. A failure will be sent to the handler if a TCP level issue happen before the `CONNECTED` frame is received.
-
rxConnect
public Single<StompClientConnection> rxConnect()
Connects to the server using the host and port configured in the client's options.- Returns:
- a future notified with the connection result. A failure will be sent to the handler if a TCP level issue happen before the `CONNECTED` frame is received.
-
receivedFrameHandler
public StompClient receivedFrameHandler(Handler<Frame> handler)
Configures a received handler that gets notified when a STOMP frame is received by the client. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.When a connection is created, the handler is used as
StompClientConnection.receivedFrameHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame>).- Parameters:
handler- the handler- Returns:
- the current
StompClient
-
writingFrameHandler
public StompClient writingFrameHandler(Handler<Frame> handler)
Configures a writing handler that gets notified when a STOMP frame is written on the wire. This handler can be used for logging, debugging or ad-hoc behavior. The frame can still be modified at the time.When a connection is created, the handler is used as
StompClientConnection.writingFrameHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame>).- Parameters:
handler- the handler- Returns:
- the current
StompClient
-
errorFrameHandler
public StompClient errorFrameHandler(Handler<Frame> handler)
A general error frame handler. It can be used to catchERRORframe emitted during the connection process (wrong authentication). This error handler will be pass to allStompClientConnectioncreated from this client. Obviously, the client can override it when the connection is established.- Parameters:
handler- the handler- Returns:
- the current
StompClient
-
exceptionHandler
public StompClient exceptionHandler(Handler<Throwable> handler)
Sets an exception handler notified for TCP-level errors.- Parameters:
handler- the handler- Returns:
- the current
StompClient
-
close
public Completable close()
Closes the client.- Returns:
-
rxClose
public Completable rxClose()
Closes the client.- Returns:
-
options
public 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(StompClient arg)
-
-