Class: VertxMqtt::MqttEndpoint
- Inherits:
-
Object
- Object
- VertxMqtt::MqttEndpoint
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb
Overview
Represents an MQTT endpoint for point-to-point communication with the remote MQTT client
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)
-
- (self) accept(sessionPresent = nil)
Sends the CONNACK message to the remote MQTT client with "connection accepted" return code.
-
- (Hash) auth
The Authentication information as provided by the remote MQTT client.
-
- (self) auto_keep_alive(isAutoKeepAlive = nil)
Enable/disable auto keep alive (sending ping response).
-
- (true, false) auto_keep_alive?
The auto keep alive status (sending ping response).
-
- (true, false) clean_session?
True when clean session is requested by the remote MQTT client.
-
- (String) client_identifier
The client identifier as provided by the remote MQTT client.
-
- (void) close
Close the endpoint, so the connection with remote MQTT client.
-
- (self) close_handler { ... }
Set a close handler.
-
- (true, false) connected?
If the connection between remote client and local endpoint is established/open.
-
- (self) disconnect_handler { ... }
Set a disconnect handler on the MQTT endpoint.
-
- (self) exception_handler { ... }
Set an exception handler.
-
- (Fixnum) keep_alive_time_seconds
The keep alive timeout (in seconds) specified by the remote MQTT client.
-
- (Fixnum) last_message_id
The message identifier used for last published message.
-
- (::Vertx::SocketAddress) local_address
The local address for this socket.
-
- (self) ping_handler { ... }
Set the pingreq handler on the MQTT endpoint.
-
- (self) pong
Sends the PINGRESP message to the remote MQTT client.
-
- (String) protocol_name
The protocol name provided by the remote MQTT client.
-
- (Fixnum) protocol_version
The protocol version required by the remote MQTT client.
-
- (self) publish(topic = nil, payload = nil, qosLevel = nil, isDup = nil, isRetain = nil) { ... }
Sends the PUBLISH message to the remote MQTT server.
-
- (self) publish_acknowledge(publishMessageId = nil)
Sends the PUBACK message to the remote MQTT client.
-
- (self) publish_acknowledge_handler { ... }
Set the puback handler on the MQTT endpoint.
-
- (self) publish_auto_ack(isPublishAutoAck = nil)
Enable/disable publishing (in/out) auto acknowledge.
-
- (true, false) publish_auto_ack?
Auto acknowledge status for publishing (in/out).
-
- (self) publish_complete(publishMessageId = nil)
Sends the PUBCOMP message to the remote MQTT client.
-
- (self) publish_completion_handler { ... }
Set the pubcomp handler on the MQTT endpoint.
-
- (self) publish_handler { ... }
Set the publish handler on the MQTT endpoint.
-
- (self) publish_received(publishMessageId = nil)
Sends the PUBREC message to the remote MQTT client.
-
- (self) publish_received_handler { ... }
Set the pubrec handler on the MQTT endpoint.
-
- (self) publish_release(publishMessageId = nil)
Sends the PUBREL message to the remote MQTT client.
-
- (self) publish_release_handler { ... }
Set the pubrel handler on the MQTT endpoint.
-
- (self) reject(returnCode = nil)
Sends the CONNACK message to the remote MQTT client rejecting the connection request with specified return code.
-
- (::Vertx::SocketAddress) remote_address
The remote address for this socket.
-
- (self) set_client_identifier(clientIdentifier = nil)
Set client identifier if not provided by the remote MQTT client (zero-bytes).
-
- (true, false) ssl?
True if this MqttEndpoint is encrypted via SSL/TLS.
-
- (self) subscribe_acknowledge(subscribeMessageId = nil, grantedQoSLevels = nil)
Sends the SUBACK message to the remote MQTT client.
-
- (self) subscribe_handler { ... }
Set a subscribe handler on the MQTT endpoint.
-
- (void) subscription_auto_ack(isSubscriptionAutoAck = nil)
Enable/disable subscription/unsubscription requests auto acknowledge.
-
- (true, false) subscription_auto_ack?
True when auto acknowledge status for subscription/unsubscription requests.
-
- (self) unsubscribe_acknowledge(unsubscribeMessageId = nil)
Sends the UNSUBACK message to the remote MQTT client.
-
- (self) unsubscribe_handler { ... }
Set a unsubscribe handler on the MQTT endpoint.
-
- (Hash) will
The Will information as provided by the remote MQTT client.
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-mqtt/mqtt_endpoint.rb', line 22 def @@j_api_type.accept?(obj) obj.class == MqttEndpoint end |
+ (Object) j_api_type
31 32 33 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.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-mqtt/mqtt_endpoint.rb', line 34 def self.j_class Java::IoVertxMqtt::MqttEndpoint.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-mqtt/mqtt_endpoint.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-mqtt/mqtt_endpoint.rb', line 25 def @@j_api_type.wrap(obj) MqttEndpoint.new(obj) end |
Instance Method Details
- (self) accept(sessionPresent = nil)
Sends the CONNACK message to the remote MQTT client with "connection accepted"
return code. See #reject for refusing connection
343 344 345 346 347 348 349 350 351 352 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 343 def accept(sessionPresent=nil) if !block_given? && sessionPresent == nil @j_del.java_method(:accept, []).call() return self elsif (sessionPresent.class == TrueClass || sessionPresent.class == FalseClass) && !block_given? @j_del.java_method(:accept, [Java::boolean.java_class]).call(sessionPresent) return self end raise ArgumentError, "Invalid arguments when calling accept(#{sessionPresent})" end |
- (Hash) auth
Returns the Authentication information as provided by the remote MQTT client
83 84 85 86 87 88 89 90 91 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 83 def auth if !block_given? if @cached_auth != nil return @cached_auth end return @cached_auth = @j_del.java_method(:auth, []).call() != nil ? JSON.parse(@j_del.java_method(:auth, []).call().toJson.encode) : nil end raise ArgumentError, "Invalid arguments when calling auth()" end |
- (self) auto_keep_alive(isAutoKeepAlive = nil)
Enable/disable auto keep alive (sending ping response)
188 189 190 191 192 193 194 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 188 def auto_keep_alive(isAutoKeepAlive=nil) if (isAutoKeepAlive.class == TrueClass || isAutoKeepAlive.class == FalseClass) && !block_given? @j_del.java_method(:autoKeepAlive, [Java::boolean.java_class]).call(isAutoKeepAlive) return self end raise ArgumentError, "Invalid arguments when calling auto_keep_alive(#{isAutoKeepAlive})" end |
- (true, false) auto_keep_alive?
Returns the auto keep alive status (sending ping response)
196 197 198 199 200 201 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 196 def auto_keep_alive? if !block_given? return @j_del.java_method(:isAutoKeepAlive, []).call() end raise ArgumentError, "Invalid arguments when calling auto_keep_alive?()" end |
- (true, false) clean_session?
Returns true when clean session is requested by the remote MQTT client
123 124 125 126 127 128 129 130 131 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 123 def clean_session? if !block_given? if @cached_is_clean_session != nil return @cached_is_clean_session end return @cached_is_clean_session = @j_del.java_method(:isCleanSession, []).call() end raise ArgumentError, "Invalid arguments when calling clean_session?()" end |
- (String) client_identifier
Returns the client identifier as provided by the remote MQTT client
73 74 75 76 77 78 79 80 81 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 73 def client_identifier if !block_given? if @cached_client_identifier != nil return @cached_client_identifier end return @cached_client_identifier = @j_del.java_method(:clientIdentifier, []).call() end raise ArgumentError, "Invalid arguments when calling client_identifier()" end |
- (void) close
This method returns an undefined value.
Close the endpoint, so the connection with remote MQTT client
39 40 41 42 43 44 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 39 def close if !block_given? return @j_del.java_method(:close, []).call() end raise ArgumentError, "Invalid arguments when calling close()" end |
- (self) close_handler { ... }
Set a close handler. This will be called when the MQTT endpoint is closed
322 323 324 325 326 327 328 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 322 def close_handler if block_given? @j_del.java_method(:closeHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield }) return self end raise ArgumentError, "Invalid arguments when calling close_handler()" end |
- (true, false) connected?
Returns if the connection between remote client and local endpoint is established/open
203 204 205 206 207 208 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 203 def connected? if !block_given? return @j_del.java_method(:isConnected, []).call() end raise ArgumentError, "Invalid arguments when calling connected?()" end |
- (self) disconnect_handler { ... }
Set a disconnect handler on the MQTT endpoint. This handler is called when a DISCONNECT
message is received by the remote MQTT client
223 224 225 226 227 228 229 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 223 def disconnect_handler if block_given? @j_del.java_method(:disconnectHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield }) return self end raise ArgumentError, "Invalid arguments when calling disconnect_handler()" end |
- (self) exception_handler { ... }
Set an exception handler. This will be called when an error at protocol level happens
332 333 334 335 336 337 338 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 332 def exception_handler if block_given? @j_del.java_method(:exceptionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.from_throwable(event)) })) return self end raise ArgumentError, "Invalid arguments when calling exception_handler()" end |
- (Fixnum) keep_alive_time_seconds
Returns the keep alive timeout (in seconds) specified by the remote MQTT client
133 134 135 136 137 138 139 140 141 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 133 def keep_alive_time_seconds if !block_given? if @cached_keep_alive_time_seconds != nil return @cached_keep_alive_time_seconds end return @cached_keep_alive_time_seconds = @j_del.java_method(:keepAliveTimeSeconds, []).call() end raise ArgumentError, "Invalid arguments when calling keep_alive_time_seconds()" end |
- (Fixnum) last_message_id
Returns the message identifier used for last published message
143 144 145 146 147 148 149 150 151 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 143 def if !block_given? if @cached_last_message_id != nil return @cached_last_message_id end return @cached_last_message_id = @j_del.java_method(:lastMessageId, []).call() end raise ArgumentError, "Invalid arguments when calling last_message_id()" end |
- (::Vertx::SocketAddress) local_address
Returns the local address for this socket
56 57 58 59 60 61 62 63 64 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 56 def local_address if !block_given? if @cached_local_address != nil return @cached_local_address end return @cached_local_address = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:localAddress, []).call(),::Vertx::SocketAddress) end raise ArgumentError, "Invalid arguments when calling local_address()" end |
- (self) ping_handler { ... }
Set the pingreq handler on the MQTT endpoint. This handler is called when a PINGREQ
message is received by the remote MQTT client. In any case the endpoint sends the
PINGRESP internally after executing this handler.
312 313 314 315 316 317 318 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 312 def ping_handler if block_given? @j_del.java_method(:pingHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield }) return self end raise ArgumentError, "Invalid arguments when calling ping_handler()" end |
- (self) pong
Sends the PINGRESP message to the remote MQTT client
445 446 447 448 449 450 451 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 445 def pong if !block_given? @j_del.java_method(:pong, []).call() return self end raise ArgumentError, "Invalid arguments when calling pong()" end |
- (String) protocol_name
Returns the protocol name provided by the remote MQTT client
113 114 115 116 117 118 119 120 121 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 113 def protocol_name if !block_given? if @cached_protocol_name != nil return @cached_protocol_name end return @cached_protocol_name = @j_del.java_method(:protocolName, []).call() end raise ArgumentError, "Invalid arguments when calling protocol_name()" end |
- (Fixnum) protocol_version
Returns the protocol version required by the remote MQTT client
103 104 105 106 107 108 109 110 111 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 103 def protocol_version if !block_given? if @cached_protocol_version != nil return @cached_protocol_version end return @cached_protocol_version = @j_del.java_method(:protocolVersion, []).call() end raise ArgumentError, "Invalid arguments when calling protocol_version()" end |
- (self) publish(topic = nil, payload = nil, qosLevel = nil, isDup = nil, isRetain = nil) { ... }
Sends the PUBLISH message to the remote MQTT server
433 434 435 436 437 438 439 440 441 442 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 433 def publish(topic=nil,payload=nil,qosLevel=nil,isDup=nil,isRetain=nil) if topic.class == String && payload.class.method_defined?(:j_del) && qosLevel.class == Symbol && (isDup.class == TrueClass || isDup.class == FalseClass) && (isRetain.class == TrueClass || isRetain.class == FalseClass) && !block_given? @j_del.java_method(:publish, [Java::java.lang.String.java_class,Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoNettyHandlerCodecMqtt::MqttQoS.java_class,Java::boolean.java_class,Java::boolean.java_class]).call(topic,payload.j_del,Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(qosLevel.to_s),isDup,isRetain) return self elsif topic.class == String && payload.class.method_defined?(:j_del) && qosLevel.class == Symbol && (isDup.class == TrueClass || isDup.class == FalseClass) && (isRetain.class == TrueClass || isRetain.class == FalseClass) && block_given? @j_del.java_method(:publish, [Java::java.lang.String.java_class,Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoNettyHandlerCodecMqtt::MqttQoS.java_class,Java::boolean.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call(topic,payload.j_del,Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(qosLevel.to_s),isDup,isRetain,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) })) return self end raise ArgumentError, "Invalid arguments when calling publish(#{topic},#{payload},#{qosLevel},#{isDup},#{isRetain})" end |
- (self) publish_acknowledge(publishMessageId = nil)
Sends the PUBACK message to the remote MQTT client
388 389 390 391 392 393 394 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 388 def publish_acknowledge(publishMessageId=nil) if publishMessageId.class == Fixnum && !block_given? @j_del.java_method(:publishAcknowledge, [Java::int.java_class]).call(publishMessageId) return self end raise ArgumentError, "Invalid arguments when calling publish_acknowledge(#{publishMessageId})" end |
- (self) publish_acknowledge_handler { ... }
Set the puback handler on the MQTT endpoint. This handler is called when a PUBACK
message is received by the remote MQTT client
267 268 269 270 271 272 273 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 267 def publish_acknowledge_handler if block_given? @j_del.java_method(:publishAcknowledgeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) })) return self end raise ArgumentError, "Invalid arguments when calling publish_acknowledge_handler()" end |
- (self) publish_auto_ack(isPublishAutoAck = nil)
Enable/disable publishing (in/out) auto acknowledge
171 172 173 174 175 176 177 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 171 def publish_auto_ack(isPublishAutoAck=nil) if (isPublishAutoAck.class == TrueClass || isPublishAutoAck.class == FalseClass) && !block_given? @j_del.java_method(:publishAutoAck, [Java::boolean.java_class]).call(isPublishAutoAck) return self end raise ArgumentError, "Invalid arguments when calling publish_auto_ack(#{isPublishAutoAck})" end |
- (true, false) publish_auto_ack?
Returns auto acknowledge status for publishing (in/out)
179 180 181 182 183 184 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 179 def publish_auto_ack? if !block_given? return @j_del.java_method(:isPublishAutoAck, []).call() end raise ArgumentError, "Invalid arguments when calling publish_auto_ack?()" end |
- (self) publish_complete(publishMessageId = nil)
Sends the PUBCOMP message to the remote MQTT client
418 419 420 421 422 423 424 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 418 def publish_complete(publishMessageId=nil) if publishMessageId.class == Fixnum && !block_given? @j_del.java_method(:publishComplete, [Java::int.java_class]).call(publishMessageId) return self end raise ArgumentError, "Invalid arguments when calling publish_complete(#{publishMessageId})" end |
- (self) publish_completion_handler { ... }
Set the pubcomp handler on the MQTT endpoint. This handler is called when a PUBCOMP
message is received by the remote MQTT client
300 301 302 303 304 305 306 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 300 def publish_completion_handler if block_given? @j_del.java_method(:publishCompletionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) })) return self end raise ArgumentError, "Invalid arguments when calling publish_completion_handler()" end |
- (self) publish_handler { ... }
Set the publish handler on the MQTT endpoint. This handler is called when a PUBLISH
message is received by the remote MQTT client
256 257 258 259 260 261 262 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 256 def publish_handler if block_given? @j_del.java_method(:publishHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxMqtt::MqttPublishMessage)) })) return self end raise ArgumentError, "Invalid arguments when calling publish_handler()" end |
- (self) publish_received(publishMessageId = nil)
Sends the PUBREC message to the remote MQTT client
398 399 400 401 402 403 404 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 398 def publish_received(publishMessageId=nil) if publishMessageId.class == Fixnum && !block_given? @j_del.java_method(:publishReceived, [Java::int.java_class]).call(publishMessageId) return self end raise ArgumentError, "Invalid arguments when calling publish_received(#{publishMessageId})" end |
- (self) publish_received_handler { ... }
Set the pubrec handler on the MQTT endpoint. This handler is called when a PUBREC
message is received by the remote MQTT client
278 279 280 281 282 283 284 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 278 def publish_received_handler if block_given? @j_del.java_method(:publishReceivedHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) })) return self end raise ArgumentError, "Invalid arguments when calling publish_received_handler()" end |
- (self) publish_release(publishMessageId = nil)
Sends the PUBREL message to the remote MQTT client
408 409 410 411 412 413 414 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 408 def publish_release(publishMessageId=nil) if publishMessageId.class == Fixnum && !block_given? @j_del.java_method(:publishRelease, [Java::int.java_class]).call(publishMessageId) return self end raise ArgumentError, "Invalid arguments when calling publish_release(#{publishMessageId})" end |
- (self) publish_release_handler { ... }
Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL
message is received by the remote MQTT client
289 290 291 292 293 294 295 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 289 def publish_release_handler if block_given? @j_del.java_method(:publishReleaseHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) })) return self end raise ArgumentError, "Invalid arguments when calling publish_release_handler()" end |
- (self) reject(returnCode = nil)
Sends the CONNACK message to the remote MQTT client rejecting the connection
request with specified return code. See #accept for accepting connection
357 358 359 360 361 362 363 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 357 def reject(returnCode=nil) if returnCode.class == Symbol && !block_given? @j_del.java_method(:reject, [Java::IoNettyHandlerCodecMqtt::MqttConnectReturnCode.java_class]).call(Java::IoNettyHandlerCodecMqtt::MqttConnectReturnCode.valueOf(returnCode.to_s)) return self end raise ArgumentError, "Invalid arguments when calling reject(#{returnCode})" end |
- (::Vertx::SocketAddress) remote_address
Returns the remote address for this socket
46 47 48 49 50 51 52 53 54 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 46 def remote_address if !block_given? if @cached_remote_address != nil return @cached_remote_address end return @cached_remote_address = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:remoteAddress, []).call(),::Vertx::SocketAddress) end raise ArgumentError, "Invalid arguments when calling remote_address()" end |
- (self) set_client_identifier(clientIdentifier = nil)
Set client identifier if not provided by the remote MQTT client (zero-bytes)
212 213 214 215 216 217 218 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 212 def set_client_identifier(clientIdentifier=nil) if clientIdentifier.class == String && !block_given? @j_del.java_method(:setClientIdentifier, [Java::java.lang.String.java_class]).call(clientIdentifier) return self end raise ArgumentError, "Invalid arguments when calling set_client_identifier(#{clientIdentifier})" end |
- (true, false) ssl?
Returns true if this VertxMqtt::MqttEndpoint is encrypted via SSL/TLS.
66 67 68 69 70 71 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 66 def ssl? if !block_given? return @j_del.java_method(:isSsl, []).call() end raise ArgumentError, "Invalid arguments when calling ssl?()" end |
- (self) subscribe_acknowledge(subscribeMessageId = nil, grantedQoSLevels = nil)
Sends the SUBACK message to the remote MQTT client
368 369 370 371 372 373 374 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 368 def subscribe_acknowledge(subscribeMessageId=nil,grantedQoSLevels=nil) if subscribeMessageId.class == Fixnum && grantedQoSLevels.class == Array && !block_given? @j_del.java_method(:subscribeAcknowledge, [Java::int.java_class,Java::JavaUtil::List.java_class]).call(subscribeMessageId,grantedQoSLevels.map { |element| Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(element.to_s) }) return self end raise ArgumentError, "Invalid arguments when calling subscribe_acknowledge(#{subscribeMessageId},#{grantedQoSLevels})" end |
- (self) subscribe_handler { ... }
Set a subscribe handler on the MQTT endpoint. This handler is called when a SUBSCRIBE
message is received by the remote MQTT client
234 235 236 237 238 239 240 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 234 def subscribe_handler if block_given? @j_del.java_method(:subscribeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxMqtt::MqttSubscribeMessage)) })) return self end raise ArgumentError, "Invalid arguments when calling subscribe_handler()" end |
- (void) subscription_auto_ack(isSubscriptionAutoAck = nil)
This method returns an undefined value.
Enable/disable subscription/unsubscription requests auto acknowledge
155 156 157 158 159 160 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 155 def subscription_auto_ack(isSubscriptionAutoAck=nil) if (isSubscriptionAutoAck.class == TrueClass || isSubscriptionAutoAck.class == FalseClass) && !block_given? return @j_del.java_method(:subscriptionAutoAck, [Java::boolean.java_class]).call(isSubscriptionAutoAck) end raise ArgumentError, "Invalid arguments when calling subscription_auto_ack(#{isSubscriptionAutoAck})" end |
- (true, false) subscription_auto_ack?
Returns true when auto acknowledge status for subscription/unsubscription requests
162 163 164 165 166 167 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 162 def subscription_auto_ack? if !block_given? return @j_del.java_method(:isSubscriptionAutoAck, []).call() end raise ArgumentError, "Invalid arguments when calling subscription_auto_ack?()" end |
- (self) unsubscribe_acknowledge(unsubscribeMessageId = nil)
Sends the UNSUBACK message to the remote MQTT client
378 379 380 381 382 383 384 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 378 def unsubscribe_acknowledge(unsubscribeMessageId=nil) if unsubscribeMessageId.class == Fixnum && !block_given? @j_del.java_method(:unsubscribeAcknowledge, [Java::int.java_class]).call(unsubscribeMessageId) return self end raise ArgumentError, "Invalid arguments when calling unsubscribe_acknowledge(#{unsubscribeMessageId})" end |
- (self) unsubscribe_handler { ... }
Set a unsubscribe handler on the MQTT endpoint. This handler is called when a UNSUBSCRIBE
message is received by the remote MQTT client
245 246 247 248 249 250 251 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 245 def unsubscribe_handler if block_given? @j_del.java_method(:unsubscribeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxMqtt::MqttUnsubscribeMessage)) })) return self end raise ArgumentError, "Invalid arguments when calling unsubscribe_handler()" end |
- (Hash) will
Returns the Will information as provided by the remote MQTT client
93 94 95 96 97 98 99 100 101 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 93 def will if !block_given? if @cached_will != nil return @cached_will end return @cached_will = @j_del.java_method(:will, []).call() != nil ? JSON.parse(@j_del.java_method(:will, []).call().toJson.encode) : nil end raise ArgumentError, "Invalid arguments when calling will()" end |