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)


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

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

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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

Instance Method Details

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

Aborts a transaction.

Overloads:

  • - (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, 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)


339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 339

def abort(*args)
  if args[0].class == String && true && args[1] == nil
    if (block_given?)
      @j_del.java_method(:abort, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:abort, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling abort(#{args[0]},#{args[1]})"
  end
end

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


226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 226

def ack(*args)
  if args[0].class == String && true && args[1] == nil
    if (block_given?)
      @j_del.java_method(:ack, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:ack, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == String && true
    if (block_given?)
      @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],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling ack(#{args[0]},#{args[1]})"
  end
end

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

Begins a transaction.

Overloads:

  • - (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, 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)


374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 374

def begin_tx(*args)
  if args[0].class == String && true && args[1] == nil
    if (block_given?)
      @j_del.java_method(:beginTX, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:beginTX, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  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.


549
550
551
552
553
554
555
556
557
558
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 549

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)


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

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

Commits a transaction.

Overloads:

  • - (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, 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)


261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 261

def commit(*args)
  if args[0].class == String && true && args[1] == nil
    if (block_given?)
      @j_del.java_method(:commit, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:commit, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  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


170
171
172
173
174
175
176
177
178
179
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 170

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)


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

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(receiptHandler) { ... } - (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, 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)


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

def disconnect(*args)
  if true && args[0] == nil
    if (block_given?)
      @j_del.java_method(:disconnect, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:disconnect, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == Hash && true
    if (block_given?)
      @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])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling disconnect(#{args[0]})"
  end
end

- (::VertxStomp::StompClientConnection) 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:



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

def error_handler
  if true
    return ::Vertx::Util::Utils.safe_create(@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? })),::VertxStomp::StompClientConnection)
  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)


473
474
475
476
477
478
479
480
481
482
483
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 473

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, receiptHandler) { ... } - (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, 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, 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)


190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 190

def nack(*args)
  if args[0].class == String && true && args[1] == nil
    if (block_given?)
      @j_del.java_method(:nack, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:nack, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == String && true
    if (block_given?)
      @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],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  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)


292
293
294
295
296
297
298
299
300
301
302
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 292

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)


107
108
109
110
111
112
113
114
115
116
117
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 107

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, receiptHandler) { ... } - (self) send(headers, body, receiptHandler) { ... } - (self) send(destination, body, receiptHandler) { ... } - (self) send(destination, headers, body, receiptHandler) { ... }

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

Overloads:

  • - (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, 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
534
535
536
537
538
539
540
541
542
543
544
545
# 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 && true && args[1] == nil && args[2] == nil
    if (block_given?)
      @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])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == Hash && args[1].class.method_defined?(:j_del) && true && args[2] == nil
    if (block_given?)
      @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,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class.method_defined?(:j_del) && true && args[2] == nil
    if (block_given?)
      @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,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == Hash && args[2].class.method_defined?(:j_del) && true
    if (block_given?)
      @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,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  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.


89
90
91
92
93
94
95
96
97
98
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 89

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.


157
158
159
160
161
162
163
164
165
166
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 157

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

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

Subscribes to the given destination.

Overloads:

  • - (self) 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 subscription id.
  • - (self) 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 subscription id.

Returns:

  • (self)


129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 129

def subscribe(*args)
  if args[0].class == String && args[1].class == Proc && true && args[2] == nil
    if (block_given?)
      @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 }),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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 }),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  elsif args[0].class == String && args[1].class == Hash && args[2].class == Proc && true
    if (block_given?)
      @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 }),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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 }),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling subscribe(#{args[0]},#{args[1]},#{args[2]})"
  end
end

- (self) unsubscribe(destination, receiptHandler) { ... } - (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, 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, 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)


410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 410

def unsubscribe(*args)
  if args[0].class == String && true && args[1] == nil
    if (block_given?)
      @j_del.java_method(:unsubscribe, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:unsubscribe, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  elsif args[0].class == String && args[1].class == Hash && true
    if (block_given?)
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @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] }],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::Vertx::Util::data_object_type(Java::IoVertxExtStomp::Frame))
    end
  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.


320
321
322
323
324
325
326
327
328
329
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_client_connection.rb', line 320

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)


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

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