Package io.vertx.reactivex.ext.stomp
Class StompClientConnection
- java.lang.Object
- 
- io.vertx.reactivex.ext.stomp.StompClientConnection
 
- 
- All Implemented Interfaces:
- io.vertx.lang.rx.RxDelegate
 
 public class StompClientConnection extends Object implements io.vertx.lang.rx.RxDelegate 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 the originalnon RX-ified interface using Vert.x codegen.
- 
- 
Field SummaryFields Modifier and Type Field Description static io.vertx.lang.rx.TypeArg<StompClientConnection>__TYPE_ARG
 - 
Constructor SummaryConstructors Constructor Description StompClientConnection(StompClientConnection delegate)StompClientConnection(Object delegate)
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Future<Frame>abort(String id)Aborts a transaction.Future<Frame>abort(String id, Map<String,String> headers)Aborts a transaction.Future<Frame>ack(String id)Sends an acknowledgement for a specific message.Future<Frame>ack(String id, String txId)Sends an acknowledgement for the given frame.Future<Frame>beginTX(String id)Begins a transaction.Future<Frame>beginTX(String id, Map<String,String> headers)Begins a transaction.voidclose()Closes the connection without sending theDISCONNECTframe.StompClientConnectioncloseHandler(Handler<StompClientConnection> handler)Sets a handler notified when the STOMP connection is closed.Future<Frame>commit(String id)Commits a transaction.Future<Frame>commit(String id, Map<String,String> headers)Commits a transaction.StompClientConnectionconnectionDroppedHandler(Handler<StompClientConnection> handler)Sets a handler notified when the server does not respond to apingrequest in time.Future<Frame>disconnect()Disconnects the client.Future<Frame>disconnect(Frame frame)Disconnects the client.booleanequals(Object o)StompClientConnectionerrorHandler(Handler<Frame> handler)Sets a handler notified when anERRORframe is received by the client.StompClientConnectionexceptionHandler(Handler<Throwable> exceptionHandler)Configures the exception handler notified upon TCP-level errors.StompClientConnectiongetDelegate()inthashCode()booleanisConnected()Returns whether or not the `CONNECTED` frame has been receive meaning that the Stomp connection is established.Future<Frame>nack(String id)Sends a non-acknowledgement for the given message.Future<Frame>nack(String id, String txId)Sends a non-acknowledgement for the given frame.static StompClientConnectionnewInstance(StompClientConnection arg)StompClientConnectionpingHandler(Handler<StompClientConnection> handler)Sets a handler that let customize the behavior when a ping needs to be sent to the server.StompClientConnectionreceivedFrameHandler(Handler<Frame> handler)Configures a received handler that get notified when a STOMP frame is received by the client.Single<Frame>rxAbort(String id)Aborts a transaction.Single<Frame>rxAbort(String id, Map<String,String> headers)Aborts a transaction.Single<Frame>rxAck(String id)Sends an acknowledgement for a specific message.Single<Frame>rxAck(String id, String txId)Sends an acknowledgement for the given frame.Single<Frame>rxBeginTX(String id)Begins a transaction.Single<Frame>rxBeginTX(String id, Map<String,String> headers)Begins a transaction.Single<Frame>rxCommit(String id)Commits a transaction.Single<Frame>rxCommit(String id, Map<String,String> headers)Commits a transaction.Single<Frame>rxDisconnect()Disconnects the client.Single<Frame>rxDisconnect(Frame frame)Disconnects the client.Single<Frame>rxNack(String id)Sends a non-acknowledgement for the given message.Single<Frame>rxNack(String id, String txId)Sends a non-acknowledgement for the given frame.Single<Frame>rxSend(Frame frame)Sends the given frame to the server.Single<Frame>rxSend(String destination, Buffer body)Sends aSENDframe to the server to the given destination.Single<Frame>rxSend(String destination, Map<String,String> headers, Buffer body)Sends aSENDframe to the server to the given destination.Single<Frame>rxSend(Map<String,String> headers, Buffer body)Sends aSENDframe to the server.Single<String>rxSubscribe(String destination, Handler<Frame> handler)Subscribes to the given destination.Single<String>rxSubscribe(String destination, Map<String,String> headers, Handler<Frame> handler)Subscribes to the given destination.Single<Frame>rxUnsubscribe(String destination)Un-subscribes from the given destination.Single<Frame>rxUnsubscribe(String destination, Map<String,String> headers)Un-subscribes from the given destination.Future<Frame>send(Frame frame)Sends the given frame to the server.Future<Frame>send(String destination, Buffer body)Sends aSENDframe to the server to the given destination.Future<Frame>send(String destination, Map<String,String> headers, Buffer body)Sends aSENDframe to the server to the given destination.Future<Frame>send(Map<String,String> headers, Buffer body)Sends aSENDframe to the server.Stringserver()Stringsession()Future<String>subscribe(String destination, Handler<Frame> handler)Subscribes to the given destination.Future<String>subscribe(String destination, Map<String,String> headers, Handler<Frame> handler)Subscribes to the given destination.StringtoString()Future<Frame>unsubscribe(String destination)Un-subscribes from the given destination.Future<Frame>unsubscribe(String destination, Map<String,String> headers)Un-subscribes from the given destination.Stringversion()StompClientConnectionwritingFrameHandler(Handler<Frame> handler)Configures a handler notified when a frame is going to be written on the wire.
 
