Class: Vertx::DnsClient

Inherits:
Object
  • Object
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)

Instance Method Summary (collapse)

Class Method Details

+ (Boolean) accept?(obj)

Returns:

  • (Boolean)


23
24
25
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 23

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

+ (Object) j_api_type



32
33
34
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 32

def self.j_api_type
  @@j_api_type
end

+ (Object) j_class



35
36
37
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 35

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

+ (Object) unwrap(obj)



29
30
31
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 29

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

+ (Object) wrap(obj)



26
27
28
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 26

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

Instance Method Details

- (self) lookup(name, handler)

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

Parameters:

  • name (String)
    the name to resolve

Returns:

  • (self)


65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 65

def lookup(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:lookup, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:lookup, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling lookup(#{args[0]})"
  end
end

- (self) lookup4(name, handler) { ... }

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

Parameters:

  • name (String)
    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)


131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 131

def lookup4(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:lookup4, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:lookup4, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling lookup4(#{args[0]})"
  end
end

- (self) lookup6(name, handler) { ... }

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

Parameters:

  • name (String)
    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)


176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 176

def lookup6(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:lookup6, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:lookup6, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling lookup6(#{args[0]})"
  end
end

- (self) resolveA(name, handler)

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

Parameters:

  • name (String)
    the name to resolve

Returns:

  • (self)


87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 87

def resolve_a(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveA, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveA, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_a(#{args[0]})"
  end
end

- (self) resolveAAAA(name, handler)

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

Parameters:

  • name (String)
    the name to resolve

Returns:

  • (self)


43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 43

def resolve_aaaa(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveAAAA, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveAAAA, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_aaaa(#{args[0]})"
  end
end

- (self) resolveCNAME(name, handler) { ... }

Try to resolve the CNAME record for the given name.

Parameters:

  • name (String)
    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)


286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 286

def resolve_cname(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveCNAME, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveCNAME, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_cname(#{args[0]})"
  end
end

- (self) resolveMX(name, handler)

Try to resolve the MX records for the given name.

Parameters:

  • name (String)
    the name for which the MX records should be resolved

Returns:

  • (self)


198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 198

def resolve_mx(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveMX, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? 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) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveMX, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? 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) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_mx(#{args[0]})"
  end
end

- (self) resolveNS(name, handler) { ... }

Try to resolve the NS records for the given name.

Parameters:

  • name (String)
    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)


264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 264

def resolve_ns(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveNS, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveNS, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_ns(#{args[0]})"
  end
end

- (self) resolvePTR(name, handler) { ... }

Try to resolve the PTR record for the given name.

Parameters:

  • name (String)
    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)


220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 220

def resolve_ptr(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolvePTR, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolvePTR, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_ptr(#{args[0]})"
  end
end

- (self) resolveSRV(name, handler) { ... }

Try to resolve the SRV records for the given name.

Parameters:

  • name (String)
    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)


109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 109

def resolve_srv(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveSRV, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? 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) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveSRV, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? 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) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_srv(#{args[0]})"
  end
end

- (self) resolveTXT(name, handler) { ... }

Try to resolve the TXT records for the given name.

Parameters:

  • name (String)
    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)


242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 242

def resolve_txt(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:resolveTXT, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:resolveTXT, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result.to_a.map { |elt| elt } : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling resolve_txt(#{args[0]})"
  end
end

- (self) reverseLookup(ipaddress, handler) { ... }

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


154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
# File '/Users/julien/java/vertx-aggregator/modules/vertx-lang-ruby/vertx-lang-ruby/target/classes/vertx/dns_client.rb', line 154

def reverse_lookup(*args)
  if args[0].class == String && true
    if (block_given?)
      @j_del.java_method(:reverseLookup, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return self
    else
      promise = ::Vertx::Util::Utils.promise
      @j_del.java_method(:reverseLookup, [Java::java.lang.String.java_class,Java::IoVertxCore::Handler.java_class]).call(args[0],block_given? ? Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) } : promise)
      return ::Vertx::Util::Utils.safe_create(promise.future(),::Vertx::Future, nil)
    end
  end
  if defined?(super)
    super
  else
    raise ArgumentError, "Invalid arguments when calling reverse_lookup(#{args[0]})"
  end
end