Class: VertxStomp::StompClientConnection

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb

Overview

Once a connection to the STOMP server has been made, client receives a StompClientConnection, that let send and receive STOMP frames.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


20
21
22
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 20

def @@j_api_type.accept?(obj)
  obj.class == StompClientConnection
end

+ (Object) j_api_type



29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 29

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



32
33
34
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 32

def self.j_class
  Java::IoVertxExtStomp::StompClientConnection.java_class
end

+ (Object) unwrap(obj)



26
27
28
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 26

def @@j_api_type.unwrap(obj)
  obj.j_del
end

+ (Object) wrap(obj)



23
24
25
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 23

def @@j_api_type.wrap(obj)
  StompClientConnection.new(obj)
end

Instance Method Details

- (self) abort(id) - (self) abort(id, receiptHandler) { ... } - (self) abort(id, headers) - (self) abort(id, headers, receiptHandler) { ... }

Aborts a transaction.

Overloads:

  • - (self) abort(id)

    Parameters:

    • id (String)
      the transaction id, must not be null
  • - (self) abort(id, receiptHandler) { ... }

    Parameters:

    • id (String)
      the transaction id, must not be null

    Yields:

    • the handler invoked when the RECEIPT frame associated with the transaction cancellation has been processed by the server. The handler receives the sent frame (ABORT).
  • - (self) abort(id, headers)

    Parameters:

    • id (String)
      the transaction id, must not be null
    • headers (Hash{String => String})
      additional headers to send to the server. The transaction header is replaced by the value passed in the @id parameter
  • - (self) abort(id, headers, receiptHandler) { ... }

    Parameters:

    • id (String)
      the transaction id, must not be null
    • headers (Hash{String => String})
      additional headers to send to the server. The transaction header is replaced by the value passed in the @id parameter

    Yields:

    • the handler invoked when the RECEIPT frame associated with the transaction cancellation has been processed by the server. The handler receives the sent frame (ABORT).

Returns:

  • (self)


334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 334

