Class List Method List File List

# Class: VertxServiceDiscovery::ServiceDiscovery

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

## Class Method Summary (collapse)

- + (Object) create(vertx = nil, options = nil)
- + (Object) release_service_object(discovery = nil, svcObject = nil)

## Instance Method Summary (collapse)

- - (Object) bindings
- - (Object) close
- - (Object) get_record(param_1 = nil, param_2 = nil)
- - (Object) get_records(param_1 = nil, param_2 = nil)
- - (Object) get_reference(record = nil)
- - (Object) get_reference_with_configuration(record = nil, configuration = nil)
- - (ServiceDiscovery) initialize(j_del) constructor
  A new instance of ServiceDiscovery.
- - (Object) j_del
- - (Object) options
- - (Object) publish(record = nil)
- - (Object) register_service_exporter(exporter = nil, configuration = nil)
- - (Object) register_service_importer(importer = nil, configuration = nil)
- - (Boolean) release?(reference = nil)
- - (Object) unpublish(id = nil)
- - (Object) update(record = nil)

## Constructor Details

### - (`ServiceDiscovery`) initialize(j_del)

Returns a new instance of ServiceDiscovery

    42
    43
    44
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 42

    def initialize(j_del)
      @j_del = j_del
    end

## Class Method Details

### + (`Object`) create(vertx = nil, options = nil)

Raises:

- (`ArgumentError`)

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

    def self.create(vertx=nil,options=nil)
      if vertx.class.method_defined?(:j_del) && !block_given? && options == nil
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxServicediscovery::ServiceDiscovery.java_method(:create, [Java::IoVertxCore::Vertx.java_class]).call(vertx.j_del),::VertxServiceDiscovery::ServiceDiscovery)
      elsif vertx.class.method_defined?(:j_del) && options.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(Java::IoVertxServicediscovery::ServiceDiscovery.java_method(:create, [Java::IoVertxCore::Vertx.java_class,Java::IoVertxServicediscovery::ServiceDiscoveryOptions.java_class]).call(vertx.j_del,Java::IoVertxServicediscovery::ServiceDiscoveryOptions.new(::Vertx::Util::Utils.to_json_object(options))),::VertxServiceDiscovery::ServiceDiscovery)
      end
      raise ArgumentError, "Invalid arguments when calling create(vertx,options)"
    end

### + (`Object`) release_service_object(discovery = nil, svcObject = nil)

Raises:

- (`ArgumentError`)

    232
    233
    234
    235
    236
    237
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 232

    def self.release_service_object(discovery=nil,svcObject=nil)
      if discovery.class.method_defined?(:j_del) && (svcObject.class == String  || svcObject.class == Hash || svcObject.class == Array || svcObject.class == NilClass || svcObject.class == TrueClass || svcObject.class == FalseClass || svcObject.class == Fixnum || svcObject.class == Float) && !block_given?
        return Java::IoVertxServicediscovery::ServiceDiscovery.java_method(:releaseServiceObject, [Java::IoVertxServicediscovery::ServiceDiscovery.java_class,Java::java.lang.Object.java_class]).call(discovery.j_del,::Vertx::Util::Utils.to_object(svcObject))
      end
      raise ArgumentError, "Invalid arguments when calling release_service_object(discovery,svcObject)"
    end

## Instance Method Details

### - (`Object`) bindings

Raises:

- (`ArgumentError`)

    214
    215
    216
    217
    218
    219
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 214

    def bindings
      if !block_given?
        return ::Vertx::Util::Utils.to_set(@j_del.java_method(:bindings, []).call()).map! { |elt| ::Vertx::Util::Utils.safe_create(elt,::VertxServiceDiscovery::ServiceReference) }
      end
      raise ArgumentError, "Invalid arguments when calling bindings()"
    end

### - (`Object`) close

Raises:

- (`ArgumentError`)

    120
    121
    122
    123
    124
    125
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 120

    def close
      if !block_given?
        return @j_del.java_method(:close, []).call()
      end
      raise ArgumentError, "Invalid arguments when calling close()"
    end

