Class: VertxStomp::StompServerConnection
- Inherits:
-
Object
- Object
- VertxStomp::StompServerConnection
show all
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb
Overview
Class representing a connection between a STOMP client a the server. It keeps a references on the client socket,
so let write to this socket.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
Class Method Details
+ (Boolean) accept?(obj)
22
23
24
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 22
def @@j_api_type.accept?(obj)
obj.class == StompServerConnection
end
|
+ (Object) j_api_type
31
32
33
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 31
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
34
35
36
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 34
def self.j_class
Java::IoVertxExtStomp::StompServerConnection.java_class
end
|
+ (Object) unwrap(obj)
28
29
30
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 28
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
25
26
27
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 25
def @@j_api_type.wrap(obj)
StompServerConnection.new(obj)
end
|
Instance Method Details
- (void) close
This method returns an undefined value.
Closes the connection with the client.
103
104
105
106
107
108
109
110
111
112
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 103
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
|
This method returns an undefined value.
Configures the heartbeat.
139
140
141
142
143
144
145
146
147
148
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 139
def configure_heartbeat(*args)
if args[0].class == Fixnum && args[1].class == Fixnum && true
return @j_del.java_method(:configureHeartbeat, [Java::long.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1],(Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxStomp::StompServerConnection)) unless !block_given? }))
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling configure_heartbeat(#{args[0]},#{args[1]})"
end
end
|
Returns the STOMP server handler dealing with this connection
53
54
55
56
57
58
59
60
61
62
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 53
def handler
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:handler, []).call(),::VertxStomp::StompServerHandler)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling handler()"
end
end
|
- (void) onServerActivity
This method returns an undefined value.
Notifies the connection about server activity (the server has sent a frame). This method is used to handle the
heartbeat.
41
42
43
44
45
46
47
48
49
50
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 41
def on_server_activity
if !block_given?
return @j_del.java_method(:onServerActivity, []).call()
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling on_server_activity()"
end
end
|
- (void) ping
This method returns an undefined value.
Sends a `PING` frame to the client. A `PING` frame is a frame containing only
EOL
.
78
79
80
81
82
83
84
85
86
87
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 78
def ping
if !block_given?
return @j_del.java_method(:ping, []).call()
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling ping()"
end
end
|
Returns the STOMP server serving this connection.
65
66
67
68
69
70
71
72
73
74
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 65
def server
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:server, []).call(),::VertxStomp::StompServer)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling server()"
end
end
|
- (String) session
Returns the STOMP session id computed when the client has established the connection to the server
90
91
92
93
94
95
96
97
98
99
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 90
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) write(frame)
- (self) write(buffer)
Writes the given buffer to the socket. This is a low level API that should be used carefully.
119
120
121
122
123
124
125
126
127
128
129
130
131
132
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-stomp/stomp_server_connection.rb', line 119
def write(*args)
if args[0].class == Hash && !block_given?
@j_del.java_method(:write, [Java::IoVertxExtStomp::Frame.java_class]).call(Java::IoVertxExtStomp::Frame.new(::Vertx::Util::Utils.to_json_object(args[0])))
return self
elsif args[0].class.method_defined?(:j_del) && !block_given?
@j_del.java_method(:write, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(args[0].j_del)
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling write(#{args[0]})"
end
end
|