Class List Method List File List

# Class: VertxMysqlPostgresql::PostgreSQLClient

Inherits:
  AsyncSQLClient
  - Object
  - VertxSql::SQLClient
  - AsyncSQLClient
  - VertxMysqlPostgresql::PostgreSQLClient
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb

## Overview

Represents an PostgreSQL client

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (::VertxMysqlPostgresql::AsyncSQLClient) create_non_shared(vertx = nil, config = nil)
  Create a PostgreSQL client which maintains its own pool.
- + (::VertxMysqlPostgresql::AsyncSQLClient) create_shared(vertx = nil, config = nil, poolName = nil)
  Create a PostgreSQL client which shares its pool with any other MySQL clients created with the same pool name.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (void) close { ... }
- - (self) get_connection { ... }

## Class Method Details

### + (`Boolean`) accept?(obj)

Returns:

- (`Boolean`)

    22
    23
    24
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 22

    def @@j_api_type.accept?(obj)
      obj.class == PostgreSQLClient
    end

### + (`::VertxMysqlPostgresql::AsyncSQLClient`) create_non_shared(vertx = nil, config = nil)

Create a PostgreSQL client which maintains its own pool.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the Vert.x instance
- config (`Hash{String => Object}`) (defaults to: `nil`) —
  the configuration

Returns:

- (`::VertxMysqlPostgresql::AsyncSQLClient`) —
  the client

Raises:

- (`ArgumentError`)

    60
    61
    62
    63
    64
    65
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 60

    def self.create_non_shared(vertx=nil,config=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAsyncsql::PostgreSQLClient.java_method(:createNonShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxMysqlPostgresql::AsyncSQLClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_non_shared(#{vertx},#{config})"
    end

### + (`::VertxMysqlPostgresql::AsyncSQLClient`) create_shared(vertx = nil, config = nil, poolName = nil)

Create a PostgreSQL client which shares its pool with any other MySQL clients created with the same pool name.

Parameters:

- vertx (`::Vertx::Vertx`) (defaults to: `nil`) —
  the Vert.x instance
- config (`Hash{String => Object}`) (defaults to: `nil`) —
  the configuration
- poolName (`String`) (defaults to: `nil`) —
  the pool name

Returns:

- (`::VertxMysqlPostgresql::AsyncSQLClient`) —
  the client

Raises:

- (`ArgumentError`)

    71
    72
    73
    74
    75
    76
    77
    78
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 71

    def self.create_shared(vertx=nil,config=nil,poolName=nil)
      if vertx.class.method_defined?(:j_del) && config.class == Hash && !block_given? && poolName == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAsyncsql::PostgreSQLClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config)),::VertxMysqlPostgresql::AsyncSQLClient)
      elsif vertx.class.method_defined?(:j_del) && config.class == Hash && poolName.class == String && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxExtAsyncsql::PostgreSQLClient.java_method(:createShared, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::java.lang.String.java_class]).call(vertx.j_del,::Vertx::Util::Utils.to_json_object(config),poolName),::VertxMysqlPostgresql::AsyncSQLClient)
      end
      raise ArgumentError, "Invalid arguments when calling create_shared(#{vertx},#{config},#{poolName})"
    end

### + (`Object`) j_api_type

    31
    32
    33
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 31

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    34
    35
    36
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 34

    def self.j_class
      Java::IoVertxExtAsyncsql::PostgreSQLClient.java_class
    end

### + (`Object`) unwrap(obj)

    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 28

    def @@j_api_type.unwrap(obj)
      obj.j_del
    end

### + (`Object`) wrap(obj)

    25
    26
    27
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-mysql-postgresql/postgre_sql_client.rb', line 25

    def @@j_api_type.wrap(obj)
      PostgreSQLClient.new(obj)
    end

## Instance Method Details

### - (`void`) close { ... }

This method returns an undefined value.

Yields:

Raises:

- (`ArgumentError`)

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

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      elsif block_given?
        return @j_del.java_method(:close, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`self`) get_connection { ... }

Yields:

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

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

    def get_connection
      if block_given?
        @j_del.java_method(:getConnection, [Java::IoVertxCore::Handler.java_class]).call((Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxSql::SQLConnection) : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling get_connection()"
    end