interface StompClientConnection
Once a connection to the STOMP server has been made, client receives a StompClientConnection, that let send and receive STOMP frames.
Author
Clement Escoffier
abstract fun abort(id: String): StompClientConnectionabstract fun abort(id: String, receiptHandler: Handler<Frame>): StompClientConnectionabstract fun abort(id: String, headers: MutableMap<String, String>): StompClientConnectionabstract fun abort(id: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection
Aborts a transaction. |
|
abstract fun ack(id: String): StompClientConnectionabstract fun ack(id: String, receiptHandler: Handler<Frame>): StompClientConnection
Sends an acknowledgement for a specific message. It means that the message has been handled and processed by the client. The abstract fun ack(id: String, txId: String): StompClientConnectionabstract fun ack(id: String, txId: String, receiptHandler: Handler<Frame>): StompClientConnection
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. |
|
abstract fun beginTX(id: String, receiptHandler: Handler<Frame>): StompClientConnectionabstract fun beginTX(id: String): StompClientConnectionabstract fun beginTX(id: String, headers: MutableMap<String, String>): StompClientConnectionabstract fun beginTX(id: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection
Begins a transaction. |
|
abstract fun close(): Unit
Closes the connection without sending the |
|
abstract fun closeHandler(handler: Handler<StompClientConnection>): StompClientConnection
Sets a handler notified when the STOMP connection is closed. |
|
abstract fun commit(id: String): StompClientConnectionabstract fun commit(id: String, receiptHandler: Handler<Frame>): StompClientConnectionabstract fun commit(id: String, headers: MutableMap<String, String>): StompClientConnectionabstract fun commit(id: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection
Commits a transaction. |
|
abstract fun connectionDroppedHandler(handler: Handler<StompClientConnection>): StompClientConnection
Sets a handler notified when the server does not respond to a |
|
abstract fun disconnect(): StompClientConnectionabstract fun disconnect(receiptHandler: Handler<Frame>): StompClientConnection
Disconnects the client. Unlike the abstract fun disconnect(frame: Frame): StompClientConnectionabstract fun disconnect(frame: Frame, receiptHandler: Handler<Frame>): StompClientConnection
Disconnects the client. Unlike the |
|
abstract fun errorHandler(handler: Handler<Frame>): StompClientConnection
Sets a handler notified when an |
|
abstract fun exceptionHandler(exceptionHandler: Handler<Throwable>): StompClientConnection
Configures the exception handler notified upon TCP-level errors. |
|
abstract fun isConnected(): Boolean
Returns whether or not the `CONNECTED` frame has been receive meaning that the Stomp connection is established. |
|
abstract fun nack(id: String): StompClientConnectionabstract fun nack(id: String, receiptHandler: Handler<Frame>): StompClientConnection
Sends a non-acknowledgement for the given message. It means that the message has not been handled by the client. The abstract fun nack(id: String, txId: String): StompClientConnectionabstract fun nack(id: String, txId: String, receiptHandler: Handler<Frame>): StompClientConnection
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. |
|
abstract fun pingHandler(handler: Handler<StompClientConnection>): StompClientConnection
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. |
|
abstract fun receivedFrameHandler(handler: Handler<Frame>): StompClientConnection
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 |
|
abstract fun send(headers: MutableMap<String, String>, body: Buffer): StompClientConnectionabstract fun send(headers: MutableMap<String, String>, body: Buffer, receiptHandler: Handler<Frame>): StompClientConnection
Sends a abstract fun send(destination: String, body: Buffer): StompClientConnectionabstract fun send(destination: String, body: Buffer, receiptHandler: Handler<Frame>): StompClientConnection
Sends a abstract fun send(frame: Frame): StompClientConnectionabstract fun send(frame: Frame, receiptHandler: Handler<Frame>): StompClientConnection
Sends the given frame to the server. abstract fun send(destination: String, headers: MutableMap<String, String>, body: Buffer): StompClientConnectionabstract fun send(destination: String, headers: MutableMap<String, String>, body: Buffer, receiptHandler: Handler<Frame>): StompClientConnection
Sends a |
|
abstract fun server(): String |
|
abstract fun session(): String |
|
abstract fun subscribe(destination: String, handler: Handler<Frame>): Stringabstract fun subscribe(destination: String, handler: Handler<Frame>, receiptHandler: Handler<Frame>): String
Subscribes to the given destination. This destination is used as subscription id. abstract fun subscribe(destination: String, headers: MutableMap<String, String>, handler: Handler<Frame>): Stringabstract fun subscribe(destination: String, headers: MutableMap<String, String>, handler: Handler<Frame>, receiptHandler: Handler<Frame>): String
Subscribes to the given destination. |
|
abstract fun unsubscribe(destination: String): StompClientConnectionabstract fun unsubscribe(destination: String, receiptHandler: Handler<Frame>): StompClientConnection
Un-subscribes from the given destination. This method only works if the subscription did not specifies a subscription id (using the abstract fun unsubscribe(destination: String, headers: MutableMap<String, String>): StompClientConnectionabstract fun unsubscribe(destination: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection
Un-subscribes from the given destination. This method computes the subscription id as follows. If the given headers contains the |
|
abstract fun version(): String |
|
abstract fun writingFrameHandler(handler: Handler<Frame>): StompClientConnection
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. |