Class List Method List File List

# Class: Vertx::HttpServerResponse

Inherits:
  Object
  - Object
  - Vertx::HttpServerResponse
  show all
Includes:
  WriteStream
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb

## Instance Method Summary (collapse)

- - (Object) body_end_handler
- - (Object) bytes_written
- - (Boolean) chunked?
- - (Object) close
- - (Object) close_handler
- - (Boolean) closed?
- - (Object) drain_handler
- - (Object) end(param_1 = nil, param_2 = nil)
- - (Boolean) ended?
- - (Object) exception_handler
- - (Object) get_status_code
- - (Object) get_status_message
- - (Boolean) head_written?
- - (Object) headers
- - (Object) headers_end_handler
- - (HttpServerResponse) initialize(j_del) constructor
  A new instance of HttpServerResponse.
- - (Object) j_del
- - (Object) push(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil)
- - (Object) put_header(name = nil, value = nil)
- - (Object) put_trailer(name = nil, value = nil)
- - (Object) reset(code = nil)
- - (Object) send_file(filename = nil, offset = nil, length = nil)
- - (Object) set_chunked(chunked = nil)
- - (Object) set_status_code(statusCode = nil)
- - (Object) set_status_message(statusMessage = nil)
- - (Object) set_write_queue_max_size(maxSize = nil)
- - (Object) stream_id
- - (Object) trailers
- - (Object) write(param_1 = nil, param_2 = nil)
- - (Object) write_continue
- - (Object) write_custom_frame(param_1 = nil, param_2 = nil, param_3 = nil)
- - (Boolean) write_queue_full?

## Constructor Details

### - (`HttpServerResponse`) initialize(j_del)

Returns a new instance of HttpServerResponse

    30
    31
    32
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 30

    def initialize(j_del)
      @j_del = j_del
    end

## Instance Method Details

### - (`Object`) body_end_handler

Raises:

- (`ArgumentError`)

    317
    318
    319
    320
    321
    322
    323
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 317

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

### - (`Object`) bytes_written

Raises:

- (`ArgumentError`)

    325
    326
    327
    328
    329
    330
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 325

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

### - (`Boolean`) chunked?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    151
    152
    153
    154
    155
    156
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 151

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

### - (`Object`) close

Raises:

- (`ArgumentError`)

    273
    274
    275
    276
    277
    278
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 273

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

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

    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

### - (`Boolean`) closed?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    287
    288
    289
    290
    291
    292
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 287

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

