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)
27
28
29
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 27
def @@j_api_type.accept?(obj)
obj.class == SQLRowStream
end
|
+ (Object) j_api_type
36
37
38
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 36
def self.j_api_type
@@j_api_type
end
|
+ (Object) j_class
39
40
41
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 39
def self.j_class
Java::IoVertxExtSql::SQLRowStream.java_class
end
|
+ (Object) unwrap(obj)
33
34
35
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 33
def @@j_api_type.unwrap(obj)
obj.j_del
end
|
+ (Object) wrap(obj)
30
31
32
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 30
def @@j_api_type.wrap(obj)
SQLRowStream.new(obj)
end
|
Instance Method Details
- (void) close { ... }
This method returns an undefined value.
Closes the stream/underlying cursor(s). The actual close happens asynchronously.
162
163
164
165
166
167
168
169
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 162
def close
if !block_given?
return @j_del.java_method(:close, []).call()
elsif true
return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?))
end
raise ArgumentError, "Invalid arguments when calling close()"
end
|
- (Fixnum) column(name = nil)
Will convert the column name to the json array index.
125
126
127
128
129
130
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 125
def column(name=nil)
if name.class == String && !block_given?
return @j_del.java_method(:column, [Java::java.lang.String.java_class]).call(name)
end
raise ArgumentError, "Invalid arguments when calling column(#{name})"
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.
135
136
137
138
139
140
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 135
def columns
if !block_given?
return @j_del.java_method(:columns, []).call().to_a.map { |elt| elt }
end
raise ArgumentError, "Invalid arguments when calling columns()"
end
|
- (self) end_handler { ... }
115
116
117
118
119
120
121
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 115
def end_handler
if true
@j_del.java_method(:endHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? })
return self
end
raise ArgumentError, "Invalid arguments when calling end_handler()"
end
|
- (self) exception_handler { ... }
81
82
83
84
85
86
87
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 81
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
raise ArgumentError, "Invalid arguments when calling exception_handler()"
end
|
- (self) fetch(amount = nil)
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.
47
48
49
50
51
52
53
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 47
def fetch(amount=nil)
if amount.class == Fixnum && !block_given?
@j_del.java_method(:fetch, [Java::long.java_class]).call(amount)
return self
end
raise ArgumentError, "Invalid arguments when calling fetch(#{amount})"
end
|
- (self) handler { ... }
90
91
92
93
94
95
96
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 90
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
raise ArgumentError, "Invalid arguments when calling handler()"
end
|
- (void) more_results
This method returns an undefined value.
Request for more results if available
153
154
155
156
157
158
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 153
def more_results
if !block_given?
return @j_del.java_method(:moreResults, []).call()
end
raise ArgumentError, "Invalid arguments when calling more_results()"
end
|
- (self) pause
98
99
100
101
102
103
104
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 98
def pause
if !block_given?
@j_del.java_method(:pause, []).call()
return self
end
raise ArgumentError, "Invalid arguments when calling pause()"
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.
58
59
60
61
62
63
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 58
def pipe
if !block_given?
return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:pipe, []).call(),::Vertx::Pipe, nil)
end
raise ArgumentError, "Invalid arguments when calling pipe()"
end
|
- (void) pipe_to(dst = nil) { ... }
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.
73
74
75
76
77
78
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 73
def pipe_to(dst=nil)
if dst.class.method_defined?(:j_del) && true
return @j_del.java_method(:pipeTo, [Java::IoVertxCoreStreams::WriteStream.java_class,Java::IoVertxCore::Handler.java_class]).call(dst.j_del,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) } unless !block_given?))
end
raise ArgumentError, "Invalid arguments when calling pipe_to(#{dst})"
end
|
- (self) result_set_closed_handler { ... }
Event handler when a resultset is closed. This is useful to request for more results.
144
145
146
147
148
149
150
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 144
def result_set_closed_handler
if true
@j_del.java_method(:resultSetClosedHandler, [Java::IoVertxCore::Handler.java_class]).call(Proc.new { yield unless !block_given? })
return self
end
raise ArgumentError, "Invalid arguments when calling result_set_closed_handler()"
end
|
- (self) resume
106
107
108
109
110
111
112
|
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-sql/sql_row_stream.rb', line 106
def resume
if !block_given?
@j_del.java_method(:resume, []).call()
return self
end
raise ArgumentError, "Invalid arguments when calling resume()"
end
|