Class List Method List File List

# Class: VertxMqttServer::MqttEndpoint

Inherits:
  Object
  - Object
  - VertxMqttServer::MqttEndpoint
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/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.
- - (::VertxMqttServer::MqttAuth) 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.
- - (self) disconnect_handler { ... }
  Set a disconnect handler on the MQTT endpoint.
- - (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.
- - (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 client.
- - (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_complete_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.
- - (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.
- - (::VertxMqttServer::MqttWill) will
  The Will information as provided by the remote MQTT client.

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    23
    24
    25
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 23

    def @@j_api_type.accept?(obj)
      obj.class == MqttEndpoint
    end

### + (`Object`) j_api_type

    32
    33
    34
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 32

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    35
    36
    37
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 35

    def self.j_class
      Java::IoVertxMqtt::MqttEndpoint.java_class
    end

### + (`Object`) unwrap(obj)

    29
    30
    31
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 29

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    26
    27
    28
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 26

    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

Parameters:

- sessionPresent (`true`, `false`) (defaults to: `nil`) —
  if a previous session is present

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    290
    291
    292
    293
    294
    295
    296
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 290

    def accept(sessionPresent=nil)
      if (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

### - (`::VertxMqttServer::MqttAuth`) auth

Returns the Authentication information as provided by the remote MQTT client

Returns:

- (`::VertxMqttServer::MqttAuth`) —
  the Authentication information as provided by the remote MQTT client

Raises:

- (`ArgumentError`)

    57
    58
    59
    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 57

    def auth
      if !block_given?
        if @cached_auth != nil
          return @cached_auth
        end
        return @cached_auth = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:auth, []).call(),::VertxMqttServer::MqttAuth)
      end
      raise ArgumentError, "Invalid arguments when calling auth()"
    end

### - (`self`) auto_keep_alive(isAutoKeepAlive = nil)

Enable/disable auto keep alive (sending ping response)

Parameters:

- isAutoKeepAlive (`true`, `false`) (defaults to: `nil`) —
  auto keep alive

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    162
    163
    164
    165
    166
    167
    168
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 162

    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)

Returns:

- (`true`, `false`) —
  the auto keep alive status (sending ping response)

Raises:

- (`ArgumentError`)

    170
    171
    172
    173
    174
    175
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 170

    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

Returns:

- (`true`, `false`) —
  true when clean session is requested by the remote MQTT client

Raises:

- (`ArgumentError`)

    97
    98
    99
    100
    101
    102
    103
    104
    105
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 97

    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

Returns:

- (`String`) —
  the client identifier as provided by the remote MQTT client

Raises:

- (`ArgumentError`)

    47
    48
    49
    50
    51
    52
    53
    54
    55
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 47

    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

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 40

    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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    279
    280
    281
    282
    283
    284
    285
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 279

    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

### - (`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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    180
    181
    182
    183
    184
    185
    186
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 180

    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

### - (`Fixnum`) keep_alive_time_seconds

Returns the keep alive timeout (in seconds) specified by the remote MQTT client

Returns:

- (`Fixnum`) —
  the keep alive timeout (in seconds) specified by the remote MQTT client

Raises:

- (`ArgumentError`)

    107
    108
    109
    110
    111
    112
    113
    114
    115
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 107

    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

Returns:

- (`Fixnum`) —
  the message identifier used for last published message

Raises:

- (`ArgumentError`)

    117
    118
    119
    120
    121
    122
    123
    124
    125
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 117

    def last_message_id
      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

### - (`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.

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    269
    270
    271
    272
    273
    274
    275
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 269

    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

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    385
    386
    387
    388
    389
    390
    391
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 385

    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

Returns:

- (`String`) —
  the protocol name provided by the remote MQTT client

Raises:

- (`ArgumentError`)

    87
    88
    89
    90
    91
    92
    93
    94
    95
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 87

    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

Returns:

- (`Fixnum`) —
  the protocol version required by the remote MQTT client

Raises:

- (`ArgumentError`)

    77
    78
    79
    80
    81
    82
    83
    84
    85
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 77

    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 client

Parameters:

- topic (`String`) (defaults to: `nil`) —
  topic on which the message is published
- payload (`::Vertx::Buffer`) (defaults to: `nil`) —
  message payload
- qosLevel (`:AT_MOST_ONCE`, `:AT_LEAST_ONCE`, `:EXACTLY_ONCE`, `:FAILURE`) (defaults to: `nil`) —
  quality of service level
- isDup (`true`, `false`) (defaults to: `nil`) —
  if the message is a duplicate
- isRetain (`true`, `false`) (defaults to: `nil`) —
  if the message needs to be retained

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    376
    377
    378
    379
    380
    381
    382
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 376

    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
      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

Parameters:

- publishMessageId (`Fixnum`) (defaults to: `nil`) —
  identifier of the PUBLISH message to acknowledge

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    332
    333
    334
    335
    336
    337
    338
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 332

    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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    224
    225
    226
    227
    228
    229
    230
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 224

    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

Parameters:

- isPublishAutoAck (`true`, `false`) (defaults to: `nil`) —
  auto acknowledge status

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    145
    146
    147
    148
    149
    150
    151
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 145

    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)

Returns:

- (`true`, `false`) —
  auto acknowledge status for publishing (in/out)

Raises:

- (`ArgumentError`)

    153
    154
    155
    156
    157
    158
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 153

    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

Parameters:

- publishMessageId (`Fixnum`) (defaults to: `nil`) —
  identifier of the PUBLISH message to acknowledge

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    362
    363
    364
    365
    366
    367
    368
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 362

    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_complete_handler { ... }

Set the pubcomp handler on the MQTT endpoint. This handler is called when a PUBCOMP message is received by the remote MQTT client

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    257
    258
    259
    260
    261
    262
    263
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 257

    def publish_complete_handler
      if block_given?
        @j_del.java_method(:publishCompleteHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling publish_complete_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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    213
    214
    215
    216
    217
    218
    219
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 213

    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,::VertxMqttServer::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

Parameters:

- publishMessageId (`Fixnum`) (defaults to: `nil`) —
  identifier of the PUBLISH message to acknowledge

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    342
    343
    344
    345
    346
    347
    348
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 342

    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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    235
    236
    237
    238
    239
    240
    241
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 235

    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

Parameters:

- publishMessageId (`Fixnum`) (defaults to: `nil`) —
  identifier of the PUBLISH message to acknowledge

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    352
    353
    354
    355
    356
    357
    358
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 352

    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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    246
    247
    248
    249
    250
    251
    252
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 246

    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

Parameters:

- returnCode (`:CONNECTION_ACCEPTED`, `:CONNECTION_REFUSED_UNACCEPTABLE_PROTOCOL_VERSION`, `:CONNECTION_REFUSED_IDENTIFIER_REJECTED`, `:CONNECTION_REFUSED_SERVER_UNAVAILABLE`, `:CONNECTION_REFUSED_BAD_USER_NAME_OR_PASSWORD`, `:CONNECTION_REFUSED_NOT_AUTHORIZED`) (defaults to: `nil`) —
  the connect return code

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    301
    302
    303
    304
    305
    306
    307
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 301

    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

### - (`self`) subscribe_acknowledge(subscribeMessageId = nil, grantedQoSLevels = nil)

Sends the SUBACK message to the remote MQTT client

Parameters:

- subscribeMessageId (`Fixnum`) (defaults to: `nil`) —
  identifier of the SUBSCRIBE message to acknowledge
- grantedQoSLevels (`Array<:AT_MOST_ONCE,:AT_LEAST_ONCE,:EXACTLY_ONCE,:FAILURE>`) (defaults to: `nil`) —
  granted QoS levels for the requested topics

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    312
    313
    314
    315
    316
    317
    318
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 312

    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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    191
    192
    193
    194
    195
    196
    197
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 191

    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,::VertxMqttServer::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

Parameters:

- isSubscriptionAutoAck (`true`, `false`) (defaults to: `nil`) —
  auto acknowledge status

Raises:

- (`ArgumentError`)

    129
    130
    131
    132
    133
    134
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 129

    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

Returns:

- (`true`, `false`) —
  true when auto acknowledge status for subscription/unsubscription requests

Raises:

- (`ArgumentError`)

    136
    137
    138
    139
    140
    141
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 136

    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

Parameters:

- unsubscribeMessageId (`Fixnum`) (defaults to: `nil`) —
  identifier of the UNSUBSCRIBE message to acknowledge

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    322
    323
    324
    325
    326
    327
    328
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 322

    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

Yields:

- the handler

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    202
    203
    204
    205
    206
    207
    208
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 202

    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,::VertxMqttServer::MqttUnsubscribeMessage)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling unsubscribe_handler()"
    end

### - (`::VertxMqttServer::MqttWill`) will

Returns the Will information as provided by the remote MQTT client

Returns:

- (`::VertxMqttServer::MqttWill`) —
  the Will information as provided by the remote MQTT client

Raises:

- (`ArgumentError`)

    67
    68
    69
    70
    71
    72
    73
    74
    75
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mqtt-server/mqtt_endpoint.rb', line 67

    def will
      if !block_given?
        if @cached_will != nil
          return @cached_will
        end
        return @cached_will = ::Vertx::Util::Utils.safe_create(@j_del.java_method(:will, []).call(),::VertxMqttServer::MqttWill)
      end
      raise ArgumentError, "Invalid arguments when calling will()"
    end