Class List Method List File List

# Class: VertxServiceDiscovery::JDBCDataSource

Inherits:
  Object
  - Object
  - VertxServiceDiscovery::JDBCDataSource
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Hash) create_record(name = nil, location = nil, metadata = nil)
- + (void) get_jdbc_client(param_1 = nil, param_2 = nil, param_3 = nil)
  Convenient method that looks for a JDBC datasource source and provides the configured VertxJdbc::JDBCClient.
- + (Object) j_api_type
- + (Object) j_class
- + (Object) TYPE
- + (Object) UNKNOWN
  Unknown type.
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Class Method Details

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

Returns:

- (`Boolean`)

    18
    19
    20
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 18

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

### + (`Hash`) create_record(name = nil, location = nil, metadata = nil)

Parameters:

- name (`String`) (defaults to: `nil`)
- location (`Hash{String => Object}`) (defaults to: `nil`)
- metadata (`Hash{String => Object}`) (defaults to: `nil`)

Returns:

- (`Hash`)

Raises:

- (`ArgumentError`)

    37
    38
    39
    40
    41
    42
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 37

    def self.create_record(name=nil,location=nil,metadata=nil)
      if name.class == String && location.class == Hash && metadata.class == Hash && !block_given?
        return Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_method(:createRecord, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(name,::Vertx::Util::Utils.to_json_object(location),::Vertx::Util::Utils.to_json_object(metadata)) != nil ? JSON.parse(Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_method(:createRecord, [Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(name,::Vertx::Util::Utils.to_json_object(location),::Vertx::Util::Utils.to_json_object(metadata)).toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling create_record(#{name},#{location},#{metadata})"
    end

### + (`void`) getJDBCClient(discovery, filter, resultHandler) { ... } + (`void`) getJDBCClient(discovery, filter, resultHandler) { ... } + (`void`) getJDBCClient(discovery, filter, consumerConfiguration, resultHandler) { ... } + (`void`) getJDBCClient(discovery, filter, consumerConfiguration, resultHandler) { ... }

This method returns an undefined value.

Convenient method that looks for a JDBC datasource source and provides the configured VertxJdbc::JDBCClient. The async result is marked as failed is there are no matching services, or if the lookup fails.

Overloads:

- + (`void`) getJDBCClient(discovery, filter, resultHandler) { ... }

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Hash{String => Object}`) —
    The filter, optional

  Yields:

  - The result handler
- + (`void`) getJDBCClient(discovery, filter, resultHandler) { ... }

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Proc`) —
    The filter (must not be `null`)

  Yields:

  - The result handler
- + (`void`) getJDBCClient(discovery, filter, consumerConfiguration, resultHandler) { ... }

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Hash{String => Object}`) —
    The filter, optional
  - consumerConfiguration (`Hash{String => Object}`) —
    the consumer configuration

  Yields:

  - the result handler
- + (`void`) getJDBCClient(discovery, filter, consumerConfiguration, resultHandler) { ... }

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Proc`) —
    The filter, must not be `null`
  - consumerConfiguration (`Hash{String => Object}`) —
    the consumer configuration

  Yields:

  - the result handler

Raises:

- (`ArgumentError`)

    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 64

    def self.get_jdbc_client(param_1=nil,param_2=nil,param_3=nil)
      if param_1.class.method_defined?(:j_del) && param_2.class == Hash && block_given? && param_3 == nil
        return Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_method(:getJDBCClient, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,::Vertx::Util::Utils.to_json_object(param_2),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxJdbc::JDBCClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && block_given? && param_3 == nil
        return Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_method(:getJDBCClient, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::JavaUtilFunction::Function.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,(Proc.new { |event| param_2.call(event != nil ? JSON.parse(event.toJson.encode) : nil) }),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxJdbc::JDBCClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && param_3.class == Hash && block_given?
        return Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_method(:getJDBCClient, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,::Vertx::Util::Utils.to_json_object(param_2),::Vertx::Util::Utils.to_json_object(param_3),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxJdbc::JDBCClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && param_3.class == Hash && block_given?
        return Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_method(:getJDBCClient, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::JavaUtilFunction::Function.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,(Proc.new { |event| param_2.call(event != nil ? JSON.parse(event.toJson.encode) : nil) }),::Vertx::Util::Utils.to_json_object(param_3),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.safe_create(ar.result,::VertxJdbc::JDBCClient) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_jdbc_client(#{param_1},#{param_2},#{param_3})"
    end

### + (`Object`) j_api_type

    27
    28
    29
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 27

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 30

    def self.j_class
      Java::IoVertxServicediscoveryTypes::JDBCDataSource.java_class
    end

### + (`Object`) TYPE

    80
    81
    82
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 80

    def self.TYPE
      Java::IoVertxServicediscoveryTypes::JDBCDataSource.TYPE
    end

### + (`Object`) UNKNOWN

Unknown type.

    77
    78
    79
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 77

    def self.UNKNOWN
      Java::IoVertxServicediscoveryTypes::JDBCDataSource.UNKNOWN
    end

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

    24
    25
    26
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 24

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

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

    21
    22
    23
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/jdbc_data_source.rb', line 21

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