Class: VertxMysqlClient::MySQLConnection
- Inherits:
-
VertxSqlClient::SqlConnection
- Object
- VertxSqlClient::SqlClient
- VertxSqlClient::SqlConnection
- VertxMysqlClient::MySQLConnection
- Defined in:
- /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb
Overview
A connection to MySQL server.
Constant Summary
- @@j_api_type =
Object.new
Class Method Summary (collapse)
- + (Boolean) accept?(obj)
-
+ (void) connect(*args)
Like #connect with options build from connectionUri.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)
Instance Method Summary (collapse)
-
- (self) changeUser(options, handler) { ... }
Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
- - (self) closeHandler(handler) { ... }
-
- (self) debug(handler) { ... }
Send a DEBUG command to dump debug information to the server's stdout.
- - (self) exceptionHandler(handler) { ... }
-
- (self) getInternalStatistics(handler) { ... }
Send a STATISTICS command to get a human readable string of the server internal status.
-
- (self) ping(handler) { ... }
Send a PING command to check if the server is alive.
- - (self) prepare(sql, handler) { ... }
- - (self) prepared_query(*args)
- - (self) query(sql, handler) { ... }
-
- (self) resetConnection(handler) { ... }
Send a RESET_CONNECTION command to reset the session state.
-
- (self) setOption(option, handler) { ... }
Send a SET_OPTION command to set options for the current connection.
-
- (self) specifySchema(schemaName, handler) { ... }
Send a INIT_DB command to change the default schema of the connection.
Methods inherited from VertxSqlClient::SqlConnection
#begin, #close, #prepared_batch, #ssl?
Methods inherited from VertxSqlClient::SqlClient
Class Method Details
+ (Boolean) accept?(obj)
26 27 28 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 26 def @@j_api_type.accept?(obj) obj.class == MySQLConnection end |
+ (void) connect(vertx, connectOptions, handler) { ... } + (void) connect(vertx, connectionUri, handler) { ... }
This method returns an undefined value.
Like #connect with options build fromconnectionUri
.
271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 271 def self.connect(*args) if args[0].class.method_defined?(:j_del) && args[1].class == Hash && true if (block_given?) return Java::IoVertxMysqlclient::MySQLConnection.java_method(:connect, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxMysqlclient::MySQLConnectOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,Java::IoVertxMysqlclient::MySQLConnectOptions.new(::Vertx::Util::Utils.to_json_object(args[1])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMysqlClient::MySQLConnection) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise Java::IoVertxMysqlclient::MySQLConnection.java_method(:connect, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxMysqlclient::MySQLConnectOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,Java::IoVertxMysqlclient::MySQLConnectOptions.new(::Vertx::Util::Utils.to_json_object(args[1])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMysqlClient::MySQLConnection) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxMysqlClient::MySQLConnection.j_api_type) end elsif args[0].class.method_defined?(:j_del) && args[1].class == String && true if (block_given?) return Java::IoVertxMysqlclient::MySQLConnection.java_method(:connect, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,args[1],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMysqlClient::MySQLConnection) : nil) } : promise) else promise = ::Vertx::Util::Utils.promise Java::IoVertxMysqlclient::MySQLConnection.java_method(:connect, [Java::IoVertxCore::Vertx.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0].j_del,args[1],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxMysqlClient::MySQLConnection) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxMysqlClient::MySQLConnection.j_api_type) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling connect(#{args[0]},#{args[1]})" end end |
+ (Object) j_api_type
35 36 37 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 35 def self.j_api_type @@j_api_type end |
+ (Object) j_class
38 39 40 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 38 def self.j_class Java::IoVertxMysqlclient::MySQLConnection.java_class end |
+ (Object) unwrap(obj)
32 33 34 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 32 def @@j_api_type.unwrap(obj) obj.j_del end |
+ (Object) wrap(obj)
29 30 31 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 29 def @@j_api_type.wrap(obj) MySQLConnection.new(obj) end |
Instance Method Details
- (self) changeUser(options, handler) { ... }
Send a CHANGE_USER command to change the user of the current connection, this operation will also reset connection state.
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 131 def change_user(*args) if args[0].class == Hash && true if (block_given?) @j_del.java_method(:changeUser, [Java::IoVertxMysqlclient::MySQLAuthOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxMysqlclient::MySQLAuthOptions.new(::Vertx::Util::Utils.to_json_object(args[0])),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:changeUser, [Java::IoVertxMysqlclient::MySQLAuthOptions.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxMysqlclient::MySQLAuthOptions.new(::Vertx::Util::Utils.to_json_object(args[0])),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 change_user(#{args[0]})" end end |
- (self) closeHandler(handler) { ... }
236 237 238 239 240 241 242 243 244 245 246 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 236 def close_handler if true @j_del.java_method(:closeHandler, [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 close_handler()" end end |
- (self) debug(handler) { ... }
Send a DEBUG command to dump debug information to the server's stdout.
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 109 def debug if true if (block_given?) @j_del.java_method(:debug, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:debug, [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 debug()" end end |
- (self) exceptionHandler(handler) { ... }
250 251 252 253 254 255 256 257 258 259 260 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 250 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) getInternalStatistics(handler) { ... }
Send a STATISTICS command to get a human readable string of the server internal status.
152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 152 def get_internal_statistics if true if (block_given?) @j_del.java_method(:getInternalStatistics, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:getInternalStatistics, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : 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 get_internal_statistics()" end end |
- (self) ping(handler) { ... }
Send a PING command to check if the server is alive.
195 196 197 198 199 200 201 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-mysql-client/my_sql_connection.rb', line 195 def ping if true if (block_given?) @j_del.java_method(:ping, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:ping, [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 ping()" end end |
- (self) prepare(sql, handler) { ... }
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 67 def prepare(*args) if args[0].class == String && true if (block_given?) @j_del.java_method(:prepare, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::PreparedQuery) : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:prepare, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::PreparedQuery) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxSqlClient::PreparedQuery.j_api_type) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling prepare(#{args[0]})" end end |
- (self) preparedQuery(sql, handler) { ... } - (self) preparedQuery(sql, arguments, handler) { ... }
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 303 def prepared_query(*args) if args[0].class == String && true && args[1] == nil if (block_given?) @j_del.java_method(:preparedQuery, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:preparedQuery, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxSqlClient::RowSet.j_api_type) end elsif args[0].class == String && args[1].class.method_defined?(:j_del) && true if (block_given?) @j_del.java_method(:preparedQuery, [Java::java.lang.String.java_class,Java::IoVertxSqlclient::Tuple.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:preparedQuery, [Java::java.lang.String.java_class,Java::IoVertxSqlclient::Tuple.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],args[1].j_del,block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxSqlClient::RowSet.j_api_type) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling prepared_query(#{args[0]},#{args[1]})" end end |
- (self) query(sql, handler) { ... }
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 216 def query(*args) if args[0].class == String && true if (block_given?) @j_del.java_method(:query, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:query, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSqlClient::RowSet,::VertxSqlClient::Row.j_api_type) : nil) } : promise) return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future,::VertxSqlClient::RowSet.j_api_type) end end if defined?(super) super else raise ArgumentError, "Invalid arguments when calling query(#{args[0]})" end end |
- (self) resetConnection(handler) { ... }
Send a RESET_CONNECTION command to reset the session state.
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 88 def reset_connection if true if (block_given?) @j_del.java_method(:resetConnection, [Java::IoVertxCore::Handler.java_class]).call(block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:resetConnection, [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 reset_connection()" end end |
- (self) setOption(option, handler) { ... }
Send a SET_OPTION command to set options for the current connection.
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 46 def set_option(*args) if args[0].class == Symbol && true if (block_given?) @j_del.java_method(:setOption, [Java::IoVertxMysqlclient::MySQLSetOption.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxMysqlclient::MySQLSetOption.valueOf(args[0].to_s),block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:setOption, [Java::IoVertxMysqlclient::MySQLSetOption.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxMysqlclient::MySQLSetOption.valueOf(args[0].to_s),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 set_option(#{args[0]})" end end |
- (self) specifySchema(schemaName, handler) { ... }
Send a INIT_DB command to change the default schema of the connection.
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 |
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-mysql-client/my_sql_connection.rb', line 174 def specify_schema(*args) if args[0].class == String && true if (block_given?) @j_del.java_method(:specifySchema, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? nil : nil) } : promise) return self else promise = ::Vertx::Util::Utils.promise @j_del.java_method(:specifySchema, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],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 specify_schema(#{args[0]})" end end |