Class List Method List File List

# Class: VertxServiceDiscovery::HttpEndpoint

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

## Overview

for HTTP endpoint (REST api). Consumers receive a HTTP client configured with the host and port of the endpoint.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Hash) create_record(param_1 = nil, param_2 = nil, param_3 = nil, param_4 = nil, param_5 = nil, param_6 = nil)
  Same as #create_record but let you configure whether or not the service is using https.
- + (void) get_client(param_1 = nil, param_2 = nil, param_3 = nil)
  Convenient method that looks for a HTTP endpoint and provides the configured .
- + (void) get_web_client(param_1 = nil, param_2 = nil, param_3 = nil)
  Convenient method that looks for a HTTP endpoint and provides the configured .
- + (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`)

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

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

### + (`Hash`) createRecord(name, host) + (`Hash`) createRecord(name, host, port, root) + (`Hash`) createRecord(name, host, port, root, metadata) + (`Hash`) createRecord(name, ssl, host, port, root, metadata)

Same as #create_record but let you configure whether or not the service is using `https`.

Overloads:

- + (`Hash`) createRecord(name, host)

  Parameters:

  - name (`String`) —
    the name
  - host (`String`) —
    the host
- + (`Hash`) createRecord(name, host, port, root)

  Parameters:

  - name (`String`) —
    the service name
  - host (`String`) —
    the host, must be public
  - port (`Fixnum`) —
    the port
  - root (`String`) —
    the root, if not set "/" is used
- + (`Hash`) createRecord(name, host, port, root, metadata)

  Parameters:

  - name (`String`) —
    the service name
  - host (`String`) —
    the host (IP or DNS name), it must be the _public_ IP / name
  - port (`Fixnum`) —
    the port, it must be the _public_ port
  - root (`String`) —
    the path of the service, "/" if not set
  - metadata (`Hash{String => Object}`) —
    additional metadata
- + (`Hash`) createRecord(name, ssl, host, port, root, metadata)

  Parameters:

  - name (`String`) —
    the service name
  - ssl (`true`, `false`) —
    whether or not the service is using HTTPS
  - host (`String`) —
    the host (IP or DNS name), it must be the _public_ IP / name
  - port (`Fixnum`) —
    the port, it must be the _public_ port
  - root (`String`) —
    the path of the service, "/" if not set
  - metadata (`Hash{String => Object}`) —
    additional metadata

Returns:

- (`Hash`) —
  the created record

Raises:

- (`ArgumentError`)

    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/http_endpoint.rb', line 60

    def self.create_record(param_1=nil,param_2=nil,param_3=nil,param_4=nil,param_5=nil,param_6=nil)
      if param_1.class == String && param_2.class == String && !block_given? && param_3 == nil && param_4 == nil && param_5 == nil && param_6 == nil
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2) != nil ? JSON.parse(Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::java.lang.String.java_class]).call(param_1,param_2).toJson.encode) : nil
      elsif param_1.class == String && param_2.class == String && param_3.class == Fixnum && param_4.class == String && !block_given? && param_5 == nil && param_6 == nil
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3,param_4) != nil ? JSON.parse(Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class]).call(param_1,param_2,param_3,param_4).toJson.encode) : nil
      elsif param_1.class == String && param_2.class == String && param_3.class == Fixnum && param_4.class == String && param_5.class == Hash && !block_given? && param_6 == nil
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(param_1,param_2,param_3,param_4,::Vertx::Util::Utils.to_json_object(param_5)) != nil ? JSON.parse(Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(param_1,param_2,param_3,param_4,::Vertx::Util::Utils.to_json_object(param_5)).toJson.encode) : nil
      elsif param_1.class == String && (param_2.class == TrueClass || param_2.class == FalseClass) && param_3.class == String && param_4.class == Fixnum && param_5.class == String && param_6.class == Hash && !block_given?
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::boolean.java_class,Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(param_1,param_2,param_3,param_4,param_5,::Vertx::Util::Utils.to_json_object(param_6)) != nil ? JSON.parse(Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:createRecord, [Java::java.lang.String.java_class,Java::boolean.java_class,Java::java.lang.String.java_class,Java::int.java_class,Java::java.lang.String.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(param_1,param_2,param_3,param_4,param_5,::Vertx::Util::Utils.to_json_object(param_6)).toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling create_record(#{param_1},#{param_2},#{param_3},#{param_4},#{param_5},#{param_6})"
    end

### + (`void`) getClient(discovery, filter, resultHandler) { ... } + (`void`) getClient(discovery, filter, resultHandler) { ... } + (`void`) getClient(discovery, filter, conf, resultHandler) { ... } + (`void`) getClient(discovery, filter, conf, resultHandler) { ... }

This method returns an undefined value.

Convenient method that looks for a HTTP endpoint and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails. This method accepts a configuration for the HTTP client.

Overloads:

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

  Parameters:

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

  Yields:

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

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Proc`) —
    The filter

  Yields:

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

  Parameters:

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

  Yields:

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

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Proc`) —
    The filter
  - conf (`Hash{String => Object}`) —
    the configuration of the client

  Yields:

  - The result handler

Raises:

- (`ArgumentError`)

    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/http_endpoint.rb', line 94

    def self.get_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::HttpEndpoint.java_method(:getClient, [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,::Vertx::HttpClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && block_given? && param_3 == nil
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:getClient, [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,::Vertx::HttpClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && param_3.class == Hash && block_given?
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:getClient, [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,::Vertx::HttpClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && param_3.class == Hash && block_given?
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:getClient, [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,::Vertx::HttpClient) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_client(#{param_1},#{param_2},#{param_3})"
    end

### + (`void`) getWebClient(discovery, filter, resultHandler) { ... } + (`void`) getWebClient(discovery, filter, resultHandler) { ... } + (`void`) getWebClient(discovery, filter, conf, resultHandler) { ... } + (`void`) getWebClient(discovery, filter, conf, resultHandler) { ... }

This method returns an undefined value.

Convenient method that looks for a HTTP endpoint and provides the configured . The async result is marked as failed is there are no matching services, or if the lookup fails. This method accepts a configuration for the HTTP client.

Overloads:

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

  Parameters:

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

  Yields:

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

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Proc`) —
    The filter

  Yields:

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

  Parameters:

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

  Yields:

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

  Parameters:

  - discovery (`::VertxServiceDiscovery::ServiceDiscovery`) —
    The service discovery instance
  - filter (`Proc`) —
    The filter
  - conf (`Hash{String => Object}`) —
    the configuration of the client

  Yields:

  - The result handler

Raises:

- (`ArgumentError`)

    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/http_endpoint.rb', line 128

    def self.get_web_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::HttpEndpoint.java_method(:getWebClient, [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,::VertxWebClient::WebClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && block_given? && param_3 == nil
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:getWebClient, [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,::VertxWebClient::WebClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && param_3.class == Hash && block_given?
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:getWebClient, [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,::VertxWebClient::WebClient) : nil) }))
      elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && param_3.class == Hash && block_given?
        return Java::IoVertxServicediscoveryTypes::HttpEndpoint.java_method(:getWebClient, [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,::VertxWebClient::WebClient) : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_web_client(#{param_1},#{param_2},#{param_3})"
    end

### + (`Object`) j_api_type

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

    def self.j_api_type
      @@j_api_type
    end

### + (`Object`) j_class

    33
    34
    35
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/http_endpoint.rb', line 33

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

### + (`Object`) TYPE

    144
    145
    146
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/http_endpoint.rb', line 144

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

### + (`Object`) UNKNOWN

Unknown type.

    141
    142
    143
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/http_endpoint.rb', line 141

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

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

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

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

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

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

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