vertx / io.vertx.rxjava.ext.stomp / StompClientConnection

StompClientConnection

open class StompClientConnection

Once a connection to the STOMP server has been made, client receives a io.vertx.rxjava.ext.stomp.StompClientConnection, that let send and receive STOMP frames. NOTE: This class has been automatically generated from the io.vertx.ext.stomp.StompClientConnection non RX-ified interface using Vert.x codegen.

Constructors

<init>

StompClientConnection(delegate: StompClientConnection)

Properties

__TYPE_ARG

static val __TYPE_ARG: TypeArg<StompClientConnection>

Functions

abort

open fun abort(id: String): StompClientConnection
open fun abort(id: String, receiptHandler: Handler<Frame>): StompClientConnection
open fun abort(id: String, headers: MutableMap<String, String>): StompClientConnection
open fun abort(id: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection

Aborts a transaction.

ack

open fun ack(id: String): StompClientConnection
open 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 id parameter is the message id received in the frame.

open fun ack(id: String, txId: String): StompClientConnection
open 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.

beginTX

open fun beginTX(id: String, receiptHandler: Handler<Frame>): StompClientConnection
open fun beginTX(id: String): StompClientConnection
open fun beginTX(id: String, headers: MutableMap<String, String>): StompClientConnection
open fun beginTX(id: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection

Begins a transaction.

close

open fun close(): Unit

Closes the connection without sending the DISCONNECT frame.

closeHandler

open fun closeHandler(handler: Handler<StompClientConnection>): StompClientConnection

Sets a handler notified when the STOMP connection is closed.

commit

open fun commit(id: String): StompClientConnection
open fun commit(id: String, receiptHandler: Handler<Frame>): StompClientConnection
open fun commit(id: String, headers: MutableMap<String, String>): StompClientConnection
open fun commit(id: String, headers: MutableMap<String, String>, receiptHandler: Handler<Frame>): StompClientConnection

Commits a transaction.

connectionDroppedHandler

open fun connectionDroppedHandler(handler: Handler<StompClientConnection>): StompClientConnection

Sets a handler notified when the server does not respond to a ping request 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.

disconnect

open fun disconnect(): StompClientConnection
open fun disconnect(receiptHandler: Handler<Frame>): StompClientConnection

Disconnects the client. Unlike the io.vertx.rxjava.ext.stomp.StompClientConnection#close method, this method send the DISCONNECT frame to the server.

open fun disconnect(frame: Frame): StompClientConnection
open fun disconnect(frame: Frame, receiptHandler: Handler<Frame>): StompClientConnection

Disconnects the client. Unlike the io.vertx.rxjava.ext.stomp.StompClientConnection#close method, this method send the DISCONNECT frame to the server. This method lets you customize the DISCONNECT frame.

equals

open fun equals(other: Any?): Boolean

errorHandler

open fun errorHandler(handler: Handler<Frame>): StompClientConnection

Sets a handler notified when an ERROR frame is received by the client. The handler receives the ERROR frame and a reference on the io.vertx.rxjava.ext.stomp.StompClientConnection.

exceptionHandler

open fun exceptionHandler(exceptionHandler: Handler<Throwable>): StompClientConnection

Configures the exception handler notified upon TCP-level errors.

getDelegate

open fun getDelegate(): StompClientConnection

hashCode

open fun hashCode(): Int

isConnected

open fun isConnected(): Boolean

Returns whether or not the `CONNECTED` frame has been receive meaning that the Stomp connection is established.

nack

open fun nack(id: String): StompClientConnection
open 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 id parameter is the message id received in the frame.

open fun nack(id: String, txId: String): StompClientConnection
open 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.

newInstance

open static fun newInstance(arg: StompClientConnection): StompClientConnection

pingHandler

open 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.

receivedFrameHandler

open 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 io.vertx.rxjava.ext.stomp.StompClient#receivedFrameHandler, the given handler won't receive the CONNECTED frame. If a received frame handler is set on the io.vertx.rxjava.ext.stomp.StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.

send

open fun send(headers: MutableMap<String, String>, body: Buffer): StompClientConnection
open fun send(headers: MutableMap<String, String>, body: Buffer, receiptHandler: Handler<Frame>): StompClientConnection

Sends a SEND frame to the server.

open fun send(destination: String, body: Buffer): StompClientConnection
open fun send(destination: String, body: Buffer, receiptHandler: Handler<Frame>): StompClientConnection

Sends a SEND frame to the server to the given destination. The message does not have any other header.

open fun send(frame: Frame): StompClientConnection
open fun send(frame: Frame, receiptHandler: Handler<Frame>): StompClientConnection

Sends the given frame to the server.

open fun send(destination: String, headers: MutableMap<String, String>, body: Buffer): StompClientConnection
open fun send(destination: String, headers: MutableMap<String, String>, body: Buffer, receiptHandler: Handler<Frame>): StompClientConnection

Sends a SEND frame to the server to the given destination.

server

open fun server(): String

session

open fun session(): String

subscribe

open fun subscribe(destination: String, handler: Handler<Frame>): String
open fun subscribe(destination: String, handler: Handler<Frame>, receiptHandler: Handler<Frame>): String

Subscribes to the given destination. This destination is used as subscription id.

open fun subscribe(destination: String, headers: MutableMap<String, String>, handler: Handler<Frame>): String
open fun subscribe(destination: String, headers: MutableMap<String, String>, handler: Handler<Frame>, receiptHandler: Handler<Frame>): String

Subscribes to the given destination.

toString

open fun toString(): String

unsubscribe

open fun unsubscribe(destination: String): StompClientConnection
open 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 id header).

open fun unsubscribe(destination: String, headers: MutableMap<String, String>): StompClientConnection
open 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 id header, the header value is used. Otherwise the destination is used.

version

open fun version(): String

writingFrameHandler

open 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 io.vertx.rxjava.ext.stomp.StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.