Class: VertxSql::SQLRowStream
- Inherits:
-
Object
- Object
- VertxSql::SQLRowStream
show all
- Includes:
- Vertx::ReadStream
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb
Overview
A ReadStream of Rows from the underlying RDBMS. This class follows the ReadStream semantics and will automatically
close the underlying resources if all returned rows are returned. For cases where the results are ignored before the
full processing of the returned rows is complete the close method **MUST** be called in order to release underlying
resources.
The interface is minimal in order to support all SQL clients not just JDBC.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary
(collapse)
Instance Method Summary
(collapse)
Class Method Details
+ (Boolean) accept?(obj)
28
29
30
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 28
def @@j_api_type.accept?(obj)
obj.class == SQLRowStream
end
|
+ (Object) j_api_type
37
38
39
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 37
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
40
41
42
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 40
def self.j_class
Java::IoVertxExtSql::SQLRowStream.java_class
end
|
+ (Object) unwrap(obj)
34
35
36
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 34
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
31
32
33
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 31
def @@j_api_type.wrap(obj)
SQLRowStream.new(obj)
end
|
Instance Method Details
- (void) close
- (void) close(handler) { ... }
This method returns an undefined value.
Closes the stream/underlying cursor(s). The actual close happens asynchronously.
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 217
def close
if !block_given?
return @j_del.java_method(:close, []).call()
elsif true
if (block_given?)
return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
else
promise = ::Vertx::Util::Utils.promise
@j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : 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 close()"
end
end
|
- (Fixnum) column(name)
Will convert the column name to the json array index.
89
90
91
92
93
94
95
96
97
98
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 89
def column(*args)
if args[0].class == String && !block_given?
return @j_del.java_method(:column, [Java::java.lang.String.java_class]).call(args[0])
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling column(#{args[0]})"
end
end
|
- (Array<String>) columns
Returns all column names available in the underlying resultset. One needs to carefully use this method since in
contrast to the singular version it does not perform case insensitive lookups or takes alias in consideration on
the column names.
75
76
77
78
79
80
81
82
83
84
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 75
def columns
if !block_given?
return @j_del.java_method(:columns, []).call().to_a.map { |elt| elt }
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling columns()"
end
end
|
- (self) endHandler(endHandler) { ... }
169
170
171
172
173
174
175
176
177
178
179
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 169
def end_handler
if true
@j_del.java_method(:endHandler, [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 end_handler()"
end
end
|
- (self) exceptionHandler(handler) { ... }
238
239
240
241
242
243
244
245
246
247
248
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 238
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
|
- (self) fetch(amount)
Fetch the specified amount
of elements. If the ReadStream
has been paused, reading will
recommence with the specified amount
of items, otherwise the specified amount
will
be added to the current stream demand.
186
187
188
189
190
191
192
193
194
195
196
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 186
def fetch(*args)
if args[0].class == Fixnum && !block_given?
@j_del.java_method(:fetch, [Java::long.java_class]).call(args[0])
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling fetch(#{args[0]})"
end
end
|
- (self) handler(handler) { ... }
59
60
61
62
63
64
65
66
67
68
69
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 59
def handler
if true
@j_del.java_method(:handler, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| yield(event != nil ? JSON.parse(event.encode) : nil) unless !block_given? }))
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling handler()"
end
end
|
- (void) moreResults
This method returns an undefined value.
Request for more results if available
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-sql/sql_row_stream.rb', line 102
def more_results
if !block_given?
return @j_del.java_method(:moreResults, []).call()
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling more_results()"
end
end
|
- (self) pause
129
130
131
132
133
134
135
136
137
138
139
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 129
def pause
if !block_given?
@j_del.java_method(:pause, []).call()
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling pause()"
end
end
|
Pause this stream and return a to transfer the elements of this stream to a destination .
The stream will be resumed when the pipe will be wired to a
WriteStream
.
202
203
204
205
206
207
208
209
210
211
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 202
def pipe
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:pipe, []).call(),::Vertx::Pipe, nil)
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling pipe()"
end
end
|
- (void) pipeTo(dst, handler) { ... }
This method returns an undefined value.
Pipe this
ReadStream
to the
WriteStream
.
Elements emitted by this stream will be written to the write stream until this stream ends or fails.
Once this stream has ended or failed, the write stream will be ended and the handler
will be
called with the result.
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 150
def pipe_to(*args)
if args[0].class.method_defined?(:j_del) && true
if (block_given?)
return @j_del.java_method(:pipeTo, [Java::IoVertxCoreStreams::WriteStream.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise)
else
promise = ::Vertx::Util::Utils.promise
@j_del.java_method(:pipeTo, [Java::IoVertxCoreStreams::WriteStream.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : 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 pipe_to(#{args[0]})"
end
end
|
- (self) resultSetClosedHandler(handler) { ... }
Event handler when a resultset is closed. This is useful to request for more results.
116
117
118
119
120
121
122
123
124
125
126
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 116
def result_set_closed_handler
if true
@j_del.java_method(:resultSetClosedHandler, [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 result_set_closed_handler()"
end
end
|
- (self) resume
45
46
47
48
49
50
51
52
53
54
55
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 45
def resume
if !block_given?
@j_del.java_method(:resume, []).call()
return self
end
if defined?(super)
super
else
raise ArgumentError, "Invalid arguments when calling resume()"
end
end
|