### - (`Object`) drain_handler

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) end(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 230

    def end(param_1=nil,param_2=nil)
      if !block_given? && param_1 == nil && param_2 == nil
        return @j_del.java_method(:end, []).call()
      elsif param_1.class == String && !block_given? && param_2 == nil
        return @j_del.java_method(:end, [Java::java.lang.String.java_class]).call(param_1)
      elsif param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil
        return @j_del.java_method(:end, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(param_1.j_del)
      elsif param_1.class == String && param_2.class == String && !block_given?
        return @j_del.java_method(:end, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2)
      end
      raise ArgumentError, "Invalid arguments when calling end(param_1,param_2)"
    end

### - (`Boolean`) ended?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) exception_handler

Raises:

- (`ArgumentError`)

    48
    49
    50
    51
    52
    53
    54
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 48

    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_status_code

Raises:

- (`ArgumentError`)

    96
    97
    98
    99
    100
    101
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 96

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

### - (`Object`) get_status_message

Raises:

- (`ArgumentError`)

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

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

### - (`Boolean`) head_written?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    294
    295
    296
    297
    298
    299
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 294

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

### - (`Object`) headers

Raises:

- (`ArgumentError`)

    158
    159
    160
    161
    162
    163
    164
    165
    166
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 158

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

### - (`Object`) headers_end_handler

Raises:

- (`ArgumentError`)

    304
    305
    306
    307
    308
    309
    310
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 304

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

### - (`Object`) j_del

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

    def j_del
      @j_del
    end

### - (`Object`) push(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil)

Raises:

- (`ArgumentError`)

    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 368

    def push(param_1=nil,param_2=nil,param_3=nil,param_4=nil)
      if param_1.class == Symbol && param_2.class == String && block_given? && param_3 == nil && param_4 == nil
        @j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1),param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) }))
        return self
      elsif param_1.class == Symbol && param_2.class == String && param_3.class == String && block_given? && param_4 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1),param_2,param_3,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) })),::Vertx::HttpServerResponse)
      elsif param_1.class == Symbol && param_2.class == String && param_3.class.method_defined?(:j_del) && block_given? && param_4 == nil
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::MultiMap.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1),param_2,param_3.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) })),::Vertx::HttpServerResponse)
      elsif param_1.class == Symbol && param_2.class == String && param_3.class == String && param_4.class.method_defined?(:j_del) && block_given?
        @j_del.java_method(:push, [Java::IoVertxCoreHttp::HttpMethod.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::MultiMap.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(param_1),param_2,param_3,param_4.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::Vertx::HttpServerResponse) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling push(param_1,param_2,param_3,param_4)"
    end

### - (`Object`) put_header(name = nil, value = nil)

Raises:

- (`ArgumentError`)

    171
    172
    173
    174
    175
    176
    177
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 171

    def put_header(name=nil,value=nil)
      if name.class == String && value.class == String && !block_given?
        @j_del.java_method(:putHeader, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling put_header(name,value)"
    end

### - (`Object`) put_trailer(name = nil, value = nil)

Raises:

- (`ArgumentError`)

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

    def put_trailer(name=nil,value=nil)
      if name.class == String && value.class == String && !block_given?
        @j_del.java_method(:putTrailer, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(name,value)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling put_trailer(name,value)"
    end

### - (`Object`) reset(code = nil)

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) send_file(filename = nil, offset = nil, length = nil)

Raises:

- (`ArgumentError`)

    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 249

    def send_file(filename=nil,offset=nil,length=nil)
      if filename.class == String && !block_given? && offset == nil && length == nil
        @j_del.java_method(:sendFile, [Java::java.lang.String.java_class]).call(filename)
        return self
      elsif filename.class == String && offset.class == Fixnum && !block_given? && length == nil
        @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::long.java_class]).call(filename,offset)
        return self
      elsif filename.class == String && block_given? && offset == nil && length == nil
        @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(filename,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      elsif filename.class == String && offset.class == Fixnum && length.class == Fixnum && !block_given?
        @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::long.java_class,Java::long.java_class]).call(filename,offset,length)
        return self
      elsif filename.class == String && offset.class == Fixnum && block_given? && length == nil
        @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(filename,offset,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      elsif filename.class == String && offset.class == Fixnum && length.class == Fixnum && block_given?
        @j_del.java_method(:sendFile, [Java::java.lang.String.java_class,Java::long.java_class,Java::long.java_class,Java::IoVertxCore::Handler.java_class]).call(filename,offset,length,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling send_file(filename,offset,length)"
    end

### - (`Object`) set_chunked(chunked = nil)

Raises:

- (`ArgumentError`)

    143
    144
    145
    146
    147
    148
    149
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 143

    def set_chunked(chunked=nil)
      if (chunked.class == TrueClass || chunked.class == FalseClass) && !block_given?
        @j_del.java_method(:setChunked, [Java::boolean.java_class]).call(chunked)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_chunked(chunked)"
    end

### - (`Object`) set_status_code(statusCode = nil)

Raises:

- (`ArgumentError`)

    106
    107
    108
    109
    110
    111
    112
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 106

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

### - (`Object`) set_status_message(statusMessage = nil)

Raises:

- (`ArgumentError`)

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

    def set_status_message(statusMessage=nil)
      if statusMessage.class == String && !block_given?
        @j_del.java_method(:setStatusMessage, [Java::java.lang.String.java_class]).call(statusMessage)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling set_status_message(statusMessage)"
    end

### - (`Object`) set_write_queue_max_size(maxSize = nil)

Raises:

- (`ArgumentError`)

    79
    80
    81
    82
    83
    84
    85
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 79

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

### - (`Object`) stream_id

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) trailers

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) write(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 64

    def write(param_1=nil,param_2=nil)
      if param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil
        @j_del.java_method(:write, [Java::IoVertxCoreBuffer::Buffer.java_class]).call(param_1.j_del)
        return self
      elsif param_1.class == String && !block_given? && param_2 == nil
        @j_del.java_method(:write, [Java::java.lang.String.java_class]).call(param_1)
        return self
      elsif param_1.class == String && param_2.class == String && !block_given?
        @j_del.java_method(:write, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling write(param_1,param_2)"
    end

### - (`Object`) write_continue

Raises:

- (`ArgumentError`)

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

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

### - (`Object`) write_custom_frame(param_1 = nil, param_2 = nil, param_3 = nil)

Raises:

- (`ArgumentError`)

    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/http_server_response.rb', line 403

    def write_custom_frame(param_1=nil,param_2=nil,param_3=nil)
      if param_1.class.method_defined?(:j_del) && !block_given? && param_2 == nil && param_3 == nil
        @j_del.java_method(:writeCustomFrame, [Java::IoVertxCoreHttp::HttpFrame.java_class]).call(param_1.j_del)
        return self
      elsif param_1.class == Fixnum && param_2.class == Fixnum && param_3.class.method_defined?(:j_del) && !block_given?
        @j_del.java_method(:writeCustomFrame, [Java::int.java_class,Java::int.java_class,Java::IoVertxCoreBuffer::Buffer.java_class]).call(param_1,param_2,param_3.j_del)
        return self
      end
      raise ArgumentError, "Invalid arguments when calling write_custom_frame(param_1,param_2,param_3)"
    end

### - (`Boolean`) write_queue_full?

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

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

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