### - (`Object`) get_record(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 164

    def get_record(param_1=nil,param_2=nil)
      if param_1.class == Hash && block_given? && param_2 == nil
        return @j_del.java_method(:getRecord, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(param_1),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
      elsif param_1.class == Proc && block_given? && param_2 == nil
        return @j_del.java_method(:getRecord, [Java::JavaUtilFunction::Function.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| param_1.call(event != nil ? JSON.parse(event.toJson.encode) : nil) }),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
      elsif param_1.class == Proc && (param_2.class == TrueClass || param_2.class == FalseClass) && block_given?
        return @j_del.java_method(:getRecord, [Java::JavaUtilFunction::Function.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| param_1.call(event != nil ? JSON.parse(event.toJson.encode) : nil) }),param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_record(param_1,param_2)"
    end

### - (`Object`) get_records(param_1 = nil, param_2 = nil)

Raises:

- (`ArgumentError`)

    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 193

    def get_records(param_1=nil,param_2=nil)
      if param_1.class == Hash && block_given? && param_2 == nil
        return @j_del.java_method(:getRecords, [Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(::Vertx::Util::Utils.to_json_object(param_1),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil } : nil) }))
      elsif param_1.class == Proc && block_given? && param_2 == nil
        return @j_del.java_method(:getRecords, [Java::JavaUtilFunction::Function.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| param_1.call(event != nil ? JSON.parse(event.toJson.encode) : nil) }),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil } : nil) }))
      elsif param_1.class == Proc && (param_2.class == TrueClass || param_2.class == FalseClass) && block_given?
        return @j_del.java_method(:getRecords, [Java::JavaUtilFunction::Function.java_class,Java::boolean.java_class,Java::IoVertxCore::Handler.java_class]).call((Proc.new { |event| param_1.call(event != nil ? JSON.parse(event.toJson.encode) : nil) }),param_2,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt != nil ? JSON.parse(elt.toJson.encode) : nil } : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling get_records(param_1,param_2)"
    end

### - (`Object`) get_reference(record = nil)

Raises:

- (`ArgumentError`)

    65
    66
    67
    68
    69
    70
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 65

    def get_reference(record=nil)
      if record.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getReference, [Java::IoVertxServicediscovery::Record.java_class]).call(Java::IoVertxServicediscovery::Record.new(::Vertx::Util::Utils.to_json_object(record))),::VertxServiceDiscovery::ServiceReference)
      end
      raise ArgumentError, "Invalid arguments when calling get_reference(record)"
    end

### - (`Object`) get_reference_with_configuration(record = nil, configuration = nil)

Raises:

- (`ArgumentError`)

    75
    76
    77
    78
    79
    80
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 75

    def get_reference_with_configuration(record=nil,configuration=nil)
      if record.class == Hash && configuration.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:getReferenceWithConfiguration, [Java::IoVertxServicediscovery::Record.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(Java::IoVertxServicediscovery::Record.new(::Vertx::Util::Utils.to_json_object(record)),::Vertx::Util::Utils.to_json_object(configuration)),::VertxServiceDiscovery::ServiceReference)
      end
      raise ArgumentError, "Invalid arguments when calling get_reference_with_configuration(record,configuration)"
    end

### - (`Object`) j_del

    47
    48
    49
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 47

    def j_del
      @j_del
    end

### - (`Object`) options

Raises:

- (`ArgumentError`)

    221
    222
    223
    224
    225
    226
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 221

    def options
      if !block_given?
        return @j_del.java_method(:options, []).call() != nil ? JSON.parse(@j_del.java_method(:options, []).call().toJson.encode) : nil
      end
      raise ArgumentError, "Invalid arguments when calling options()"
    end

### - (`Object`) publish(record = nil)

Raises:

