Class List Method List File List

# Class: Vertx::DnsClient

Inherits:
  Object
  - Object
  - Vertx::DnsClient
  show all
Defined in:
  /Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb

## Overview

Provides a way to asynchronously lookup information from DNS servers.

Please consult the documentation for more information on DNS clients.

## Constant Summary

@@j_api_type =

      Object.new

## Class Method Summary (collapse)

- + (Boolean) accept?(obj)
- + (Object) j_api_type
- + (Object) j_class
- + (Object) unwrap(obj)
- + (Object) wrap(obj)

## Instance Method Summary (collapse)

- - (self) lookup(name = nil)
  Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name.
- - (self) lookup4(name = nil) { ... }
  Try to lookup the A (ipv4) record for the given name.
- - (self) lookup6(name = nil) { ... }
  Try to lookup the AAAA (ipv6) record for the given name.
- - (self) resolve_a(name = nil)
  Try to resolve all A (ipv4) records for the given name.
- - (self) resolve_aaaa(name = nil)
  Try to resolve all AAAA (ipv6) records for the given name.
- - (self) resolve_cname(name = nil) { ... }
  Try to resolve the CNAME record for the given name.
- - (self) resolve_mx(name = nil)
  Try to resolve the MX records for the given name.
- - (self) resolve_ns(name = nil) { ... }
  Try to resolve the NS records for the given name.
- - (self) resolve_ptr(name = nil) { ... }
  Try to resolve the PTR record for the given name.
- - (self) resolve_srv(name = nil) { ... }
  Try to resolve the SRV records for the given name.
- - (self) resolve_txt(name = nil) { ... }
  Try to resolve the TXT records for the given name.
- - (self) reverse_lookup(ipaddress = nil) { ... }
  Try to do a reverse lookup of an IP address.

## 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/dns_client.rb', line 21

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

### + (`Object`) j_api_type

    30
    31
    32
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.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/dns_client.rb', line 33

    def self.j_class
      Java::IoVertxCoreDns::DnsClient.java_class
    end

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

    27
    28
    29
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.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/dns_client.rb', line 24

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

## Instance Method Details

### - (`self`) lookup(name = nil)

Try to lookup the A (ipv4) or AAAA (ipv6) record for the given name. The first found will be used.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    40
    41
    42
    43
    44
    45
    46
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 40

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

### - (`self`) lookup4(name = nil) { ... }

Try to lookup the A (ipv4) record for the given name. The first found will be used.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve

Yields:

- the to notify with the AsyncResult. The handler will get notified with the resolved Inet4Address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    51
    52
    53
    54
    55
    56
    57
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 51

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

### - (`self`) lookup6(name = nil) { ... }

Try to lookup the AAAA (ipv6) record for the given name. The first found will be used.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve

Yields:

- the to notify with the . The handler will get notified with the resolved Inet6Address if a record was found. If non was found it will get notifed with `null`. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    62
    63
    64
    65
    66
    67
    68
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 62

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

### - (`self`) resolve_a(name = nil)

Try to resolve all A (ipv4) records for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    73
    74
    75
    76
    77
    78
    79
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 73

    def resolve_a(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveA, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_a(#{name})"
    end

### - (`self`) resolve_aaaa(name = nil)

Try to resolve all AAAA (ipv6) records for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    84
    85
    86
    87
    88
    89
    90
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 84

    def resolve_aaaa(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveAAAA, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_aaaa(#{name})"
    end

### - (`self`) resolve_cname(name = nil) { ... }

Try to resolve the CNAME record for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve the CNAME for

Yields:

- the to notify with the . The handler will get notified with the resolved String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    95
    96
    97
    98
    99
    100
    101
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 95

    def resolve_cname(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveCNAME, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_cname(#{name})"
    end

### - (`self`) resolve_mx(name = nil)

Try to resolve the MX records for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name for which the MX records should be resolved

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    106
    107
    108
    109
    110
    111
    112
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 106

    def resolve_mx(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveMX, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::Vertx::MxRecord) } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_mx(#{name})"
    end

### - (`self`) resolve_ns(name = nil) { ... }

Try to resolve the NS records for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name for which the NS records should be resolved

Yields:

- the to notify with the . The handler will get notified with a List that contains all resolved Strings. If none was found it will get notified with an empty List. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    139
    140
    141
    142
    143
    144
    145
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 139

    def resolve_ns(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveNS, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_ns(#{name})"
    end

### - (`self`) resolve_ptr(name = nil) { ... }

Try to resolve the PTR record for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name to resolve the PTR for

Yields:

- the to notify with the . The handler will get notified with the resolved String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    128
    129
    130
    131
    132
    133
    134
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 128

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

### - (`self`) resolve_srv(name = nil) { ... }

Try to resolve the SRV records for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name for which the SRV records should be resolved

Yields:

- the to notify with the . The handler will get notified with a List that contains all resolved {::Vertx::SrvRecord}s. If none was found it will get notified with an empty List. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    150
    151
    152
    153
    154
    155
    156
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 150

    def resolve_srv(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveSRV, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| ::Vertx::Util::Utils.safe_create(elt,::Vertx::SrvRecord) } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_srv(#{name})"
    end

### - (`self`) resolve_txt(name = nil) { ... }

Try to resolve the TXT records for the given name.

Parameters:

- name (`String`) (defaults to: `nil`) —
  the name for which the TXT records should be resolved

Yields:

- the to notify with the . The handler will get notified with a List that contains all resolved Strings. If none was found it will get notified with an empty List. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    117
    118
    119
    120
    121
    122
    123
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 117

    def resolve_txt(name=nil)
      if name.class == String && block_given?
        @j_del.java_method(:resolveTXT, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(name,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) }))
        return self
      end
      raise ArgumentError, "Invalid arguments when calling resolve_txt(#{name})"
    end

### - (`self`) reverse_lookup(ipaddress = nil) { ... }

Try to do a reverse lookup of an IP address. This is basically the same as doing trying to resolve a PTR record but allows you to just pass in the IP address and not a valid ptr query string.

Parameters:

- ipaddress (`String`) (defaults to: `nil`) —
  the IP address to resolve the PTR for

Yields:

- the to notify with the . The handler will get notified with the resolved String if a record was found. If none was found it will get notified with `null`. If an error accours it will get failed.

Returns:

- (`self`)

Raises:

- (`ArgumentError`)

    162
    163
    164
    165
    166
    167
    168
    # File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 162

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