def abort(*args)
  if args[0].class == String && !block_given? && args[1] == nil
    @j_del.java_method(:abort, [Java::java.lang.String.java_class]).call(args[0])
    return self
  elsif args[0].class == String && true && args[1] == nil
    @j_del.java_method(:abort, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == Hash && !block_given?
    @j_del.java_method(:abort, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }])
    return self
  elsif args[0].class == String && args[1].class == Hash && true
    @j_del.java_method(:abort, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling abort(#{args[0]},#{args[1]})"
  end
end

- (self) ack(id) - (self) ack(id, receiptHandler) { ... } - (self) ack(id, txId) - (self) ack(id, txId, 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.

Overloads:

  • - (self) ack(id)

    Parameters:

    • id (String)
      the message id of the message to acknowledge
  • - (self) ack(id, receiptHandler) { ... }

    Parameters:

    • id (String)
      the message id of the message to acknowledge

    Yields:

    • the handler invoked when the RECEIPT frame associated with the acknowledgment has been processed by the server. The handler receives the sent frame (ACK).
  • - (self) ack(id, txId)

    Parameters:

    • id (String)
      the message id of the message to acknowledge
    • txId (String)
      the transaction id
  • - (self) ack(id, txId, receiptHandler) { ... }

    Parameters:

    • id (String)
      the message id of the message to acknowledge
    • txId (String)
      the transaction id

    Yields:

    • the handler invoked when the RECEIPT frame associated with the acknowledgment has been processed by the server. The handler receives the sent frame (ACK).

Returns:

  • (self)


223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 223

def ack(*args)
  if args[0].class == String && !block_given? && args[1] == nil
    @j_del.java_method(:ack, [Java::java.lang.String.java_class]).call(args[0])
    return self
  elsif args[0].class == String && true && args[1] == nil
    @j_del.java_method(:ack, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == String && !block_given?
    @j_del.java_method(:ack, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(args[0],args[1])
    return self
  elsif args[0].class == String && args[1].class == String && true
    @j_del.java_method(:ack, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling ack(#{args[0]},#{args[1]})"
  end
end

- (self) beginTX(id) - (self) beginTX(id, receiptHandler) { ... } - (self) beginTX(id, headers) - (self) beginTX(id, headers, receiptHandler) { ... }

Begins a transaction.

Overloads:

  • - (self) beginTX(id)

    Parameters:

    • id (String)
      the transaction id, must not be null
  • - (self) beginTX(id, receiptHandler) { ... }

    Parameters:

    • id (String)
      the transaction id, must not be null

    Yields:

    • the handler invoked when the RECEIPT frame associated with the transaction begin has been processed by the server. The handler receives the sent frame (BEGIN).
  • - (self) beginTX(id, headers)

    Parameters:

    • id (String)
      the transaction id, must not be null
    • headers (Hash{String => String})
      additional headers to send to the server. The transaction header is replaced by the value passed in the @id parameter
  • - (self) beginTX(id, headers, receiptHandler) { ... }

    Parameters:

    • id (String)
      the transaction id, must not be null
    • headers (Hash{String => String})
      additional headers to send to the server. The transaction header is replaced by the value passed in the @id parameter

    Yields:

    • the handler invoked when the RECEIPT frame associated with the transaction begin has been processed by the server. The handler receives the sent frame (BEGIN).

Returns:

  • (self)


368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 368

def begin_tx(*args)
  if args[0].class == String && !block_given? && args[1] == nil
    @j_del.java_method(:beginTX, [Java::java.lang.String.java_class]).call(args[0])
    return self
  elsif args[0].class == String && true && args[1] == nil
    @j_del.java_method(:beginTX, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == Hash && !block_given?
    @j_del.java_method(:beginTX, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }])
    return self
  elsif args[0].class == String && args[1].class == Hash && true
    @j_del.java_method(:beginTX, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling begin_tx(#{args[0]},#{args[1]})"
  end
end

- (void) close

This method returns an undefined value.

Closes the connection without sending the DISCONNECT frame.


537
538
539
540
541
542
543
544
545
546
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 537

def close
  if !block_given?
    return @j_del.java_method(:close, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling close()"
  end
end

- (self) closeHandler(handler) { ... }

Sets a handler notified when the STOMP connection is closed.

Yields:

  • the handler

Returns:

  • (self)


297
298
299
300
301
302
303
304
305
306
307
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 297

def close_handler
  if true
    @j_del.java_method(:closeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxStomp::StompClientConnection)) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling close_handler()"
  end
end

- (self) commit(id) - (self) commit(id, receiptHandler) { ... } - (self) commit(id, headers) - (self) commit(id, headers, receiptHandler) { ... }

Commits a transaction.

Overloads:

  • - (self) commit(id)

    Parameters:

    • id (String)
      the transaction id, must not be null
  • - (self) commit(id, receiptHandler) { ... }

    Parameters:

    • id (String)
      the transaction id, must not be null

    Yields:

    • the handler invoked when the RECEIPT frame associated with the transaction commit has been processed by the server. The handler receives the sent frame (COMMIT).
  • - (self) commit(id, headers)

    Parameters:

    • id (String)
      the transaction id, must not be null
    • headers (Hash{String => String})
      additional headers to send to the server. The transaction header is replaced by the value passed in the @id parameter
  • - (self) commit(id, headers, receiptHandler) { ... }

    Parameters:

    • id (String)
      the transaction id, must not be null
    • headers (Hash{String => String})
      additional headers to send to the server. The transaction header is replaced by the value passed in the @id parameter

    Yields:

    • the handler invoked when the RECEIPT frame associated with the transaction commit has been processed by the server. The handler receives the sent frame (COMMIT).

Returns:

  • (self)


257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 257

def commit(*args)
  if args[0].class == String && !block_given? && args[1] == nil
    @j_del.java_method(:commit, [Java::java.lang.String.java_class]).call(args[0])
    return self
  elsif args[0].class == String && true && args[1] == nil
    @j_del.java_method(:commit, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == Hash && !block_given?
    @j_del.java_method(:commit, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }])
    return self
  elsif args[0].class == String && args[1].class == Hash && true
    @j_del.java_method(:commit, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling commit(#{args[0]},#{args[1]})"
  end
end

- (true, false) isConnected

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

Returns:

  • (true, false)
    true if the connection is established, false otherwise


163
164
165
166
167
168
169
170
171
172
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 163

def connected?
  if !block_given?
    return @j_del.java_method(:isConnected, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling connected?()"
  end
end

- (self) connectionDroppedHandler(handler) { ... }

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.

Yields:

  • the handler

Returns:

  • (self)


41
42
43
44
45
46
47
48
49
50
51
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 41

def connection_dropped_handler
  if true
    @j_del.java_method(:connectionDroppedHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxStomp::StompClientConnection)) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling connection_dropped_handler()"
  end
end

- (self) disconnect - (self) disconnect(receiptHandler) { ... } - (self) disconnect(frame) - (self) disconnect(frame, receiptHandler) { ... }

Disconnects the client. Unlike the #close method, this method send the DISCONNECT frame to the server. This method lets you customize the DISCONNECT frame.

Overloads:

  • - (self) disconnect(receiptHandler) { ... }

    Yields:

    • the handler invoked when the RECEIPT frame associated with the disconnection has been processed by the server. The handler receives the sent frame (DISCONNECT).
  • - (self) disconnect(frame)

    Parameters:

    • frame (Hash{String => Object})
      the DISCONNECT frame.
  • - (self) disconnect(frame, receiptHandler) { ... }

    Parameters:

    • frame (Hash{String => Object})
      the DISCONNECT frame.

    Yields:

    • the handler invoked when the RECEIPT frame associated with the disconnection has been processed by the server. The handler receives the sent frame (DISCONNECT).

Returns:

  • (self)


63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 63

def disconnect(*args)
  if !block_given? && args[0] == nil
    @j_del.java_method(:disconnect, []).call()
    return self
  elsif true && args[0] == nil
    @j_del.java_method(:disconnect, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == Hash && !block_given?
    @j_del.java_method(:disconnect, [Java::IoVertxExtStomp::Frame.java_class]).call(Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[0])))
    return self
  elsif args[0].class == Hash && true
    @j_del.java_method(:disconnect, [Java::IoVertxExtStomp::Frame.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[0])),(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling disconnect(#{args[0]})"
  end
end

- (self) errorHandler(handler) { ... }

Sets a handler notified when an ERROR frame is received by the client. The handler receives the ERROR frame and a reference on the VertxStomp::StompClientConnection.

Yields:

  • the handler

Returns:

  • (self)


446
447
448
449
450
451
452
453
454
455
456
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 446

def error_handler
  if true
    @j_del.java_method(:errorHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling error_handler()"
  end
end

- (self) exceptionHandler(exceptionHandler) { ... }

Configures the exception handler notified upon TCP-level errors.

Yields:

  • the handler

Returns:

  • (self)


461
462
463
464
465
466
467
468
469
470
471
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 461

def exception_handler
  if true
    @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling exception_handler()"
  end
end

- (self) nack(id) - (self) nack(id, receiptHandler) { ... } - (self) nack(id, txId) - (self) nack(id, txId, 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.

Overloads:

  • - (self) nack(id)

    Parameters:

    • id (String)
      the message id of the message to acknowledge
  • - (self) nack(id, receiptHandler) { ... }

    Parameters:

    • id (String)
      the message id of the message to acknowledge

    Yields:

    • the handler invoked when the RECEIPT frame associated with the non-acknowledgment has been processed by the server. The handler receives the sent frame (NACK).
  • - (self) nack(id, txId)

    Parameters:

    • id (String)
      the message id of the message to acknowledge
    • txId (String)
      the transaction id
  • - (self) nack(id, txId, receiptHandler) { ... }

    Parameters:

    • id (String)
      the message id of the message to acknowledge
    • txId (String)
      the transaction id

    Yields:

    • the handler invoked when the RECEIPT frame associated with the non-acknowledgment has been processed by the server. The handler receives the sent frame (NACK).

Returns:

  • (self)


188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 188

def nack(*args)
  if args[0].class == String && !block_given? && args[1] == nil
    @j_del.java_method(:nack, [Java::java.lang.String.java_class]).call(args[0])
    return self
  elsif args[0].class == String && true && args[1] == nil
    @j_del.java_method(:nack, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == String && !block_given?
    @j_del.java_method(:nack, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(args[0],args[1])
    return self
  elsif args[0].class == String && args[1].class == String && true
    @j_del.java_method(:nack, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling nack(#{args[0]},#{args[1]})"
  end
end

- (self) pingHandler(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.

Yields:

  • the handler

Returns:

  • (self)


282
283
284
285
286
287
288
289
290
291
292
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 282

def ping_handler
  if true
    @j_del.java_method(:pingHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxStomp::StompClientConnection)) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling ping_handler()"
  end
end

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

Yields:

  • the handler

Returns:

  • (self)


103
104
105
106
107
108
109
110
111
112
113
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 103

def received_frame_handler
  if true
    @j_del.java_method(:receivedFrameHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling received_frame_handler()"
  end
end

- (self) send(frame) - (self) send(headers, body) - (self) send(destination, body) - (self) send(frame, receiptHandler) { ... } - (self) send(headers, body, receiptHandler) { ... } - (self) send(destination, body, receiptHandler) { ... } - (self) send(destination, headers, body) - (self) send(destination, headers, body, receiptHandler) { ... }

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

Overloads:

  • - (self) send(frame)

    Parameters:

    • frame (Hash{String => Object})
      the frame
  • - (self) send(headers, body)

    Parameters:

    • headers (Hash{String => String})
      the headers, must not be null
    • body (::Vertx::Buffer)
      the body, may be null
  • - (self) send(destination, body)

    Parameters:

    • destination (String)
      the destination, must not be null
    • body (::Vertx::Buffer)
      the body, may be null
  • - (self) send(frame, receiptHandler) { ... }

    Parameters:

    • frame (Hash{String => Object})
      the frame

    Yields:

    • the handler invoked when the RECEIPT frame associated with the sent frame has been received. The handler receives the sent frame.
  • - (self) send(headers, body, receiptHandler) { ... }

    Parameters:

    • headers (Hash{String => String})
      the headers, must not be null
    • body (::Vertx::Buffer)
      the body, may be null

    Yields:

    • the handler invoked when the RECEIPT frame associated with the sent frame has been received. The handler receives the sent frame.
  • - (self) send(destination, body, receiptHandler) { ... }

    Parameters:

    • destination (String)
      the destination, must not be null
    • body (::Vertx::Buffer)
      the body, may be null

    Yields:

    • the handler invoked when the RECEIPT frame associated with the sent frame has been received. The handler receives the sent frame.
  • - (self) send(destination, headers, body)

    Parameters:

    • destination (String)
      the destination, must not be null
    • headers (Hash{String => String})
      the header. The destination header is replaced by the value given to the destination parameter
    • body (::Vertx::Buffer)
      the body, may be null
  • - (self) send(destination, headers, body, receiptHandler) { ... }

    Parameters:

    • destination (String)
      the destination, must not be null
    • headers (Hash{String => String})
      the header. The destination header is replaced by the value given to the destination parameter
    • body (::Vertx::Buffer)
      the body, may be null

    Yields:

    • the handler invoked when the RECEIPT frame associated with the sent frame has been received. The handler receives the sent frame.

Returns:

  • (self)


502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 502

def send(*args)
  if args[0].class == Hash && !block_given? && args[1] == nil && args[2] == nil
    @j_del.java_method(:send, [Java::IoVertxExtStomp::Frame.java_class]).call(Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[0])))
    return self
  elsif args[0].class == Hash && args[1].class.method_defined?(:j_del) && !block_given? && args[2] == nil
    @j_del.java_method(:send, [Java::JavaUtil::Map.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(Hash[args[0].map { |k,v| [k,v] }],args[1].j_del)
    return self
  elsif args[0].class == String && args[1].class.method_defined?(:j_del) && !block_given? && args[2] == nil
    @j_del.java_method(:send, [Java::java.lang.String.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(args[0],args[1].j_del)
    return self
  elsif args[0].class == Hash && true && args[1] == nil && args[2] == nil
    @j_del.java_method(:send, [Java::IoVertxExtStomp::Frame.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[0])),(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == Hash && args[1].class.method_defined?(:j_del) && true && args[2] == nil
    @j_del.java_method(:send, [Java::JavaUtil::Map.java_class,Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(Hash[args[0].map { |k,v| [k,v] }],args[1].j_del,(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class.method_defined?(:j_del) && true && args[2] == nil
    @j_del.java_method(:send, [Java::java.lang.String.java_class,Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].j_del,(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == Hash && args[2].class.method_defined?(:j_del) && !block_given?
    @j_del.java_method(:send, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],args[2].j_del)
    return self
  elsif args[0].class == String && args[1].class == Hash && args[2].class.method_defined?(:j_del) && true
    @j_del.java_method(:send, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],args[2].j_del,(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling send(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (String) server

Returns the server name.

Returns:

  • (String)
    the server name.


85
86
87
88
89
90
91
92
93
94
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 85

def server
  if !block_given?
    return @j_del.java_method(:server, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling server()"
  end
end

- (String) session

Returns the session id.

Returns:

  • (String)
    the session id.


150
151
152
153
154
155
156
157
158
159
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 150

def session
  if !block_given?
    return @j_del.java_method(:session, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling session()"
  end
end

- (String) subscribe(destination, handler) { ... } - (String) subscribe(destination, handler, receiptHandler) { ... } - (String) subscribe(destination, headers, handler) { ... } - (String) subscribe(destination, headers, handler, receiptHandler) { ... }

Subscribes to the given destination.

Overloads:

  • - (String) subscribe(destination, handler) { ... }

    Parameters:

    • destination (String)
      the destination, must not be null

    Yields:

    • the handler invoked when a message is received on the given destination. Must not be null.
  • - (String) subscribe(destination, handler, receiptHandler) { ... }

    Parameters:

    • destination (String)
      the destination, must not be null
    • handler (Proc)
      the handler invoked when a message is received on the given destination. Must not be null.

    Yields:

    • the handler invoked when the RECEIPT frame associated with the subscription has been received. The handler receives the sent frame (SUBSCRIBE).
  • - (String) subscribe(destination, headers, handler) { ... }

    Parameters:

    • destination (String)
      the destination, must not be null.
    • headers (Hash{String => String})
      the headers to configure the subscription. It may contain the ack header to configure the acknowledgment policy. If the given set of headers contains the id header, this value is used as subscription id.

    Yields:

    • the handler invoked when a message is received on the given destination. Must not be null.
  • - (String) subscribe(destination, headers, handler, receiptHandler) { ... }

    Parameters:

    • destination (String)
      the destination, must not be null
    • headers (Hash{String => String})
      the headers to configure the subscription. It may contain the ack header to configure the acknowledgment policy. If the given set of headers contains the id header, this value is used as subscription id.
    • handler (Proc)
      the handler invoked when a message is received on the given destination. Must not be null.

    Yields:

    • the handler invoked when the RECEIPT frame associated with the subscription has been received. The handler receives the sent frame (SUBSCRIBE).

Returns:

  • (String)
    the subscription id, which can either be the destination or the id set in the headers.


132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 132

def subscribe(*args)
  if args[0].class == String && true && args[1] == nil && args[2] == nil
    return @j_del.java_method(:subscribe, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
  elsif args[0].class == String && args[1].class == Proc && true && args[2] == nil
    return @j_del.java_method(:subscribe, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| args[1].call(event != nil ? JSON.parse(event.toJson.encode) : nil) unless args[1] == nil }),(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
  elsif args[0].class == String && args[1].class == Hash && true && args[2] == nil
    return @j_del.java_method(:subscribe, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
  elsif args[0].class == String && args[1].class == Hash && args[2].class == Proc && true
    return @j_del.java_method(:subscribe, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],(Proc.new { |event| args[2].call(event != nil ? JSON.parse(event.toJson.encode) : nil) unless args[2] == nil }),(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling subscribe(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) unsubscribe(destination) - (self) unsubscribe(destination, receiptHandler) { ... } - (self) unsubscribe(destination, headers) - (self) unsubscribe(destination, headers, receiptHandler) { ... }

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.

Overloads:

  • - (self) unsubscribe(destination)

    Parameters:

    • destination (String)
      the destination
  • - (self) unsubscribe(destination, receiptHandler) { ... }

    Parameters:

    • destination (String)
      the destination

    Yields:

    • the handler invoked when the RECEIPT frame associated with the un-subscription has been received. The handler receives the sent frame (UNSUBSCRIBE).
  • - (self) unsubscribe(destination, headers)

    Parameters:

    • destination (String)
      the destination
    • headers (Hash{String => String})
      the headers
  • - (self) unsubscribe(destination, headers, receiptHandler) { ... }

    Parameters:

    • destination (String)
      the destination
    • headers (Hash{String => String})
      the headers

    Yields:

    • the handler invoked when the RECEIPT frame associated with the un-subscription has been received. The handler receives the sent frame (UNSUBSCRIBE).

Returns:

  • (self)


403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 403

def unsubscribe(*args)
  if args[0].class == String && !block_given? && args[1] == nil
    @j_del.java_method(:unsubscribe, [Java::java.lang.String.java_class]).call(args[0])
    return self
  elsif args[0].class == String && true && args[1] == nil
    @j_del.java_method(:unsubscribe, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  elsif args[0].class == String && args[1].class == Hash && !block_given?
    @j_del.java_method(:unsubscribe, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }])
    return self
  elsif args[0].class == String && args[1].class == Hash && true
    @j_del.java_method(:unsubscribe, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],Hash[args[1].map { |k,v| [k,v] }],(Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling unsubscribe(#{args[0]},#{args[1]})"
  end
end

- (String) version

Returns the STOMP protocol version negotiated with the server.

Returns:

  • (String)
    the STOMP protocol version negotiated with the server.


310
311
312
313
314
315
316
317
318
319
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 310

def version
  if !block_given?
    return @j_del.java_method(:version, []).call()
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling version()"
  end
end

- (self) writingFrameHandler(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 VertxStomp::StompClient, it will be used by all clients connection, so calling this method is useless, except if you want to use a different handler.

Yields:

  • the handler

Returns:

  • (self)


431
432
433
434
435
436
437
438
439
440
441
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 431

def writing_frame_handler
  if true
    @j_del.java_method(:writingFrameHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) unless !block_given? }))
    return self
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling writing_frame_handler()"
  end
end