Class: VertxMqtt::MqttConnAckMessage

Inherits:
Object
  • Object
show all
Defined in:
/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb

Overview

Represents an MQTT CONNACK message

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


17
18
19
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 17

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

+ (::VertxMqtt::MqttConnAckMessage) create(code = nil, isSessionPresent = nil)

Create a concrete instance of a Vert.x connack message

Parameters:

  • code (: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)
    return code from the connection request
  • isSessionPresent (true, false) (defaults to: nil)
    is an old session is present

Returns:

Raises:

  • (ArgumentError)


36
37
38
39
40
41
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 36

def self.create(code=nil,isSessionPresent=nil)
  if code.class == Symbol && (isSessionPresent.class == TrueClass || isSessionPresent.class == FalseClass) && !block_given?
    return ::Vertx::Util::Utils.safe_create(Java::IoVertxMqttMessages::MqttConnAckMessage.java_method(:create, [Java::IoNettyHandlerCodecMqtt::MqttConnectReturnCode.java_class,Java::boolean.java_class]).call(Java::IoNettyHandlerCodecMqtt::MqttConnectReturnCode.valueOf(code.to_s),isSessionPresent),::VertxMqtt::MqttConnAckMessage)
  end
  raise ArgumentError, "Invalid arguments when calling create(#{code},#{isSessionPresent})"
end

+ (Object) j_api_type



26
27
28
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 26

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 29

def self.j_class
  Java::IoVertxMqttMessages::MqttConnAckMessage.java_class
end

+ (Object) unwrap(obj)



23
24
25
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 23

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

+ (Object) wrap(obj)



20
21
22
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 20

def @@j_api_type.wrap(obj)
  MqttConnAckMessage.new(obj)
end

Instance Method Details

- (:CONNECTION_ACCEPTED, ...) code

Return code from the connection request

Returns:

  • (: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)
    return code from the connection request

Raises:

  • (ArgumentError)


43
44
45
46
47
48
49
50
51
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 43

def code
  if !block_given?
    if @cached_code != nil
      return @cached_code
    end
    return @cached_code = @j_del.java_method(:code, []).call().name.intern
  end
  raise ArgumentError, "Invalid arguments when calling code()"
end

- (true, false) session_present?

Returns is an old session is present

Returns:

  • (true, false)
    is an old session is present

Raises:

  • (ArgumentError)


53
54
55
56
57
58
59
60
61
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mqtt/mqtt_conn_ack_message.rb', line 53

def session_present?
  if !block_given?
    if @cached_is_session_present != nil
      return @cached_is_session_present
    end
    return @cached_is_session_present = @j_del.java_method(:isSessionPresent, []).call()
  end
  raise ArgumentError, "Invalid arguments when calling session_present?()"
end