Package io.vertx.reactivex.ext.stomp
Class StompClientConnection
- java.lang.Object
-
- io.vertx.reactivex.ext.stomp.StompClientConnection
-
public class StompClientConnection extends Object
Once a connection to the STOMP server has been made, client receives aStompClientConnection, that let send and receive STOMP frames. NOTE: This class has been automatically generated from theoriginalnon RX-ified interface using Vert.x codegen.
-
-
Field Summary
Fields Modifier and Type Field Description static TypeArg<StompClientConnection>__TYPE_ARG
-
Constructor Summary
Constructors Constructor Description StompClientConnection(io.vertx.ext.stomp.StompClientConnection delegate)StompClientConnection(Object delegate)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StompClientConnectionabort(String id)Aborts a transaction.StompClientConnectionabort(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Aborts a transaction.StompClientConnectionabort(String id, Map<String,String> headers)Aborts a transaction.StompClientConnectionabort(String id, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Aborts a transaction.StompClientConnectionack(String id)Sends an acknowledgement for a specific message.StompClientConnectionack(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends an acknowledgement for a specific message.StompClientConnectionack(String id, String txId)Sends an acknowledgement for the given frame.StompClientConnectionack(String id, String txId, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends an acknowledgement for the given frame.StompClientConnectionbeginTX(String id)Begins a transaction.StompClientConnectionbeginTX(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Begins a transaction.StompClientConnectionbeginTX(String id, Map<String,String> headers)Begins a transaction.StompClientConnectionbeginTX(String id, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Begins a transaction.voidclose()Closes the connection without sending theDISCONNECTframe.StompClientConnectioncloseHandler(io.vertx.core.Handler<StompClientConnection> handler)Sets a handler notified when the STOMP connection is closed.StompClientConnectioncommit(String id)Commits a transaction.StompClientConnectioncommit(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Commits a transaction.StompClientConnectioncommit(String id, Map<String,String> headers)Commits a transaction.StompClientConnectioncommit(String id, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Commits a transaction.StompClientConnectionconnectionDroppedHandler(io.vertx.core.Handler<StompClientConnection> handler)Sets a handler notified when the server does not respond to apingrequest in time.StompClientConnectiondisconnect()Disconnects the client.StompClientConnectiondisconnect(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Disconnects the client.StompClientConnectiondisconnect(io.vertx.ext.stomp.Frame frame)Disconnects the client.StompClientConnectiondisconnect(io.vertx.ext.stomp.Frame frame, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Disconnects the client.booleanequals(Object o)StompClientConnectionerrorHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Sets a handler notified when anERRORframe is received by the client.StompClientConnectionexceptionHandler(io.vertx.core.Handler<Throwable> exceptionHandler)Configures the exception handler notified upon TCP-level errors.io.vertx.ext.stomp.StompClientConnectiongetDelegate()inthashCode()booleanisConnected()Returns whether or not the `CONNECTED` frame has been receive meaning that the Stomp connection is established.StompClientConnectionnack(String id)Sends a non-acknowledgement for the given message.StompClientConnectionnack(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends a non-acknowledgement for the given message.StompClientConnectionnack(String id, String txId)Sends a non-acknowledgement for the given frame.StompClientConnectionnack(String id, String txId, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends a non-acknowledgement for the given frame.static StompClientConnectionnewInstance(io.vertx.ext.stomp.StompClientConnection arg)StompClientConnectionpingHandler(io.vertx.core.Handler<StompClientConnection> handler)Sets a handler that let customize the behavior when a ping needs to be sent to the server.StompClientConnectionreceivedFrameHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Configures a received handler that get notified when a STOMP frame is received by the client.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxAbort(String id)Aborts a transaction.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxAbort(String id, Map<String,String> headers)Aborts a transaction.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxAck(String id)Sends an acknowledgement for a specific message.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxAck(String id, String txId)Sends an acknowledgement for the given frame.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxBeginTX(String id)Begins a transaction.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxBeginTX(String id, Map<String,String> headers)Begins a transaction.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxCommit(String id)Commits a transaction.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxCommit(String id, Map<String,String> headers)Commits a transaction.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxDisconnect()Disconnects the client.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxDisconnect(io.vertx.ext.stomp.Frame frame)Disconnects the client.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxNack(String id)Sends a non-acknowledgement for the given message.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxNack(String id, String txId)Sends a non-acknowledgement for the given frame.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxSend(io.vertx.ext.stomp.Frame frame)Sends the given frame to the server.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxSend(String destination, Buffer body)Sends aSENDframe to the server to the given destination.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxSend(String destination, Map<String,String> headers, Buffer body)Sends aSENDframe to the server to the given destination.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxSend(Map<String,String> headers, Buffer body)Sends aSENDframe to the server.io.reactivex.Single<String>rxSubscribe(String destination, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Subscribes to the given destination.io.reactivex.Single<String>rxSubscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Subscribes to the given destination.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxUnsubscribe(String destination)Un-subscribes from the given destination.io.reactivex.Single<io.vertx.ext.stomp.Frame>rxUnsubscribe(String destination, Map<String,String> headers)Un-subscribes from the given destination.StompClientConnectionsend(io.vertx.ext.stomp.Frame frame)Sends the given frame to the server.StompClientConnectionsend(io.vertx.ext.stomp.Frame frame, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends the given frame to the server.StompClientConnectionsend(String destination, Buffer body)Sends aSENDframe to the server to the given destination.StompClientConnectionsend(String destination, Buffer body, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends aSENDframe to the server to the given destination.StompClientConnectionsend(String destination, Map<String,String> headers, Buffer body)Sends aSENDframe to the server to the given destination.StompClientConnectionsend(String destination, Map<String,String> headers, Buffer body, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends aSENDframe to the server to the given destination.StompClientConnectionsend(Map<String,String> headers, Buffer body)Sends aSENDframe to the server.StompClientConnectionsend(Map<String,String> headers, Buffer body, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Sends aSENDframe to the server.Stringserver()Stringsession()StompClientConnectionsubscribe(String destination, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Subscribes to the given destination.StompClientConnectionsubscribe(String destination, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> receiptHandler)Subscribes to the given destination.StompClientConnectionsubscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Subscribes to the given destination.StompClientConnectionsubscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> receiptHandler)Subscribes to the given destination.StringtoString()StompClientConnectionunsubscribe(String destination)Un-subscribes from the given destination.StompClientConnectionunsubscribe(String destination, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Un-subscribes from the given destination.StompClientConnectionunsubscribe(String destination, Map<String,String> headers)Un-subscribes from the given destination.StompClientConnectionunsubscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)Un-subscribes from the given destination.Stringversion()StompClientConnectionwritingFrameHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)Configures a handler notified when a frame is going to be written on the wire.
-
-
-
Field Detail
-
__TYPE_ARG
public static final TypeArg<StompClientConnection> __TYPE_ARG
-
-
Constructor Detail
-
StompClientConnection
public StompClientConnection(io.vertx.ext.stomp.StompClientConnection delegate)
-
StompClientConnection
public StompClientConnection(Object delegate)
-
-
Method Detail
-
getDelegate
public io.vertx.ext.stomp.StompClientConnection getDelegate()
-
session
public String session()
- Returns:
- the session id.
-
version
public String version()
- Returns:
- the STOMP protocol version negotiated with the server.
-
close
public void close()
Closes the connection without sending theDISCONNECTframe.
-
server
public String server()
- Returns:
- the server name.
-
send
public StompClientConnection send(Map<String,String> headers, Buffer body, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Sends aSENDframe to the server.- Parameters:
headers- the headers, must not benullbody- the body, may benullreceiptHandler- the handler invoked when theRECEIPTframe associated with the sent frame has been received. The handler receives the sent frame.- Returns:
- the current
StompClientConnection
-
send
public StompClientConnection send(Map<String,String> headers, Buffer body)
Sends aSENDframe to the server.- Parameters:
headers- the headers, must not benullbody- the body, may benull- Returns:
- the current
StompClientConnection
-
rxSend
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxSend(Map<String,String> headers, Buffer body)
Sends aSENDframe to the server.- Parameters:
headers- the headers, must not benullbody- the body, may benull- Returns:
- the current
StompClientConnection
-
send
public StompClientConnection send(String destination, Buffer body, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 benullreceiptHandler- the handler invoked when theRECEIPTframe associated with the sent frame has been received. The handler receives the sent frame.- Returns:
- the current
StompClientConnection
-
send
public StompClientConnection send(String destination, Buffer body)
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:
- the current
StompClientConnection
-
rxSend
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxSend(String destination, Buffer body)
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:
- the current
StompClientConnection
-
send
public StompClientConnection send(io.vertx.ext.stomp.Frame frame, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Sends the given frame to the server.- Parameters:
frame- the framereceiptHandler- the handler invoked when theRECEIPTframe associated with the sent frame has been received. The handler receives the sent frame.- Returns:
- the current
StompClientConnection
-
send
public StompClientConnection send(io.vertx.ext.stomp.Frame frame)
Sends the given frame to the server.- Parameters:
frame- the frame- Returns:
- the current
StompClientConnection
-
rxSend
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxSend(io.vertx.ext.stomp.Frame frame)
Sends the given frame to the server.- Parameters:
frame- the frame- Returns:
- the current
StompClientConnection
-
send
public StompClientConnection send(String destination, Map<String,String> headers, Buffer body, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 benullreceiptHandler- the handler invoked when theRECEIPTframe associated with the sent frame has been received. The handler receives the sent frame.- Returns:
- the current
StompClientConnection
-
send
public StompClientConnection send(String destination, Map<String,String> headers, Buffer body)
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:
- the current
StompClientConnection
-
rxSend
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxSend(String destination, Map<String,String> headers, Buffer body)
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:
- the current
StompClientConnection
-
subscribe
public StompClientConnection subscribe(String destination, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> receiptHandler)
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.receiptHandler- the handler invoked when theRECEIPTframe associated with the subscription has been received. The handler receives the subscription id.- Returns:
- the current
StompClientConnection
-
subscribe
public StompClientConnection subscribe(String destination, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
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:
- the current
StompClientConnection
-
rxSubscribe
public io.reactivex.Single<String> rxSubscribe(String destination, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
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:
- the current
StompClientConnection
-
subscribe
public StompClientConnection subscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler, io.vertx.core.Handler<io.vertx.core.AsyncResult<String>> receiptHandler)
Subscribes to the given destination.- Parameters:
destination- the destination, must not benullheaders- 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.receiptHandler- the handler invoked when theRECEIPTframe associated with the subscription has been received. The handler receives the subscription id.- Returns:
- the current
StompClientConnection
-
subscribe
public StompClientConnection subscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
Subscribes to the given destination.- Parameters:
destination- the destination, must not benullheaders- 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:
- the current
StompClientConnection
-
rxSubscribe
public io.reactivex.Single<String> rxSubscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
Subscribes to the given destination.- Parameters:
destination- the destination, must not benullheaders- 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:
- the current
StompClientConnection
-
unsubscribe
public StompClientConnection unsubscribe(String destination, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Un-subscribes from the given destination. This method only works if the subscription did not specifies a subscription id (using theidheader).- Parameters:
destination- the destinationreceiptHandler- the handler invoked when theRECEIPTframe associated with the un-subscription has been received. The handler receives the sent frame (UNSUBSCRIBE).- Returns:
- the current
StompClientConnection
-
unsubscribe
public StompClientConnection unsubscribe(String destination)
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:
- the current
StompClientConnection
-
rxUnsubscribe
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxUnsubscribe(String destination)
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:
- the current
StompClientConnection
-
unsubscribe
public StompClientConnection unsubscribe(String destination, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 headersreceiptHandler- the handler invoked when theRECEIPTframe associated with the un-subscription has been received. The handler receives the sent frame (UNSUBSCRIBE).- Returns:
- the current
StompClientConnection
-
unsubscribe
public StompClientConnection unsubscribe(String destination, Map<String,String> headers)
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:
- the current
StompClientConnection
-
rxUnsubscribe
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxUnsubscribe(String destination, Map<String,String> headers)
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:
- the current
StompClientConnection
-
errorHandler
public StompClientConnection errorHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
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
public StompClientConnection closeHandler(io.vertx.core.Handler<StompClientConnection> handler)
Sets a handler notified when the STOMP connection is closed.- Parameters:
handler- the handler- Returns:
- the current
StompClientConnection
-
connectionDroppedHandler
public StompClientConnection connectionDroppedHandler(io.vertx.core.Handler<StompClientConnection> handler)
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
public StompClientConnection pingHandler(io.vertx.core.Handler<StompClientConnection> handler)
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
public StompClientConnection beginTX(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Begins a transaction.- Parameters:
id- the transaction id, must not benullreceiptHandler- the handler invoked when theRECEIPTframe associated with the transaction begin has been processed by the server. The handler receives the sent frame (BEGIN).- Returns:
- the current
StompClientConnection
-
beginTX
public StompClientConnection beginTX(String id)
Begins a transaction.- Parameters:
id- the transaction id, must not benull- Returns:
- the current
StompClientConnection
-
rxBeginTX
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxBeginTX(String id)
Begins a transaction.- Parameters:
id- the transaction id, must not benull- Returns:
- the current
StompClientConnection
-
beginTX
public StompClientConnection beginTX(String id, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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} parameterreceiptHandler- the handler invoked when theRECEIPTframe associated with the transaction begin has been processed by the server. The handler receives the sent frame (BEGIN).- Returns:
- the current
StompClientConnection
-
beginTX
public StompClientConnection beginTX(String id, Map<String,String> headers)
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:
- the current
StompClientConnection
-
rxBeginTX
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxBeginTX(String id, Map<String,String> headers)
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:
- the current
StompClientConnection
-
commit
public StompClientConnection commit(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Commits a transaction.- Parameters:
id- the transaction id, must not benullreceiptHandler- the handler invoked when theRECEIPTframe associated with the transaction commit has been processed by the server. The handler receives the sent frame (COMMIT).- Returns:
- the current
StompClientConnection
-
commit
public StompClientConnection commit(String id)
Commits a transaction.- Parameters:
id- the transaction id, must not benull- Returns:
- the current
StompClientConnection
-
rxCommit
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxCommit(String id)
Commits a transaction.- Parameters:
id- the transaction id, must not benull- Returns:
- the current
StompClientConnection
-
commit
public StompClientConnection commit(String id, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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} parameterreceiptHandler- the handler invoked when theRECEIPTframe associated with the transaction commit has been processed by the server. The handler receives the sent frame (COMMIT).- Returns:
- the current
StompClientConnection
-
commit
public StompClientConnection commit(String id, Map<String,String> headers)
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:
- the current
StompClientConnection
-
rxCommit
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxCommit(String id, Map<String,String> headers)
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:
- the current
StompClientConnection
-
abort
public StompClientConnection abort(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Aborts a transaction.- Parameters:
id- the transaction id, must not benullreceiptHandler- the handler invoked when theRECEIPTframe associated with the transaction cancellation has been processed by the server. The handler receives the sent frame (ABORT).- Returns:
- the current
StompClientConnection
-
abort
public StompClientConnection abort(String id)
Aborts a transaction.- Parameters:
id- the transaction id, must not benull- Returns:
- the current
StompClientConnection
-
rxAbort
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxAbort(String id)
Aborts a transaction.- Parameters:
id- the transaction id, must not benull- Returns:
- the current
StompClientConnection
-
abort
public StompClientConnection abort(String id, Map<String,String> headers, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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} parameterreceiptHandler- the handler invoked when theRECEIPTframe associated with the transaction cancellation has been processed by the server. The handler receives the sent frame (ABORT).- Returns:
- the current
StompClientConnection
-
abort
public StompClientConnection abort(String id, Map<String,String> headers)
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:
- the current
StompClientConnection
-
rxAbort
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxAbort(String id, Map<String,String> headers)
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:
- the current
StompClientConnection
-
disconnect
public StompClientConnection disconnect(io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server.- Parameters:
receiptHandler- the handler invoked when theRECEIPTframe associated with the disconnection has been processed by the server. The handler receives the sent frame (DISCONNECT).- Returns:
- the current
StompClientConnection
-
disconnect
public StompClientConnection disconnect()
Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server.- Returns:
- the current
StompClientConnection
-
rxDisconnect
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxDisconnect()
Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server.- Returns:
- the current
StompClientConnection
-
disconnect
public StompClientConnection disconnect(io.vertx.ext.stomp.Frame frame, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server. This method lets you customize theDISCONNECTframe.- Parameters:
frame- theDISCONNECTframe.receiptHandler- the handler invoked when theRECEIPTframe associated with the disconnection has been processed by the server. The handler receives the sent frame (DISCONNECT).- Returns:
- a future resolved with the sent frame when the
RECEIPTframe associated with the sent frame has been received
-
disconnect
public StompClientConnection disconnect(io.vertx.ext.stomp.Frame frame)
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
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxDisconnect(io.vertx.ext.stomp.Frame frame)
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
public StompClientConnection ack(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 acknowledgereceiptHandler- the handler invoked when theRECEIPTframe associated with the acknowledgment has been processed by the server. The handler receives the sent frame (ACK).- Returns:
- the current
StompClientConnection
-
ack
public StompClientConnection ack(String id)
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:
- the current
StompClientConnection
-
rxAck
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxAck(String id)
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:
- the current
StompClientConnection
-
nack
public StompClientConnection nack(String id, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 acknowledgereceiptHandler- the handler invoked when theRECEIPTframe associated with the non-acknowledgment has been processed by the server. The handler receives the sent frame (NACK).- Returns:
- the current
StompClientConnection
-
nack
public StompClientConnection nack(String id)
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:
- the current
StompClientConnection
-
rxNack
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxNack(String id)
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:
- the current
StompClientConnection
-
ack
public StompClientConnection ack(String id, String txId, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 idreceiptHandler- the handler invoked when theRECEIPTframe associated with the acknowledgment has been processed by the server. The handler receives the sent frame (ACK).- Returns:
- the current
StompClientConnection
-
ack
public StompClientConnection ack(String id, String txId)
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:
- the current
StompClientConnection
-
rxAck
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxAck(String id, String txId)
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:
- the current
StompClientConnection
-
nack
public StompClientConnection nack(String id, String txId, io.vertx.core.Handler<io.vertx.core.AsyncResult<io.vertx.ext.stomp.Frame>> receiptHandler)
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 idreceiptHandler- the handler invoked when theRECEIPTframe associated with the non-acknowledgment has been processed by the server. The handler receives the sent frame (NACK).- Returns:
- the current
StompClientConnection
-
nack
public StompClientConnection nack(String id, String txId)
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:
- the current
StompClientConnection
-
rxNack
public io.reactivex.Single<io.vertx.ext.stomp.Frame> rxNack(String id, String txId)
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:
- the current
StompClientConnection
-
receivedFrameHandler
public StompClientConnection receivedFrameHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
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(io.vertx.core.Handler<io.vertx.ext.stomp.Frame>), 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
public StompClientConnection writingFrameHandler(io.vertx.core.Handler<io.vertx.ext.stomp.Frame> handler)
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
public StompClientConnection exceptionHandler(io.vertx.core.Handler<Throwable> 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
public static StompClientConnection newInstance(io.vertx.ext.stomp.StompClientConnection arg)
-
-