public class io.vertx.core.impl.AddressResolver extends java.lang.Object
{
private static final io.vertx.core.impl.logging.Logger log;
private static final java.util.regex.Pattern NDOTS_OPTIONS_PATTERN;
private static final java.util.regex.Pattern ROTATE_OPTIONS_PATTERN;
public static final int DEFAULT_NDOTS_RESOLV_OPTION;
public static final boolean DEFAULT_ROTATE_RESOLV_OPTION;
private final io.vertx.core.Vertx vertx;
private final io.netty.resolver.AddressResolverGroup resolverGroup;
private final io.vertx.core.spi.resolver.ResolverProvider provider;
private static java.util.regex.Pattern resolvOption(java.lang.String)
{
java.lang.String v, v;
java.util.regex.Pattern v;
v := @parameter: java.lang.String;
v = dynamicinvoke "makeConcatWithConstants" <java.lang.String (java.lang.String)>(v) <java.lang.invoke.StringConcatFactory: java.lang.invoke.CallSite makeConcatWithConstants(java.lang.invoke.MethodHandles$Lookup,java.lang.String,java.lang.invoke.MethodType,java.lang.String,java.lang.Object[])>("^[ \\t\\f]*options[^\n]+\u0001(?=$|\\s)");
v = staticinvoke <java.util.regex.Pattern: java.util.regex.Pattern compile(java.lang.String,int)>(v, 8);
return v;
}
public void <init>(io.vertx.core.Vertx, io.vertx.core.dns.AddressResolverOptions)
{
io.vertx.core.spi.resolver.ResolverProvider v, v;
io.netty.resolver.AddressResolverGroup v;
io.vertx.core.impl.AddressResolver v;
io.vertx.core.Vertx v;
io.vertx.core.dns.AddressResolverOptions v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: io.vertx.core.Vertx;
v := @parameter: io.vertx.core.dns.AddressResolverOptions;
specialinvoke v.<java.lang.Object: void <init>()>();
v = staticinvoke <io.vertx.core.spi.resolver.ResolverProvider: io.vertx.core.spi.resolver.ResolverProvider factory(io.vertx.core.Vertx,io.vertx.core.dns.AddressResolverOptions)>(v, v);
v.<io.vertx.core.impl.AddressResolver: io.vertx.core.spi.resolver.ResolverProvider provider> = v;
v = v.<io.vertx.core.impl.AddressResolver: io.vertx.core.spi.resolver.ResolverProvider provider>;
v = interfaceinvoke v.<io.vertx.core.spi.resolver.ResolverProvider: io.netty.resolver.AddressResolverGroup resolver(io.vertx.core.dns.AddressResolverOptions)>(v);
v.<io.vertx.core.impl.AddressResolver: io.netty.resolver.AddressResolverGroup resolverGroup> = v;
v.<io.vertx.core.impl.AddressResolver: io.vertx.core.Vertx vertx> = v;
return;
}
public void resolveHostname(java.lang.String, io.vertx.core.Handler)
{
io.vertx.core.impl.future.PromiseInternal v;
io.vertx.core.impl.AddressResolver v;
io.vertx.core.Vertx v;
io.netty.channel.EventLoop v;
io.vertx.core.Context v;
io.vertx.core.Future v, v;
java.util.function.Function v;
java.lang.String v;
io.netty.util.concurrent.Future v;
io.vertx.core.Handler v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: java.lang.String;
v := @parameter: io.vertx.core.Handler;
v = v.<io.vertx.core.impl.AddressResolver: io.vertx.core.Vertx vertx>;
v = interfaceinvoke v.<io.vertx.core.Vertx: io.vertx.core.Context getOrCreateContext()>();
v = interfaceinvoke v.<io.vertx.core.impl.ContextInternal: io.netty.channel.EventLoop nettyEventLoop()>();
v = virtualinvoke v.<io.vertx.core.impl.AddressResolver: io.netty.util.concurrent.Future resolveHostname(io.netty.channel.EventLoop,java.lang.String)>(v, v);
v = interfaceinvoke v.<io.vertx.core.impl.ContextInternal: io.vertx.core.impl.future.PromiseInternal promise()>();
interfaceinvoke v.<io.netty.util.concurrent.Future: io.netty.util.concurrent.Future addListener(io.netty.util.concurrent.GenericFutureListener)>(v);
v = interfaceinvoke v.<io.vertx.core.impl.future.PromiseInternal: io.vertx.core.Future future()>();
v = staticinvoke <io.vertx.core.impl.AddressResolver$getAddress__1488: java.util.function.Function bootstrap$()>();
v = interfaceinvoke v.<io.vertx.core.Future: io.vertx.core.Future map(java.util.function.Function)>(v);
interfaceinvoke v.<io.vertx.core.Future: io.vertx.core.Future onComplete(io.vertx.core.Handler)>(v);
return;
}
public io.netty.util.concurrent.Future resolveHostname(io.netty.channel.EventLoop, java.lang.String)
{
io.netty.resolver.AddressResolver v;
io.vertx.core.impl.AddressResolver v;
java.lang.String v;
io.netty.channel.EventLoop v;
io.netty.util.concurrent.Future v;
java.net.InetSocketAddress v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: io.netty.channel.EventLoop;
v := @parameter: java.lang.String;
v = virtualinvoke v.<io.vertx.core.impl.AddressResolver: io.netty.resolver.AddressResolver getResolver(io.netty.channel.EventLoop)>(v);
v = staticinvoke <java.net.InetSocketAddress: java.net.InetSocketAddress createUnresolved(java.lang.String,int)>(v, 0);
v = interfaceinvoke v.<io.netty.resolver.AddressResolver: io.netty.util.concurrent.Future resolve(java.net.SocketAddress)>(v);
return v;
}
public void resolveHostnameAll(java.lang.String, io.vertx.core.Handler)
{
io.vertx.core.impl.future.PromiseInternal v;
io.vertx.core.impl.AddressResolver v;
io.vertx.core.Vertx v;
io.netty.channel.EventLoop v;
io.vertx.core.Context v;
io.vertx.core.Future v;
java.lang.String v;
io.netty.util.concurrent.Future v;
io.vertx.core.Handler v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: java.lang.String;
v := @parameter: io.vertx.core.Handler;
v = v.<io.vertx.core.impl.AddressResolver: io.vertx.core.Vertx vertx>;
v = interfaceinvoke v.<io.vertx.core.Vertx: io.vertx.core.Context getOrCreateContext()>();
v = interfaceinvoke v.<io.vertx.core.impl.ContextInternal: io.netty.channel.EventLoop nettyEventLoop()>();
v = virtualinvoke v.<io.vertx.core.impl.AddressResolver: io.netty.util.concurrent.Future resolveHostnameAll(io.netty.channel.EventLoop,java.lang.String)>(v, v);
v = interfaceinvoke v.<io.vertx.core.impl.ContextInternal: io.vertx.core.impl.future.PromiseInternal promise()>();
interfaceinvoke v.<io.netty.util.concurrent.Future: io.netty.util.concurrent.Future addListener(io.netty.util.concurrent.GenericFutureListener)>(v);
v = interfaceinvoke v.<io.vertx.core.impl.future.PromiseInternal: io.vertx.core.Future future()>();
interfaceinvoke v.<io.vertx.core.Future: io.vertx.core.Future onComplete(io.vertx.core.Handler)>(v);
return;
}
public io.netty.util.concurrent.Future resolveHostnameAll(io.netty.channel.EventLoop, java.lang.String)
{
io.netty.resolver.AddressResolver v;
io.vertx.core.impl.AddressResolver v;
java.lang.String v;
io.netty.channel.EventLoop v;
io.netty.util.concurrent.Future v;
java.net.InetSocketAddress v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: io.netty.channel.EventLoop;
v := @parameter: java.lang.String;
v = virtualinvoke v.<io.vertx.core.impl.AddressResolver: io.netty.resolver.AddressResolver getResolver(io.netty.channel.EventLoop)>(v);
v = staticinvoke <java.net.InetSocketAddress: java.net.InetSocketAddress createUnresolved(java.lang.String,int)>(v, 0);
v = interfaceinvoke v.<io.netty.resolver.AddressResolver: io.netty.util.concurrent.Future resolveAll(java.net.SocketAddress)>(v);
return v;
}
public io.netty.resolver.AddressResolver getResolver(io.netty.channel.EventLoop)
{
io.netty.resolver.AddressResolver v;
io.netty.resolver.AddressResolverGroup v;
io.vertx.core.impl.AddressResolver v;
io.netty.channel.EventLoop v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: io.netty.channel.EventLoop;
v = v.<io.vertx.core.impl.AddressResolver: io.netty.resolver.AddressResolverGroup resolverGroup>;
v = virtualinvoke v.<io.netty.resolver.AddressResolverGroup: io.netty.resolver.AddressResolver getResolver(io.netty.util.concurrent.EventExecutor)>(v);
return v;
}
io.netty.resolver.AddressResolverGroup nettyAddressResolverGroup()
{
io.netty.resolver.AddressResolverGroup v;
io.vertx.core.impl.AddressResolver v;
v := @this: io.vertx.core.impl.AddressResolver;
v = v.<io.vertx.core.impl.AddressResolver: io.netty.resolver.AddressResolverGroup resolverGroup>;
return v;
}
public void close(io.vertx.core.Handler)
{
io.vertx.core.spi.resolver.ResolverProvider v;
io.vertx.core.Handler v;
io.vertx.core.impl.AddressResolver v;
v := @this: io.vertx.core.impl.AddressResolver;
v := @parameter: io.vertx.core.Handler;
v = v.<io.vertx.core.impl.AddressResolver: io.vertx.core.spi.resolver.ResolverProvider provider>;
interfaceinvoke v.<io.vertx.core.spi.resolver.ResolverProvider: void close(io.vertx.core.Handler)>(v);
return;
}
public static int parseNdotsOptionFromResolvConf(java.lang.String)
{
java.util.regex.Matcher v;
int v, v;
java.lang.String v, v;
java.util.regex.Pattern v;
boolean v;
v := @parameter: java.lang.String;
v = (int) -1;
v = v;
v = <io.vertx.core.impl.AddressResolver: java.util.regex.Pattern NDOTS_OPTIONS_PATTERN>;
v = virtualinvoke v.<java.util.regex.Pattern: java.util.regex.Matcher matcher(java.lang.CharSequence)>(v);
label:
v = virtualinvoke v.<java.util.regex.Matcher: boolean find()>();
if v == 0 goto label;
v = virtualinvoke v.<java.util.regex.Matcher: java.lang.String group(int)>(1);
v = staticinvoke <java.lang.Integer: int parseInt(java.lang.String)>(v);
goto label;
label:
return v;
}
public static boolean parseRotateOptionFromResolvConf(java.lang.String)
{
java.util.regex.Matcher v;
java.lang.String v;
java.util.regex.Pattern v;
boolean v;
v := @parameter: java.lang.String;
v = <io.vertx.core.impl.AddressResolver: java.util.regex.Pattern ROTATE_OPTIONS_PATTERN>;
v = virtualinvoke v.<java.util.regex.Pattern: java.util.regex.Matcher matcher(java.lang.CharSequence)>(v);
v = virtualinvoke v.<java.util.regex.Matcher: boolean find()>();
return v;
}
static void <clinit>()
{
java.lang.Throwable v;
byte[] v;
int v, v, v;
java.lang.String v;
java.nio.file.Path v;
boolean v, v, v, v;
io.vertx.core.impl.logging.Logger v, v;
java.io.File v;
java.util.regex.Pattern v, v;
v = staticinvoke <io.vertx.core.impl.logging.LoggerFactory: io.vertx.core.impl.logging.Logger getLogger(java.lang.Class)>(class "Lio/vertx/core/impl/AddressResolver;");
<io.vertx.core.impl.AddressResolver: io.vertx.core.impl.logging.Logger log> = v;
v = staticinvoke <io.vertx.core.impl.AddressResolver: java.util.regex.Pattern resolvOption(java.lang.String)>("ndots:[ \\t\\f]*(\\d)+");
<io.vertx.core.impl.AddressResolver: java.util.regex.Pattern NDOTS_OPTIONS_PATTERN> = v;
v = staticinvoke <io.vertx.core.impl.AddressResolver: java.util.regex.Pattern resolvOption(java.lang.String)>("rotate");
<io.vertx.core.impl.AddressResolver: java.util.regex.Pattern ROTATE_OPTIONS_PATTERN> = v;
v = 1;
v = 0;
v = staticinvoke <io.vertx.core.impl.launcher.commands.ExecUtils: boolean isLinux()>();
if v == 0 goto label;
v = new java.io.File;
specialinvoke v.<java.io.File: void <init>(java.lang.String)>("/etc/resolv.conf");
label:
v = virtualinvoke v.<java.io.File: boolean exists()>();
if v == 0 goto label;
v = virtualinvoke v.<java.io.File: boolean isFile()>();
if v == 0 goto label;
v = new java.lang.String;
v = virtualinvoke v.<java.io.File: java.nio.file.Path toPath()>();
v = staticinvoke <java.nio.file.Files: byte[] readAllBytes(java.nio.file.Path)>(v);
specialinvoke v.<java.lang.String: void <init>(byte[])>(v);
v = staticinvoke <io.vertx.core.impl.AddressResolver: int parseNdotsOptionFromResolvConf(java.lang.String)>(v);
v = (int) -1;
if v == v goto label;
v = v;
label:
v = staticinvoke <io.vertx.core.impl.AddressResolver: boolean parseRotateOptionFromResolvConf(java.lang.String)>(v);
label:
goto label;
label:
v := @caughtexception;
v = <io.vertx.core.impl.AddressResolver: io.vertx.core.impl.logging.Logger log>;
interfaceinvoke v.<io.vertx.core.impl.logging.Logger: void debug(java.lang.Object,java.lang.Throwable)>("Failed to load options from /etc/resolv/.conf", v);
label:
<io.vertx.core.impl.AddressResolver: int DEFAULT_NDOTS_RESOLV_OPTION> = v;
<io.vertx.core.impl.AddressResolver: boolean DEFAULT_ROTATE_RESOLV_OPTION> = v;
return;
catch java.lang.Throwable from label to label with label;
}
}