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(*args)
Sends the CONNACK message to the remote MQTT client with "connection accepted" return code.
-
- (Hash{String => Object}) auth
The Authentication information as provided by the remote MQTT client.
-
- (self) autoKeepAlive(isAutoKeepAlive)
Enable/disable auto keep alive (sending ping response).
-
- (true, false) isAutoKeepAlive
The auto keep alive status (sending ping response).
-
- (true, false) isCleanSession
True when clean session is requested by the remote MQTT client.
-
- (String) clientIdentifier
The client identifier as provided by the remote MQTT client.
-
- (void) close
Close the endpoint, so the connection with remote MQTT client.
-
- (self) closeHandler(handler) { ... }
Set a close handler.
-
- (true, false) isConnected
If the connection between remote client and local endpoint is established/open.
-
- (self) disconnectHandler(handler) { ... }
Set a disconnect handler on the MQTT endpoint.
-
- (self) exceptionHandler(handler) { ... }
Set an exception handler.
-
- (Fixnum) keepAliveTimeSeconds
The keep alive timeout (in seconds) specified by the remote MQTT client.
-
- (Fixnum) lastMessageId
The message identifier used for last published message.
-
- (::Vertx::SocketAddress) localAddress
The local address for this socket.
-
- (self) pingHandler(handler) { ... }
Set the pingreq handler on the MQTT endpoint.
-
- (self) pong
Sends the PINGRESP message to the remote MQTT client.
-
- (String) protocolName
The protocol name provided by the remote MQTT client.
-
- (Fixnum) protocolVersion
The protocol version required by the remote MQTT client.
-
- (self) publish(*args)
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId.
-
- (self) publishAcknowledge(publishMessageId)
Sends the PUBACK message to the remote MQTT client.
-
- (self) publishAcknowledgeHandler(handler) { ... }
Set the puback handler on the MQTT endpoint.
-
- (self) publishAutoAck(isPublishAutoAck)
Enable/disable publishing (in/out) auto acknowledge.
-
- (true, false) isPublishAutoAck
Auto acknowledge status for publishing (in/out).
-
- (self) publishComplete(publishMessageId)
Sends the PUBCOMP message to the remote MQTT client.
-
- (self) publishCompletionHandler(handler) { ... }
Set the pubcomp handler on the MQTT endpoint.
-
- (self) publishHandler(handler) { ... }
Set the publish handler on the MQTT endpoint.
-
- (self) publishReceived(publishMessageId)
Sends the PUBREC message to the remote MQTT client.
-
- (self) publishReceivedHandler(handler) { ... }
Set the pubrec handler on the MQTT endpoint.
-
- (self) publishRelease(publishMessageId)
Sends the PUBREL message to the remote MQTT client.
-
- (self) publishReleaseHandler(handler) { ... }
Set the pubrel handler on the MQTT endpoint.
-
- (self) reject(returnCode)
Sends the CONNACK message to the remote MQTT client rejecting the connection request with specified return code.
-
- (::Vertx::SocketAddress) remoteAddress
The remote address for this socket.
-
- (self) setClientIdentifier(clientIdentifier)
Set client identifier if not provided by the remote MQTT client (zero-bytes).
-
- (true, false) isSsl
True if this MqttEndpoint is encrypted via SSL/TLS.
-
- (self) subscribeAcknowledge(subscribeMessageId, grantedQoSLevels)
Sends the SUBACK message to the remote MQTT client.
-
- (self) subscribeHandler(handler) { ... }
Set a subscribe handler on the MQTT endpoint.
-
- (void) subscriptionAutoAck(isSubscriptionAutoAck)
Enable/disable subscription/unsubscription requests auto acknowledge.
-
- (true, false) isSubscriptionAutoAck
True when auto acknowledge status for subscription/unsubscription requests.
-
- (self) unsubscribeAcknowledge(unsubscribeMessageId)
Sends the UNSUBACK message to the remote MQTT client.
-
- (self) unsubscribeHandler(handler) { ... }
Set a unsubscribe handler on the MQTT endpoint.
-
- (Hash{String => Object}) will
The Will information as provided by the remote MQTT client.
Class Method Details
+ (Boolean) accept?(obj)
24 25 26 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 24 def @@j_api_type.accept?(obj) obj.class == MqttEndpoint end |
+ (Object) j_api_type
33 34 35 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 33 def self.j_api_type @@j_api_type end |
+ (Object) j_class
36 37 38 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 36 def self.j_class Java::IoVertxMqtt::MqttEndpoint.java_class end |
+ (Object) unwrap(obj)
30 31 32 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 30 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
27 28 29 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 27 def @@j_api_type.wrap(obj) MqttEndpoint.new(obj) end |
Instance Method Details
- (self) accept - (self) accept(sessionPresent)
Sends the CONNACK message to the remote MQTT client with "connection accepted"
return code. See #reject for refusing connection
490 491 492 493 494 495 496 497 498 499 500 501 502 503 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 490 def accept(*args) if !block_given? && args[0] == nil @j_del.java_method(:accept, []).call() return self elsif (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given? @j_del.java_method(:accept, [Java::boolean.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling accept(#{args[0]})" end end |
- (Hash{String => Object}) auth
Returns the Authentication information as provided by the remote MQTT client
71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 71 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling auth()" end end |
- (self) autoKeepAlive(isAutoKeepAlive)
Enable/disable auto keep alive (sending ping response)
523 524 525 526 527 528 529 530 531 532 533 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 523 def auto_keep_alive(*args) if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given? @j_del.java_method(:autoKeepAlive, [Java::boolean.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling auto_keep_alive(#{args[0]})" end end |
- (true, false) isAutoKeepAlive
Returns the auto keep alive status (sending ping response)
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-mqtt/mqtt_endpoint.rb', line 355 def auto_keep_alive? if !block_given? return @j_del.java_method(:isAutoKeepAlive, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling auto_keep_alive?()" end end |
- (true, false) isCleanSession
Returns true when clean session is requested by the remote MQTT client
456 457 458 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-mqtt/mqtt_endpoint.rb', line 456 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling clean_session?()" end end |
- (String) clientIdentifier
Returns the client identifier as provided by the remote MQTT client
413 414 415 416 417 418 419 420 421 422 423 424 425 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 413 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling client_identifier()" end end |
- (void) close
This method returns an undefined value.
Close the endpoint, so the connection with remote MQTT client
297 298 299 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 297 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) { ... }
Set a close handler. This will be called when the MQTT endpoint is closed
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-mqtt/mqtt_endpoint.rb', line 473 def close_handler if true @j_del.java_method(:closeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling close_handler()" end end |
- (true, false) isConnected
Returns if the connection between remote client and local endpoint is established/open
102 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 102 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) disconnectHandler(handler) { ... }
Set a disconnect handler on the MQTT endpoint. This handler is called when a DISCONNECT
message is received by the remote MQTT client
385 386 387 388 389 390 391 392 393 394 395 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 385 def disconnect_handler if true @j_del.java_method(:disconnectHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling disconnect_handler()" end end |
- (self) exceptionHandler(handler) { ... }
Set an exception handler. This will be called when an error at protocol level happens
657 658 659 660 661 662 663 664 665 666 667 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 657 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 |
- (Fixnum) keepAliveTimeSeconds
Returns the keep alive timeout (in seconds) specified by the remote MQTT client
266 267 268 269 270 271 272 273 274 275 276 277 278 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 266 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling keep_alive_time_seconds()" end end |
- (Fixnum) lastMessageId
Returns the message identifier used for last published message
640 641 642 643 644 645 646 647 648 649 650 651 652 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 640 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling last_message_id()" end end |
- (::Vertx::SocketAddress) localAddress
Returns the local address for this socket
536 537 538 539 540 541 542 543 544 545 546 547 548 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 536 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling local_address()" end end |
- (self) pingHandler(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.
130 131 132 133 134 135 136 137 138 139 140 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 130 def ping_handler if true @j_del.java_method(:pingHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(nil) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling ping_handler()" end end |
- (self) pong
Sends the PINGRESP message to the remote MQTT client
190 191 192 193 194 195 196 197 198 199 200 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 190 def pong if !block_given? @j_del.java_method(:pong, []).call() return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling pong()" end end |
- (String) protocolName
Returns the protocol name provided by the remote MQTT client
235 236 237 238 239 240 241 242 243 244 245 246 247 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 235 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling protocol_name()" end end |
- (Fixnum) protocolVersion
Returns the protocol version required by the remote MQTT client
281 282 283 284 285 286 287 288 289 290 291 292 293 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 281 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling protocol_version()" end end |
- (self) publish(topic, payload, qosLevel, isDup, isRetain, publishSentHandler) { ... } - (self) publish(topic, payload, qosLevel, isDup, isRetain, messageId, publishSentHandler) { ... }
Sends the PUBLISH message to the remote MQTT server explicitly specifying the messageId
566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 566 def publish(*args) if args[0].class == String && args[1].class.method_defined?(:j_del) && args[2].class == Symbol && (args[3].class == TrueClass || args[3].class == FalseClass) && (args[4].class == TrueClass || args[4].class == FalseClass) && true && args[5] == nil if (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(args[0],args[1].j_del,Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(args[2].to_s),args[3],args[4],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(: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(args[0],args[1].j_del,Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(args[2].to_s),args[3],args[4],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.method_defined?(:j_del) && args[2].class == Symbol && (args[3].class == TrueClass || args[3].class == FalseClass) && (args[4].class == TrueClass || args[4].class == FalseClass) && args[5].class == Fixnum && true if (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::int.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].j_del,Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(args[2].to_s),args[3],args[4],args[5],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(: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::int.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].j_del,Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(args[2].to_s),args[3],args[4],args[5],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 publish(#{args[0]},#{args[1]},#{args[2]},#{args[3]},#{args[4]},#{args[5]})" end end |
- (self) publishAcknowledge(publishMessageId)
Sends the PUBACK message to the remote MQTT client
596 597 598 599 600 601 602 603 604 605 606 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 596 def publish_acknowledge(*args) if args[0].class == Fixnum && !block_given? @j_del.java_method(:publishAcknowledge, [Java::int.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_acknowledge(#{args[0]})" end end |
- (self) publishAcknowledgeHandler(handler) { ... }
Set the puback handler on the MQTT endpoint. This handler is called when a PUBACK
message is received by the remote MQTT client
206 207 208 209 210 211 212 213 214 215 216 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 206 def publish_acknowledge_handler if true @j_del.java_method(:publishAcknowledgeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_acknowledge_handler()" end end |
- (self) publishAutoAck(isPublishAutoAck)
Enable/disable publishing (in/out) auto acknowledge
627 628 629 630 631 632 633 634 635 636 637 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 627 def publish_auto_ack(*args) if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given? @j_del.java_method(:publishAutoAck, [Java::boolean.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_auto_ack(#{args[0]})" end end |
- (true, false) isPublishAutoAck
Returns auto acknowledge status for publishing (in/out)
114 115 116 117 118 119 120 121 122 123 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 114 def publish_auto_ack? if !block_given? return @j_del.java_method(:isPublishAutoAck, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_auto_ack?()" end end |
- (self) publishComplete(publishMessageId)
Sends the PUBCOMP message to the remote MQTT client
58 59 60 61 62 63 64 65 66 67 68 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 58 def publish_complete(*args) if args[0].class == Fixnum && !block_given? @j_del.java_method(:publishComplete, [Java::int.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_complete(#{args[0]})" end end |
- (self) publishCompletionHandler(handler) { ... }
Set the pubcomp handler on the MQTT endpoint. This handler is called when a PUBCOMP
message is received by the remote MQTT client
89 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-mqtt/mqtt_endpoint.rb', line 89 def publish_completion_handler if true @j_del.java_method(:publishCompletionHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_completion_handler()" end end |
- (self) publishHandler(handler) { ... }
Set the publish handler on the MQTT endpoint. This handler is called when a PUBLISH
message is received by the remote MQTT client
612 613 614 615 616 617 618 619 620 621 622 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 612 def publish_handler if true @j_del.java_method(:publishHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxMqtt::MqttPublishMessage)) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_handler()" end end |
- (self) publishReceived(publishMessageId)
Sends the PUBREC message to the remote MQTT client
369 370 371 372 373 374 375 376 377 378 379 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 369 def publish_received(*args) if args[0].class == Fixnum && !block_given? @j_del.java_method(:publishReceived, [Java::int.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_received(#{args[0]})" end end |
- (self) publishReceivedHandler(handler) { ... }
Set the pubrec handler on the MQTT endpoint. This handler is called when a PUBREC
message is received by the remote MQTT client
146 147 148 149 150 151 152 153 154 155 156 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 146 def publish_received_handler if true @j_del.java_method(:publishReceivedHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_received_handler()" end end |
- (self) publishRelease(publishMessageId)
Sends the PUBREL message to the remote MQTT client
43 44 45 46 47 48 49 50 51 52 53 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 43 def publish_release(*args) if args[0].class == Fixnum && !block_given? @j_del.java_method(:publishRelease, [Java::int.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_release(#{args[0]})" end end |
- (self) publishReleaseHandler(handler) { ... }
Set the pubrel handler on the MQTT endpoint. This handler is called when a PUBREL
message is received by the remote MQTT client
342 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 342 def publish_release_handler if true @j_del.java_method(:publishReleaseHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling publish_release_handler()" end end |
- (self) reject(returnCode)
Sends the CONNACK message to the remote MQTT client rejecting the connection
request with specified return code. See #accept for accepting connection
253 254 255 256 257 258 259 260 261 262 263 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 253 def reject(*args) if args[0].class == Symbol && !block_given? @j_del.java_method(:reject, [Java::IoNettyHandlerCodecMqtt::MqttConnectReturnCode.java_class]).call(Java::IoNettyHandlerCodecMqtt::MqttConnectReturnCode.valueOf(args[0].to_s)) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling reject(#{args[0]})" end end |
- (::Vertx::SocketAddress) remoteAddress
Returns the remote address for this socket
324 325 326 327 328 329 330 331 332 333 334 335 336 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 324 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling remote_address()" end end |
- (self) setClientIdentifier(clientIdentifier)
Set client identifier if not provided by the remote MQTT client (zero-bytes)
311 312 313 314 315 316 317 318 319 320 321 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 311 def set_client_identifier(*args) if args[0].class == String && !block_given? @j_del.java_method(:setClientIdentifier, [Java::java.lang.String.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling set_client_identifier(#{args[0]})" end end |
- (true, false) isSsl
Returns true if this VertxMqtt::MqttEndpoint is encrypted via SSL/TLS.
670 671 672 673 674 675 676 677 678 679 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 670 def ssl? if !block_given? return @j_del.java_method(:isSsl, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling ssl?()" end end |
- (self) subscribeAcknowledge(subscribeMessageId, grantedQoSLevels)
Sends the SUBACK message to the remote MQTT client
222 223 224 225 226 227 228 229 230 231 232 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 222 def subscribe_acknowledge(*args) if args[0].class == Fixnum && args[1].class == Array && !block_given? @j_del.java_method(:subscribeAcknowledge, [Java::int.java_class,Java::JavaUtil::List.java_class]).call(args[0],args[1].map { |element| Java::IoNettyHandlerCodecMqtt::MqttQoS.valueOf(element.to_s) }) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling subscribe_acknowledge(#{args[0]},#{args[1]})" end end |
- (self) subscribeHandler(handler) { ... }
Set a subscribe handler on the MQTT endpoint. This handler is called when a SUBSCRIBE
message is received by the remote MQTT client
431 432 433 434 435 436 437 438 439 440 441 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 431 def subscribe_handler if true @j_del.java_method(:subscribeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxMqtt::MqttSubscribeMessage)) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling subscribe_handler()" end end |
- (void) subscriptionAutoAck(isSubscriptionAutoAck)
This method returns an undefined value.
Enable/disable subscription/unsubscription requests auto acknowledge
161 162 163 164 165 166 167 168 169 170 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 161 def subscription_auto_ack(*args) if (args[0].class == TrueClass || args[0].class == FalseClass) && !block_given? return @j_del.java_method(:subscriptionAutoAck, [Java::boolean.java_class]).call(args[0]) end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling subscription_auto_ack(#{args[0]})" end end |
- (true, false) isSubscriptionAutoAck
Returns true when auto acknowledge status for subscription/unsubscription requests
444 445 446 447 448 449 450 451 452 453 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 444 def subscription_auto_ack? if !block_given? return @j_del.java_method(:isSubscriptionAutoAck, []).call() end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling subscription_auto_ack?()" end end |
- (self) unsubscribeAcknowledge(unsubscribeMessageId)
Sends the UNSUBACK message to the remote MQTT client
508 509 510 511 512 513 514 515 516 517 518 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 508 def unsubscribe_acknowledge(*args) if args[0].class == Fixnum && !block_given? @j_del.java_method(:unsubscribeAcknowledge, [Java::int.java_class]).call(args[0]) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling unsubscribe_acknowledge(#{args[0]})" end end |
- (self) unsubscribeHandler(handler) { ... }
Set a unsubscribe handler on the MQTT endpoint. This handler is called when a UNSUBSCRIBE
message is received by the remote MQTT client
176 177 178 179 180 181 182 183 184 185 186 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 176 def unsubscribe_handler if true @j_del.java_method(:unsubscribeHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::VertxMqtt::MqttUnsubscribeMessage)) unless !block_given? })) return self end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling unsubscribe_handler()" end end |
- (Hash{String => Object}) will
Returns the Will information as provided by the remote MQTT client
398 399 400 401 402 403 404 405 406 407 408 409 410 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_endpoint.rb', line 398 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 if defined?(super) super else raise ArgumentError, "Invalid arguments when calling will()" end end |