Class List Method List File List

# Class: Vertx::DnsClient

Inherits:
  Object
  - Object
  - Vertx::DnsClient
  show all
Defined in:
  /Users/julien/java/vertx-stack/stack-docs/target/rb/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.

## 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.

## 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`)

    24
    25
    26
    27
    28
    29
    30
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 24

    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`)

    35
    36
    37
    38
    39
    40
    41
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 35

    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`)

    46
    47
    48
    49
    50
    51
    52
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 46

    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`)

    57
    58
    59
    60
    61
    62
    63
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 57

    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`)

    68
    69
    70
    71
    72
    73
    74
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 68

    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`)

    79
    80
    81
    82
    83
    84
    85
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 79

    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`)

    90
    91
    92
    93
    94
    95
    96
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 90

    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`)

    123
    124
    125
    126
    127
    128
    129
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 123

    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`)

    112
    113
    114
    115
    116
    117
    118
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 112

    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`)

    134
    135
    136
    137
    138
    139
    140
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 134

    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`)

    101
    102
    103
    104
    105
    106
    107
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 101

    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`)

    146
    147
    148
    149
    150
    151
    152
    # File '/Users/julien/java/vertx-stack/stack-docs/target/rb/vertx/dns_client.rb', line 146

    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