- 
- 
- 
Field Detail- 
__TYPE_ARGpublic static final io.vertx.lang.rx.TypeArg<StompClientConnection> __TYPE_ARG 
 
- 
 - 
Constructor Detail- 
StompClientConnectionpublic StompClientConnection(StompClientConnection delegate) 
 - 
StompClientConnectionpublic StompClientConnection(Object delegate) 
 
- 
 - 
Method Detail- 
getDelegatepublic StompClientConnection getDelegate() - Specified by:
- getDelegatein interface- io.vertx.lang.rx.RxDelegate
 
 - 
sessionpublic String session() - Returns:
- the session id.
 
 - 
versionpublic String version() - Returns:
- the STOMP protocol version negotiated with the server.
 
 - 
closepublic void close() Closes the connection without sending theDISCONNECTframe.
 - 
serverpublic String server() - Returns:
- the server name.
 
 - 
sendpublic Future<Frame> send(Map<String,String> headers, Buffer body) Sends aSENDframe to the server.- Parameters:
- headers- the headers, must not be- null
- body- the body, may be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxSendpublic Single<Frame> rxSend(Map<String,String> headers, Buffer body) Sends aSENDframe to the server.- Parameters:
- headers- the headers, must not be- null
- body- the body, may be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
sendpublic Future<Frame> 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 be- null
- body- the body, may be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxSendpublic Single<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 be- null
- body- the body, may be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
sendpublic Future<Frame> send(Frame frame) Sends the given frame to the server.- Parameters:
- frame- the frame
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxSendpublic Single<Frame> rxSend(Frame frame) Sends the given frame to the server.- Parameters:
- frame- the frame
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
sendpublic Future<Frame> send(String destination, Map<String,String> headers, Buffer body) Sends aSENDframe to the server to the given destination.- Parameters:
- destination- the destination, must not be- null
- headers- the header. The- destinationheader is replaced by the value given to the- destinationparameter
- body- the body, may be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxSendpublic Single<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 be- null
- headers- the header. The- destinationheader is replaced by the value given to the- destinationparameter
- body- the body, may be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
subscribepublic Future<String> subscribe(String destination, Handler<Frame> handler) Subscribes to the given destination. This destination is used as subscription id.- Parameters:
- destination- the destination, must not be- null
- handler- the handler invoked when a message is received on the given destination. Must not be- null.
- Returns:
- a future resolved with the subscription id when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxSubscribepublic Single<String> rxSubscribe(String destination, Handler<Frame> handler) Subscribes to the given destination. This destination is used as subscription id.- Parameters:
- destination- the destination, must not be- null
- handler- the handler invoked when a message is received on the given destination. Must not be- null.
- Returns:
- a future resolved with the subscription id when the RECEIPTframe associated with the sent frame has been received
 
 - 
