Class StompClientConnection
java.lang.Object
io.vertx.rxjava3.ext.stomp.StompClientConnection
- All Implemented Interfaces:
io.vertx.lang.rx.RxDelegate
Once a connection to the STOMP server has been made, client receives a
StompClientConnection, that let
send and receive STOMP frames.
NOTE: This class has been automatically generated from the original non RX-ified interface using Vert.x codegen.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionStompClientConnection(StompClientConnection delegate) StompClientConnection(Object delegate) -
Method Summary
Modifier and TypeMethodDescriptionAborts a transaction.Aborts a transaction.Sends an acknowledgement for a specific message.Sends an acknowledgement for the given frame.Begins a transaction.Begins a transaction.voidclose()Closes the connection without sending theDISCONNECTframe.closeHandler(Handler<StompClientConnection> handler) Sets a handler notified when the STOMP connection is closed.Commits a transaction.Commits a transaction.Sets a handler notified when the server does not respond to apingrequest in time.Disconnects the client.disconnect(Frame frame) Disconnects the client.booleanerrorHandler(Handler<Frame> handler) Sets a handler notified when anERRORframe is received by the client.exceptionHandler(Handler<Throwable> exceptionHandler) Configures the exception handler notified upon TCP-level errors.inthashCode()booleanReturns whether or not the `CONNECTED` frame has been receive meaning that the Stomp connection is established.Sends a non-acknowledgement for the given message.Sends a non-acknowledgement for the given frame.static StompClientConnectionpingHandler(Handler<StompClientConnection> handler) Sets a handler that let customize the behavior when a ping needs to be sent to the server.receivedFrameHandler(Handler<Frame> handler) Configures a received handler that get notified when a STOMP frame is received by the client.Aborts a transaction.Aborts a transaction.Sends an acknowledgement for a specific message.Sends an acknowledgement for the given frame.Begins a transaction.Begins a transaction.Commits a transaction.Commits a transaction.Disconnects the client.rxDisconnect(Frame frame) Disconnects the client.Sends a non-acknowledgement for the given message.Sends a non-acknowledgement for the given frame.Sends the given frame to the server.Sends aSENDframe to the server to the given destination.Sends aSENDframe to the server to the given destination.Sends aSENDframe to the server.rxSubscribe(String destination, Handler<Frame> handler) Subscribes to the given destination.Subscribes to the given destination.rxUnsubscribe(String destination) Un-subscribes from the given destination.rxUnsubscribe(String destination, Map<String, String> headers) Un-subscribes from the given destination.Sends the given frame to the server.Sends aSENDframe to the server to the given destination.Sends aSENDframe to the server to the given destination.Sends aSENDframe to the server.server()session()Subscribes to the given destination.Subscribes to the given destination.toString()unsubscribe(String destination) Un-subscribes from the given destination.unsubscribe(String destination, Map<String, String> headers) Un-subscribes from the given destination.version()writingFrameHandler(Handler<Frame> handler) Configures a handler notified when a frame is going to be written on the wire.
-
Field Details
-
__TYPE_ARG
-
-
Constructor Details
-
StompClientConnection
-
StompClientConnection
-
-
Method Details
-
toString
-
equals
-
hashCode
-
getDelegate
- Specified by:
getDelegatein interfaceio.vertx.lang.rx.RxDelegate
-
session
- Returns:
- the session id.
-
version
- Returns:
- the STOMP protocol version negotiated with the server.
-
close
public void close()Closes the connection without sending theDISCONNECTframe. -
server
- Returns:
- the server name.
-
send
Sends aSENDframe to the server.- Parameters:
headers- the headers, must not benullbody- the body, may benull- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxSend
Sends aSENDframe to the server.- Parameters:
headers- the headers, must not benullbody- the body, may benull- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
send
Sends aSENDframe to the server to the given destination. The message does not have any other header.- Parameters:
destination- the destination, must not benullbody- the body, may benull- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxSend
Sends aSENDframe to the server to the given destination. The message does not have any other header.- Parameters:
destination- the destination, must not benullbody- the body, may benull- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
send
-
rxSend
-
send
Sends aSENDframe to the server to the given destination.- Parameters:
destination- the destination, must not benullheaders- the header. Thedestinationheader is replaced by the value given to thedestinationparameterbody- the body, may benull- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxSend
Sends aSENDframe to the server to the given destination.- Parameters:
destination- the destination, must not benullheaders- the header. Thedestinationheader is replaced by the value given to thedestinationparameterbody- the body, may benull- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
subscribe
Subscribes to the given destination. This destination is used as subscription id.- Parameters:
destination- the destination, must not benullhandler- the handler invoked when a message is received on the given destination. Must not benull.- Returns:
- a future resolved with the subscription id when the
RECEIPTframe associated with the sent frame has been received
-
rxSubscribe
Subscribes to the given destination. This destination is used as subscription id.- Parameters:
destination- the destination, must not benullhandler- the handler invoked when a message is received on the given destination. Must not benull.- Returns:
- a future resolved with the subscription id when the
RECEIPTframe associated with the sent frame has been received
-
subscribe
public Single<String> subscribe(String destination, Map<String, String> headers, Handler<Frame> handler) Subscribes to the given destination.- Parameters:
destination- the destination, must not benull.headers- the headers to configure the subscription. It may contain theackheader to configure the acknowledgment policy. If the given set of headers contains theidheader, this value is used as subscription id.handler- the handler invoked when a message is received on the given destination. Must not benull.- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxSubscribe
public Single<String> rxSubscribe(String destination, Map<String, String> headers, Handler<Frame> handler) Subscribes to the given destination.- Parameters:
destination- the destination, must not benull.headers- the headers to configure the subscription. It may contain theackheader to configure the acknowledgment policy. If the given set of headers contains theidheader, this value is used as subscription id.handler- the handler invoked when a message is received on the given destination. Must not benull.- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
unsubscribe
Un-subscribes from the given destination. This method only works if the subscription did not specifies a subscription id (using theidheader).- Parameters:
destination- the destination- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxUnsubscribe
Un-subscribes from the given destination. This method only works if the subscription did not specifies a subscription id (using theidheader).- Parameters:
destination- the destination- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
unsubscribe
Un-subscribes from the given destination. This method computes the subscription id as follows. If the given headers contains theidheader, the header value is used. Otherwise the destination is used.- Parameters:
destination- the destinationheaders- the headers- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxUnsubscribe
Un-subscribes from the given destination. This method computes the subscription id as follows. If the given headers contains theidheader, the header value is used. Otherwise the destination is used.- Parameters:
destination- the destinationheaders- the headers- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
errorHandler
Sets a handler notified when anERRORframe is received by the client. The handler receives theERRORframe and a reference on theStompClientConnection.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnection
-
closeHandler
Sets a handler notified when the STOMP connection is closed.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnection
-
connectionDroppedHandler
Sets a handler notified when the server does not respond to apingrequest in time. In other words, this handler is invoked when the heartbeat has detected a connection failure with the server. The handler can decide to reconnect to the server.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnectionreceiving the dropped connection.
-
pingHandler
Sets a handler that let customize the behavior when a ping needs to be sent to the server. Be aware that changing the default behavior may break the compliance with the STOMP specification.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnection
-
beginTX
-
rxBeginTX
-
beginTX
Begins a transaction.- Parameters:
id- the transaction id, must not benullheaders- additional headers to send to the server. Thetransactionheader is replaced by the value passed in the @{code id} parameter- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxBeginTX
Begins a transaction.- Parameters:
id- the transaction id, must not benullheaders- additional headers to send to the server. Thetransactionheader is replaced by the value passed in the @{code id} parameter- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
commit
-
rxCommit
-
commit
Commits a transaction.- Parameters:
id- the transaction id, must not benullheaders- additional headers to send to the server. Thetransactionheader is replaced by the value passed in the @{code id} parameter- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxCommit
Commits a transaction.- Parameters:
id- the transaction id, must not benullheaders- additional headers to send to the server. Thetransactionheader is replaced by the value passed in the @{code id} parameter- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
abort
-
rxAbort
-
abort
Aborts a transaction.- Parameters:
id- the transaction id, must not benullheaders- additional headers to send to the server. Thetransactionheader is replaced by the value passed in the @{code id} parameter- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxAbort
Aborts a transaction.- Parameters:
id- the transaction id, must not benullheaders- additional headers to send to the server. Thetransactionheader is replaced by the value passed in the @{code id} parameter- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
disconnect
-
rxDisconnect
-
disconnect
Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server. This method lets you customize theDISCONNECTframe.- Parameters:
frame- theDISCONNECTframe.- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxDisconnect
Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server. This method lets you customize theDISCONNECTframe.- Parameters:
frame- theDISCONNECTframe.- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
ack
Sends an acknowledgement for a specific message. It means that the message has been handled and processed by the client. Theidparameter is the message id received in the frame.- Parameters:
id- the message id of the message to acknowledge- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxAck
Sends an acknowledgement for a specific message. It means that the message has been handled and processed by the client. Theidparameter is the message id received in the frame.- Parameters:
id- the message id of the message to acknowledge- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
nack
Sends a non-acknowledgement for the given message. It means that the message has not been handled by the client. Theidparameter is the message id received in the frame.- Parameters:
id- the message id of the message to acknowledge- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxNack
Sends a non-acknowledgement for the given message. It means that the message has not been handled by the client. Theidparameter is the message id received in the frame.- Parameters:
id- the message id of the message to acknowledge- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
ack
Sends an acknowledgement for the given frame. It means that the frame has been handled and processed by the client. The sent acknowledgement is part of the transaction identified by the given id.- Parameters:
id- the message id of the message to acknowledgetxId- the transaction id- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxAck
Sends an acknowledgement for the given frame. It means that the frame has been handled and processed by the client. The sent acknowledgement is part of the transaction identified by the given id.- Parameters:
id- the message id of the message to acknowledgetxId- the transaction id- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
nack
Sends a non-acknowledgement for the given frame. It means that the frame has not been handled by the client. The sent non-acknowledgement is part of the transaction identified by the given id.- Parameters:
id- the message id of the message to acknowledgetxId- the transaction id- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
rxNack
Sends a non-acknowledgement for the given frame. It means that the frame has not been handled by the client. The sent non-acknowledgement is part of the transaction identified by the given id.- Parameters:
id- the message id of the message to acknowledgetxId- the transaction id- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
receivedFrameHandler
Configures a received handler that get 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 by the handler.Unlike
StompClient.receivedFrameHandler(Handler), the given handler won't receive theCONNECTEDframe. If a received frame handler is set on theStompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnection
-
writingFrameHandler
Configures a handler notified when a frame is going to be written on the wire. This handler can be used from logging, debugging. The handler can modify the received frame.If a writing frame handler is set on the
StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnection
-
exceptionHandler
Configures the exception handler notified upon TCP-level errors.- Parameters:
exceptionHandler- the handler- Returns:
- the current
StompClientConnection
-
isConnected
public boolean isConnected()Returns whether or not the `CONNECTED` frame has been receive meaning that the Stomp connection is established.- Returns:
trueif the connection is established,falseotherwise
-
newInstance
-