Class List Method List File List

# Class: VertxServiceDiscovery::EventBusService

Inherits:
  Object
  - Object
  - VertxServiceDiscovery::EventBusService
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/event_bus_service.rb

## Overview

for event bus services (service proxies). Consumers receive a service proxy to use the service.

## Class Method Summary (collapse)

- + (Hash) create_record(name = nil, address = nil, itf = nil, metadata = nil)
  Sugar method to creates a record for this type.
- + (void) get_proxy(param_1 = nil, param_2 = nil, param_3 = nil)

## Class Method Details

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

Sugar method to creates a record for this type.

The java interface is added to the metadata in the `service.interface` key.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name of the service.
- address (`String`) (defaults to: `nil`) —
  the event bus address on which the service available
- itf (`String`) (defaults to: `nil`) —
  the Java interface (name)
- metadata (`Hash{String => Object}`) (defaults to: `nil`) —
  the metadata

Returns:

- (`Hash`) —
  the created record

Raises:

- (`ArgumentError`)

    26
    27
    28
    29
    30
    31
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/event_bus_service.rb', line 26

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

### + (`void`) getProxy(discovery, filter, resultHandler) { ... } + (`void`) getProxy(discovery, itf, resultHandler) { ... } + (`void`) getProxy(discovery, serviceInterface, proxyInterface, resultHandler) { ... } + (`void`) getProxy(discovery, filter, proxyClass, resultHandler) { ... }

This method returns an undefined value.

Overloads:

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

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    the service discovery instance
  - filter (`Hash{String => Object}`) —
    the filter to select the service

  Yields:

  - the result handler
- + (`void`) getProxy(discovery, itf, resultHandler) { ... }

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    the service discovery instance
  - itf (`String`) —
    the service interface

  Yields:

  - the result handler
- + (`void`) getProxy(discovery, serviceInterface, proxyInterface, resultHandler) { ... }

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`)
  - serviceInterface (`String`)
  - proxyInterface (`String`)

  Yields:

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

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`)
  - filter (`Hash{String => Object}`)
  - proxyClass (`String`)

  Yields:

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/event_bus_service.rb', line 51

    def self.get_proxy(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::EventBusService.java_method(:getProxy, [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.from_object(ar.result) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == String && block_given? && param_3 == nil
        return Java::IoVertxServicediscoveryTypes::EventBusService.java_method(:getProxy, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == String && param_3.class == String && block_given?
        return Java::IoVertxServicediscoveryTypes::EventBusService.java_method(:getProxy, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,param_2,param_3,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && param_3.class == String && block_given?
        return Java::IoVertxServicediscoveryTypes::EventBusService.java_method(:getProxy, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(param_1.j_del,::Vertx::Util::Utils.to_json_object(param_2),param_3,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ::Vertx::Util::Utils.from_object(ar.result) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_proxy(param_1,param_2,param_3)"
    end