Class: VertxStomp::Frames
- Inherits:
-
Object
- Object
- VertxStomp::Frames
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb
Overview
Utility methods to build common Hashs. It defines a non-STOMP frame (
PING
) that is used for
heartbeats. When such frame is written on the wire it is just the 0
byte.
This class is thread-safe.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
- + (Hash) create_error_frame(message = nil, headers = nil, body = nil)
- + (Hash) create_receipt_frame(receiptId = nil, headers = nil)
- + (void) handle_receipt(frame = nil, connection = nil)
- + (Object) j_api_type
- + (Object) j_class
- + (Hash) ping
- + (Object) PING
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Class Method Details
+ (Boolean) accept?(obj)
21 22 23 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb', line 21 def @@j_api_type.accept?(obj) obj.class == Frames end |
+ (Hash) create_error_frame(message = nil, headers = nil, body = nil)
40 41 42 43 44 45 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb', line 40 def self.create_error_frame(=nil,headers=nil,body=nil) if .class == String && headers.class == Hash && body.class == String && !block_given? return Java::IoVertxExtStomp::Frames.java_method(:createErrorFrame, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::java.lang.String.java_class]).call(,Hash[headers.map { |k,v| [k,v] }],body) != nil ? JSON.parse(Java::IoVertxExtStomp::Frames.java_method(:createErrorFrame, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class,Java::java.lang.String.java_class]).call(,Hash[headers.map { |k,v| [k,v] }],body).toJson.encode) : nil end raise ArgumentError, "Invalid arguments when calling create_error_frame(#{},#{headers},#{body})" end |
+ (Hash) create_receipt_frame(receiptId = nil, headers = nil)
49 50 51 52 53 54 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb', line 49 def self.create_receipt_frame(receiptId=nil,headers=nil) if receiptId.class == String && headers.class == Hash && !block_given? return Java::IoVertxExtStomp::Frames.java_method(:createReceiptFrame, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class]).call(receiptId,Hash[headers.map { |k,v| [k,v] }]) != nil ? JSON.parse(Java::IoVertxExtStomp::Frames.java_method(:createReceiptFrame, [Java::java.lang.String.java_class,Java::JavaUtil::Map.java_class]).call(receiptId,Hash[headers.map { |k,v| [k,v] }]).toJson.encode) : nil end raise ArgumentError, "Invalid arguments when calling create_receipt_frame(#{receiptId},#{headers})" end |
+ (void) handle_receipt(frame = nil, connection = nil)
This method returns an undefined value.
58 59 60 61 62 63 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb', line 58 def self.handle_receipt(frame=nil,connection=nil) if frame.class == Hash && connection.class.method_defined?(:j_del) && !block_given? return Java::IoVertxExtStomp::Frames.java_method(:handleReceipt, [Java::IoVertxExtStomp::Frame.java_class,Java::IoVertxExtStomp::StompServerConnection.java_class]).call(Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(frame)),connection.j_del) end raise ArgumentError, "Invalid arguments when calling handle_receipt(#{frame},#{connection})" 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/frames.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/frames.rb', line 33 def self.j_class Java::IoVertxExtStomp::Frames.java_class end |
+ (Hash) ping
65 66 67 68 69 70 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb', line 65 def self.ping if !block_given? return Java::IoVertxExtStomp::Frames.java_method(:ping, []).call() != nil ? JSON.parse(Java::IoVertxExtStomp::Frames.java_method(:ping, []).call().toJson.encode) : nil end raise ArgumentError, "Invalid arguments when calling ping()" end |
+ (Object) PING
71 72 73 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.rb', line 71 def self.PING Java::IoVertxExtStomp::Frames.PING != nil ? JSON.parse(Java::IoVertxExtStomp::Frames.PING.toJson.encode) : nil end |
+ (Object) unwrap(obj)
27 28 29 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/frames.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/frames.rb', line 24 def @@j_api_type.wrap(obj) Frames.new(obj) end |