Class List Method List File List

# Class: Vertx::HttpConnection

Inherits:
  Object
  - Object
  - Vertx::HttpConnection
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb

## Instance Method Summary (collapse)

- - (Object) close
- - (Object) close_handler
- - (Object) exception_handler
- - (Object) get_window_size
- - (Object) go_away(errorCode = nil, lastStreamId = nil, debugData = nil)
- - (Object) go_away_handler
- - (HttpConnection) initialize(j_del) constructor
  A new instance of HttpConnection.
- - (Object) j_del
- - (Object) ping(data = nil)
- - (Object) ping_handler
- - (Object) remote_settings
- - (Object) remote_settings_handler
- - (Object) set_window_size(windowSize = nil)
- - (Object) settings
- - (Object) shutdown(timeoutMs = nil)
- - (Object) shutdown_handler
- - (Object) update_settings(settings = nil)

## Constructor Details

### - (`HttpConnection`) initialize(j_del)

Returns a new instance of HttpConnection

    16
    17
    18
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 16

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) close

Raises:

- (`ArgumentError`)

    125
    126
    127
    128
    129
    130
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 125

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

### - (`Object`) close_handler

Raises:

- (`ArgumentError`)

    114
    115
    116
    117
    118
    119
    120
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 114

    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

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    203
    204
    205
    206
    207
    208
    209
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 203

    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

### - (`Object`) get_window_size

Raises:

- (`ArgumentError`)

    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 25

    def get_window_size
      if !block_given?
        return @j_del.java_method(:getWindowSize, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling get_window_size()"
    end

### - (`Object`) go_away(errorCode = nil, lastStreamId = nil, debugData = nil)

Raises:

- (`ArgumentError`)

    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 58

    def go_away(errorCode=nil,lastStreamId=nil,debugData=nil)
      if errorCode.class == Fixnum && !block_given? && lastStreamId == nil && debugData == nil
        @j_del.java_method(:goAway, [Java::long.java_class]).call(errorCode)
        return self
      elsif errorCode.class == Fixnum && lastStreamId.class == Fixnum && !block_given? && debugData == nil
        @j_del.java_method(:goAway, [Java::long.java_class,Java::int.java_class]).call(errorCode,lastStreamId)
        return self
      elsif errorCode.class == Fixnum && lastStreamId.class == Fixnum && debugData.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:goAway, [Java::long.java_class,Java::int.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(errorCode,lastStreamId,debugData.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling go_away(errorCode,lastStreamId,debugData)"
    end

### - (`Object`) go_away_handler

Raises:

- (`ArgumentError`)

    76
    77
    78
    79
    80
    81
    82
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 76

    def go_away_handler
      if block_given?
        @j_del.java_method(:goAwayHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling go_away_handler()"
    end

### - (`Object`) j_del

    21
    22
    23
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 21

    def j_del
      @j_del
    end

### - (`Object`) ping(data = nil)

Raises:

- (`ArgumentError`)

    181
    182
    183
    184
    185
    186
    187
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 181

    def ping(data=nil)
      if data.class.method_defined?(:j_del) && block_given?
        @j_del.java_method(:ping, [Java::IoVertxCoreBuffer::Buffer.java_class,Java::IoVertxCore::Handler.java_class]).call(data.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::Buffer) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling ping(data)"
    end

### - (`Object`) ping_handler

Raises:

- (`ArgumentError`)

    193
    194
    195
    196
    197
    198
    199
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 193

    def ping_handler
      if block_given?
        @j_del.java_method(:pingHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(::Vertx::Util::Utils.safe_create(event,::Vertx::Buffer)) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling ping_handler()"
    end

### - (`Object`) remote_settings

Raises:

- (`ArgumentError`)

    157
    158
    159
    160
    161
    162
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 157

    def remote_settings
      if !block_given?
        return @j_del.java_method(:remoteSettings, []).call() != nil ? JSON.parse(@j_del.java_method(:remoteSettings, []).call().toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling remote_settings()"
    end

### - (`Object`) remote_settings_handler

Raises:

- (`ArgumentError`)

    168
    169
    170
    171
    172
    173
    174
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 168

    def remote_settings_handler
      if block_given?
        @j_del.java_method(:remoteSettingsHandler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.toJson.encode) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling remote_settings_handler()"
    end

### - (`Object`) set_window_size(windowSize = nil)

Raises:

- (`ArgumentError`)

    38
    39
    40
    41
    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 38

    def set_window_size(windowSize=nil)
      if windowSize.class == Fixnum && !block_given?
        @j_del.java_method(:setWindowSize, [Java::int.java_class]).call(windowSize)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_window_size(windowSize)"
    end

### - (`Object`) settings

Raises:

- (`ArgumentError`)

    132
    133
    134
    135
    136
    137
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 132

    def settings
      if !block_given?
        return @j_del.java_method(:settings, []).call() != nil ? JSON.parse(@j_del.java_method(:settings, []).call().toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling settings()"
    end

### - (`Object`) shutdown(timeoutMs = nil)

Raises:

- (`ArgumentError`)

    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 101

    def shutdown(timeoutMs=nil)
      if !block_given? && timeoutMs == nil
        @j_del.java_method(:shutdown, []).call()
        return self
      elsif timeoutMs.class == Fixnum && !block_given?
        @j_del.java_method(:shutdown, [Java::long.java_class]).call(timeoutMs)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling shutdown(timeoutMs)"
    end

### - (`Object`) shutdown_handler

Raises:

- (`ArgumentError`)

    88
    89
    90
    91
    92
    93
    94
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 88

    def shutdown_handler
      if block_given?
        @j_del.java_method(:shutdownHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield })
        return self
      end
      raise ArgumentError, "Invalid arguments when calling shutdown_handler()"
    end

### - (`Object`) update_settings(settings = nil)

Raises:

- (`ArgumentError`)

    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_connection.rb', line 146

    def update_settings(settings=nil)
      if settings.class == Hash && !block_given?
        @j_del.java_method(:updateSettings, [Java::IoVertxCoreHttp::Http2Settings.java_class]).call(Java::IoVertxCoreHttp::Http2Settings.new(::Vertx::Util::Utils.to_json_object(settings)))
        return self
      elsif settings.class == Hash && block_given?
        @j_del.java_method(:updateSettings, [Java::IoVertxCoreHttp::Http2Settings.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::Http2Settings.new(::Vertx::Util::Utils.to_json_object(settings)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling update_settings(settings)"
    end