Class: VertxStomp::Acknowledgement
- Inherits:
-
Object
- Object
- VertxStomp::Acknowledgement
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb
Overview
Structure passed to acknowledgement handler called when a
ACK
or NACK
frame is received. The handler
receives an instance of Acknowledgement with the subscription => Object} and the impacted messages. The
list of messages depends on the type of acknowledgment used by the subscription.
Subscriptions using the client
mode receives all messages that were waiting for acknowledgment that were
sent before the acknowledged messages. The list also contains the acknowledged message. This is a cumulative
acknowledgement. Subscriptions using the client-individual
mode receives a singleton list containing only
the acknowledged message.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (Array<Hash{String => Object}>) frames
The list of frames that have been acknowledged / not-acknowledged.
-
- (Hash{String => Object}) subscription
The subscription frame.
Class Method Details
+ (Boolean) accept?(obj)
25 26 27 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb', line 25 def @@j_api_type.accept?(obj) obj.class == Acknowledgement end |
+ (Object) j_api_type
34 35 36 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb', line 34 def self.j_api_type @@j_api_type end |
+ (Object) j_class
37 38 39 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb', line 37 def self.j_class Java::IoVertxExtStomp::Acknowledgement.java_class end |
+ (Object) unwrap(obj)
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb', line 31 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
28 29 30 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb', line 28 def @@j_api_type.wrap(obj) Acknowledgement.new(obj) end |
Instance Method Details
- (Array<Hash{String => Object}>) frames
Returns the list of frames that have been acknowledged / not-acknowledged. The content of the list depends on the type of subscription.
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/acknowledgement.rb', line 42 def frames if !block_given? return @j_del.java_method(:frames, []).call().to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil } end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling frames()" end end |
- (Hash{String => Object}) subscription
Returns the subscription frame
54 55 56 57 58 59 60 61 62 63 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/acknowledgement.rb', line 54 def subscription if !block_given? return @j_del.java_method(:subscription, []).call() != nil ? JSON.parse(@j_del.java_method(:subscription, []).call().toJson.encode) : nil end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling subscription()" end end |