subscribepublic Future<String> subscribe(String destination, Map<String,String> headers, Handler<Frame> handler) Subscribes to the given destination.- Parameters:
- destination- the destination, must not be- null.
- headers- the headers to configure the subscription. It may contain the- ackheader to configure the acknowledgment policy. If the given set of headers contains the- idheader, this value is used as subscription id.
- handler- the handler invoked when a message is received on the given destination. Must not be- null.
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxSubscribepublic Single<String> rxSubscribe(String destination, Map<String,String> headers, Handler<Frame> handler) Subscribes to the given destination.- Parameters:
- destination- the destination, must not be- null.
- headers- the headers to configure the subscription. It may contain the- ackheader to configure the acknowledgment policy. If the given set of headers contains the- idheader, this value is used as subscription id.
- handler- the handler invoked when a message is received on the given destination. Must not be- null.
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
unsubscribepublic Future<Frame> 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:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxUnsubscribepublic Single<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:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
unsubscribepublic Future<Frame> 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 destination
- headers- the headers
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxUnsubscribepublic Single<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 destination
- headers- the headers
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
errorHandlerpublic StompClientConnection errorHandler(Handler<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
 
 - 
closeHandlerpublic StompClientConnection closeHandler(Handler<StompClientConnection> handler) Sets a handler notified when the STOMP connection is closed.- Parameters:
- handler- the handler
- Returns:
- the current StompClientConnection
 
 - 
connectionDroppedHandlerpublic StompClientConnection connectionDroppedHandler(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.
 
 - 
pingHandlerpublic StompClientConnection pingHandler(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
 
 - 
beginTXpublic Future<Frame> beginTX(String id) Begins a transaction.- Parameters:
- id- the transaction id, must not be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxBeginTXpublic Single<Frame> rxBeginTX(String id) Begins a transaction.- Parameters:
- id- the transaction id, must not be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
beginTXpublic Future<Frame> beginTX(String id, Map<String,String> headers) Begins a transaction.- Parameters:
- id- the transaction id, must not be- null
- headers- additional headers to send to the server. The- transactionheader 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
 
 - 
rxBeginTXpublic Single<Frame> rxBeginTX(String id, Map<String,String> headers) Begins a transaction.- Parameters:
- id- the transaction id, must not be- null
- headers- additional headers to send to the server. The- transactionheader 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
 
 - 
commitpublic Future<Frame> commit(String id) Commits a transaction.- Parameters:
- id- the transaction id, must not be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxCommitpublic Single<Frame> rxCommit(String id) Commits a transaction.- Parameters:
- id- the transaction id, must not be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
commitpublic Future<Frame> commit(String id, Map<String,String> headers) Commits a transaction.- Parameters:
- id- the transaction id, must not be- null
- headers- additional headers to send to the server. The- transactionheader 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
 
 - 
rxCommitpublic Single<Frame> rxCommit(String id, Map<String,String> headers) Commits a transaction.- Parameters:
- id- the transaction id, must not be- null
- headers- additional headers to send to the server. The- transactionheader 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
 
 - 
abortpublic Future<Frame> abort(String id) Aborts a transaction.- Parameters:
- id- the transaction id, must not be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxAbortpublic Single<Frame> rxAbort(String id) Aborts a transaction.- Parameters:
- id- the transaction id, must not be- null
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
abortpublic Future<Frame> abort(String id, Map<String,String> headers) Aborts a transaction.- Parameters:
- id- the transaction id, must not be- null
- headers- additional headers to send to the server. The- transactionheader 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
 
 - 
rxAbortpublic Single<Frame> rxAbort(String id, Map<String,String> headers) Aborts a transaction.- Parameters:
- id- the transaction id, must not be- null
- headers- additional headers to send to the server. The- transactionheader 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
 
 - 
disconnectpublic Future<Frame> disconnect() Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server.- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxDisconnectpublic Single<Frame> rxDisconnect() Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server.- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
disconnectpublic Future<Frame> disconnect(Frame frame) Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server. This method lets you customize theDISCONNECTframe.- Parameters:
- frame- the- DISCONNECTframe.
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxDisconnectpublic Single<Frame> rxDisconnect(Frame frame) Disconnects the client. Unlike theclose()method, this method send theDISCONNECTframe to the server. This method lets you customize theDISCONNECTframe.- Parameters:
- frame- the- DISCONNECTframe.
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
ackpublic Future<Frame> 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:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxAckpublic Single<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:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
nackpublic Future<Frame> 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:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxNackpublic Single<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:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
ackpublic Future<Frame> 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 acknowledge
- txId- the transaction id
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxAckpublic Single<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 acknowledge
- txId- the transaction id
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
nackpublic Future<Frame> 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 acknowledge
- txId- the transaction id
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
rxNackpublic Single<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 acknowledge
- txId- the transaction id
- Returns:
- a future resolved with the sent frame when the RECEIPTframe associated with the sent frame has been received
 
 - 
receivedFrameHandlerpublic StompClientConnection receivedFrameHandler(Handler<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
 
 - 
writingFrameHandlerpublic StompClientConnection writingFrameHandler(Handler<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
 
 - 
exceptionHandlerpublic StompClientConnection exceptionHandler(Handler<Throwable> exceptionHandler) Configures the exception handler notified upon TCP-level errors.- Parameters:
- exceptionHandler- the handler
- Returns:
- the current StompClientConnection
 
 - 
isConnectedpublic 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
 
 - 
newInstancepublic static StompClientConnection newInstance(StompClientConnection arg) 
 
- 
 
-