- (`ArgumentError`)

    130
    131
    132
    133
    134
    135
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 130

    def publish(record=nil)
      if record.class == Hash && block_given?
        return @j_del.java_method(:publish, [Java::IoVertxServicediscovery::Record.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxServicediscovery::Record.new(::Vertx::Util::Utils.to_json_object(record)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling publish(record)"
    end

### - (`Object`) register_service_exporter(exporter = nil, configuration = nil)

Raises:

- (`ArgumentError`)

    110
    111
    112
    113
    114
    115
    116
    117
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 110

    def register_service_exporter(exporter=nil,configuration=nil)
      if exporter.class.method_defined?(:j_del) && configuration.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:registerServiceExporter, [Java::IoVertxServicediscoverySpi::ServiceExporter.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(exporter.j_del,::Vertx::Util::Utils.to_json_object(configuration)),::VertxServiceDiscovery::ServiceDiscovery)
      elsif exporter.class.method_defined?(:j_del) && configuration.class == Hash && block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:registerServiceExporter, [Java::IoVertxServicediscoverySpi::ServiceExporter.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(exporter.j_del,::Vertx::Util::Utils.to_json_object(configuration),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })),::VertxServiceDiscovery::ServiceDiscovery)
      end
      raise ArgumentError, "Invalid arguments when calling register_service_exporter(exporter,configuration)"
    end

### - (`Object`) register_service_importer(importer = nil, configuration = nil)

Raises:

- (`ArgumentError`)

    96
    97
    98
    99
    100
    101
    102
    103
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 96

    def register_service_importer(importer=nil,configuration=nil)
      if importer.class.method_defined?(:j_del) && configuration.class == Hash && !block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:registerServiceImporter, [Java::IoVertxServicediscoverySpi::ServiceImporter.java_class,Java::IoVertxCoreJson::JsonObject.java_class]).call(importer.j_del,::Vertx::Util::Utils.to_json_object(configuration)),::VertxServiceDiscovery::ServiceDiscovery)
      elsif importer.class.method_defined?(:j_del) && configuration.class == Hash && block_given?
        return ::Vertx::Util::Utils.safe_create(@j_del.java_method(:registerServiceImporter, [Java::IoVertxServicediscoverySpi::ServiceImporter.java_class,Java::IoVertxCoreJson::JsonObject.java_class,Java::IoVertxCore::Handler.java_class]).call(importer.j_del,::Vertx::Util::Utils.to_json_object(configuration),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) })),::VertxServiceDiscovery::ServiceDiscovery)
      end
      raise ArgumentError, "Invalid arguments when calling register_service_importer(importer,configuration)"
    end

### - (`Boolean`) release?(reference = nil)

Returns:

- (`Boolean`)

Raises:

- (`ArgumentError`)

    84
    85
    86
    87
    88
    89
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 84

    def release?(reference=nil)
      if reference.class.method_defined?(:j_del) && !block_given?
        return @j_del.java_method(:release, [Java::IoVertxServicediscovery::ServiceReference.java_class]).call(reference.j_del)
      end
      raise ArgumentError, "Invalid arguments when calling release?(reference)"
    end

### - (`Object`) unpublish(id = nil)

Raises:

- (`ArgumentError`)

    140
    141
    142
    143
    144
    145
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 140

    def unpublish(id=nil)
      if id.class == String && block_given?
        return @j_del.java_method(:unpublish, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(id,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling unpublish(id)"
    end

### - (`Object`) update(record = nil)

Raises:

- (`ArgumentError`)

    207
    208
    209
    210
    211
    212
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx-service-discovery/service_discovery.rb', line 207

    def update(record=nil)
      if record.class == Hash && block_given?
        return @j_del.java_method(:update, [Java::IoVertxServicediscovery::Record.java_class,Java::IoVertxCore::Handler.java_class]).call(Java::IoVertxServicediscovery::Record.new(::Vertx::Util::Utils.to_json_object(record)),(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result != nil ? JSON.parse(ar.result.toJson.encode) : nil : nil) }))
      end
      raise ArgumentError, "Invalid arguments when calling update(record)"
    end