Class: VertxServiceDiscovery::RedisDataSource

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

Overview

Service type for Redis data source.

Constant Summary

@@j_api_type =
Object.new

Class Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


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

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

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

Convenient method to create a record for a Redis data source.

Parameters:

  • name (String) (defaults to: nil)
    the service name
  • location (Hash{String => Object}) (defaults to: nil)
    the location of the service (e.g. url, port...)
  • metadata (Hash{String => Object}) (defaults to: nil)
    additional metadata

Returns:

  • (Hash)
    the created record

Raises:

  • (ArgumentError)


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

def self.create_record(name=nil,location=nil,=nil)
  if name.class == String && location.class == Hash && .class == Hash && !block_given?
    return Java::IoVertxServicediscoveryTypes::RedisDataSource.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()) != nil ? JSON.parse(Java::IoVertxServicediscoveryTypes::RedisDataSource.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()).toJson.encode) : nil
  end
  raise ArgumentError, "Invalid arguments when calling create_record(#{name},#{location},#{})"
end

+ (void) getRedisClient(discovery, filter, resultHandler) { ... } + (void) getRedisClient(discovery, filter, resultHandler) { ... } + (void) getRedisClient(discovery, filter, consumerConfiguration, resultHandler) { ... } + (void) getRedisClient(discovery, filter, consumerConfiguration, resultHandler) { ... }

This method returns an undefined value.

Convenient method that looks for a Redis data source and provides the configured VertxRedis::RedisClient. The async result is marked as failed is there are no matching services, or if the lookup fails.

Overloads:

  • + (void) getRedisClient(discovery, filter, resultHandler) { ... }

    Parameters:

    Yields:

    • The result handler
  • + (void) getRedisClient(discovery, filter, resultHandler) { ... }

    Parameters:

    Yields:

    • The result handler
  • + (void) getRedisClient(discovery, filter, consumerConfiguration, resultHandler) { ... }

    Parameters:

    • discovery (::VertxServiceDiscovery::ServiceDiscovery)
      The service discovery instance
    • filter (Hash{String => Object})
      The filter, optional
    • consumerConfiguration (Hash{String => Object})
      The additional consumer configuration

    Yields:

    • The result handler
  • + (void) getRedisClient(discovery, filter, consumerConfiguration, resultHandler) { ... }

    Parameters:

    • discovery (::VertxServiceDiscovery::ServiceDiscovery)
      The service discovery instance
    • filter (Proc)
      The filter, cannot be null
    • consumerConfiguration (Hash{String => Object})
      The additional consumer configuration

    Yields:

    • The result handler

Raises:

  • (ArgumentError)


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

def self.get_redis_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::RedisDataSource.java_method(:getRedisClient, [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,::VertxRedis::RedisClient) : nil) }))
  elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && block_given? && param_3 == nil
    return Java::IoVertxServicediscoveryTypes::RedisDataSource.java_method(:getRedisClient, [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,::VertxRedis::RedisClient) : nil) }))
  elsif param_1.class.method_defined?(:j_del) && param_2.class == Hash && param_3.class == Hash && block_given?
    return Java::IoVertxServicediscoveryTypes::RedisDataSource.java_method(:getRedisClient, [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,::VertxRedis::RedisClient) : nil) }))
  elsif param_1.class.method_defined?(:j_del) && param_2.class == Proc && param_3.class == Hash && block_given?
    return Java::IoVertxServicediscoveryTypes::RedisDataSource.java_method(:getRedisClient, [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,::VertxRedis::RedisClient) : nil) }))
  end
  raise ArgumentError, "Invalid arguments when calling get_redis_client(#{param_1},#{param_2},#{param_3})"
end

+ (Object) j_api_type



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

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



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

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

+ (Object) TYPE



82
83
84
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx-service-discovery/redis_data_source.rb', line 82

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

+ (Object) UNKNOWN

Unknown type.


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

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

+ (Object) unwrap(obj)



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

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

+ (Object) wrap(obj)



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

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