public final class com.mongodb.internal.dns.DefaultDnsResolver implements com.mongodb.internal.dns.DnsResolver
minor version: 0
major version: 59
flags: flags: (0x0031) ACC_PUBLIC, ACC_FINAL, ACC_SUPER
this_class: com.mongodb.internal.dns.DefaultDnsResolver
super_class: java.lang.Object
{
public void <init>();
descriptor: ()V
flags: (0x0001) ACC_PUBLIC
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 this Lcom/mongodb/internal/dns/DefaultDnsResolver;
public java.util.List<java.lang.String> resolveHostFromSrvRecords(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/util/List;
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=14, args_size=2
start local 0 start local 1 0: aload 1
aload 1
bipush 46
invokevirtual java.lang.String.indexOf:(I)I
iconst_1
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
astore 2
start local 2 1: aload 2
ldc "\\."
invokevirtual java.lang.String.split:(Ljava/lang/String;)[Ljava/lang/String;
invokestatic java.util.Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
astore 3
start local 3 2: new java.util.ArrayList
dup
invokespecial java.util.ArrayList.<init>:()V
astore 4
start local 4 3: invokestatic com.mongodb.internal.dns.DefaultDnsResolver.createDnsDirContext:()Ljavax/naming/directory/InitialDirContext;
astore 5
start local 5 4: aload 5
new java.lang.StringBuilder
dup
ldc "_mongodb._tcp."
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
iconst_1
anewarray java.lang.String
dup
iconst_0
ldc "SRV"
aastore
invokevirtual javax.naming.directory.InitialDirContext.getAttributes:(Ljava/lang/String;[Ljava/lang/String;)Ljavax/naming/directory/Attributes;
astore 6
start local 6 5: aload 6
ldc "SRV"
invokeinterface javax.naming.directory.Attributes.get:(Ljava/lang/String;)Ljavax/naming/directory/Attribute;
astore 7
start local 7 6: aload 7
ifnonnull 8
7: new com.mongodb.MongoConfigurationException
dup
new java.lang.StringBuilder
dup
ldc "No SRV records available for host "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial com.mongodb.MongoConfigurationException.<init>:(Ljava/lang/String;)V
athrow
8: StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String java.util.List java.util.List javax.naming.directory.InitialDirContext javax.naming.directory.Attributes javax.naming.directory.Attribute
StackMap stack:
aload 7
invokeinterface javax.naming.directory.Attribute.getAll:()Ljavax/naming/NamingEnumeration;
astore 8
start local 8 9: goto 23
10: StackMap locals: javax.naming.NamingEnumeration
StackMap stack:
aload 8
invokeinterface javax.naming.NamingEnumeration.next:()Ljava/lang/Object;
checkcast java.lang.String
astore 9
start local 9 11: aload 9
ldc " "
invokevirtual java.lang.String.split:(Ljava/lang/String;)[Ljava/lang/String;
astore 10
start local 10 12: aload 10
iconst_3
aaload
ldc "."
invokevirtual java.lang.String.endsWith:(Ljava/lang/String;)Z
ifeq 13
aload 10
iconst_3
aaload
iconst_0
aload 10
iconst_3
aaload
invokevirtual java.lang.String.length:()I
iconst_1
isub
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
goto 14
StackMap locals: java.lang.String java.lang.String[]
StackMap stack:
13: aload 10
iconst_3
aaload
StackMap locals:
StackMap stack: java.lang.String
14: astore 11
start local 11 15: aload 11
aload 11
bipush 46
invokevirtual java.lang.String.indexOf:(I)I
iconst_1
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
astore 12
start local 12 16: aload 3
aload 12
invokestatic com.mongodb.internal.dns.DefaultDnsResolver.sameParentDomain:(Ljava/util/List;Ljava/lang/String;)Z
ifne 22
17: new com.mongodb.MongoConfigurationException
dup
18: ldc "The SRV host name '%s'resolved to a host '%s 'that is not in a sub-domain of the SRV host."
iconst_2
anewarray java.lang.Object
dup
iconst_0
19: aload 1
aastore
dup
iconst_1
aload 11
aastore
20: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
21: invokespecial com.mongodb.MongoConfigurationException.<init>:(Ljava/lang/String;)V
athrow
22: StackMap locals: java.lang.String java.lang.String
StackMap stack:
aload 4
new java.lang.StringBuilder
dup
aload 11
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc ":"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
aload 10
iconst_2
aaload
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokeinterface java.util.List.add:(Ljava/lang/Object;)Z
pop
end local 12 end local 11 end local 10 end local 9 23: StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String java.util.List java.util.List javax.naming.directory.InitialDirContext javax.naming.directory.Attributes javax.naming.directory.Attribute javax.naming.NamingEnumeration
StackMap stack:
aload 8
invokeinterface javax.naming.NamingEnumeration.hasMore:()Z
ifne 10
24: aload 4
invokeinterface java.util.List.isEmpty:()Z
ifeq 33
25: new com.mongodb.MongoConfigurationException
dup
new java.lang.StringBuilder
dup
ldc "Unable to find any SRV records for host "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokespecial com.mongodb.MongoConfigurationException.<init>:(Ljava/lang/String;)V
athrow
end local 8 end local 7 end local 6 26: StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String java.util.List java.util.List javax.naming.directory.InitialDirContext
StackMap stack: javax.naming.NamingException
astore 6
start local 6 27: new com.mongodb.MongoConfigurationException
dup
new java.lang.StringBuilder
dup
ldc "Unable to look up SRV record for host "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 6
invokespecial com.mongodb.MongoConfigurationException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 6 28: StackMap locals:
StackMap stack: java.lang.Throwable
astore 13
29: aload 5
invokevirtual javax.naming.directory.InitialDirContext.close:()V
30: goto 32
StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String java.util.List java.util.List javax.naming.directory.InitialDirContext top top top top top top top java.lang.Throwable
StackMap stack: javax.naming.NamingException
31: pop
32: StackMap locals:
StackMap stack:
aload 13
athrow
33: StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String java.util.List java.util.List javax.naming.directory.InitialDirContext
StackMap stack:
aload 5
invokevirtual javax.naming.directory.InitialDirContext.close:()V
34: goto 36
StackMap locals:
StackMap stack: javax.naming.NamingException
35: pop
36: StackMap locals:
StackMap stack:
aload 4
areturn
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 37 0 this Lcom/mongodb/internal/dns/DefaultDnsResolver;
0 37 1 srvHost Ljava/lang/String;
1 37 2 srvHostDomain Ljava/lang/String;
2 37 3 srvHostDomainParts Ljava/util/List<Ljava/lang/String;>;
3 37 4 hosts Ljava/util/List<Ljava/lang/String;>;
4 37 5 dirContext Ljavax/naming/directory/InitialDirContext;
5 26 6 attributes Ljavax/naming/directory/Attributes;
6 26 7 attribute Ljavax/naming/directory/Attribute;
9 26 8 srvRecordEnumeration Ljavax/naming/NamingEnumeration<*>;
11 23 9 srvRecord Ljava/lang/String;
12 23 10 split [Ljava/lang/String;
15 23 11 resolvedHost Ljava/lang/String;
16 23 12 resolvedHostDomain Ljava/lang/String;
27 28 6 e Ljavax/naming/NamingException;
Exception table:
from to target type
4 26 26 Class javax.naming.NamingException
4 28 28 any
29 30 31 Class javax.naming.NamingException
33 34 35 Class javax.naming.NamingException
Signature: (Ljava/lang/String;)Ljava/util/List<Ljava/lang/String;>;
MethodParameters:
Name Flags
srvHost final
private static boolean sameParentDomain(java.util.List<java.lang.String>, java.lang.String);
descriptor: (Ljava/util/List;Ljava/lang/String;)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=3, args_size=2
start local 0 start local 1 0: aload 1
ldc "\\."
invokevirtual java.lang.String.split:(Ljava/lang/String;)[Ljava/lang/String;
invokestatic java.util.Arrays.asList:([Ljava/lang/Object;)Ljava/util/List;
astore 2
start local 2 1: aload 0
invokeinterface java.util.List.size:()I
aload 2
invokeinterface java.util.List.size:()I
if_icmple 3
2: iconst_0
ireturn
3: StackMap locals: java.util.List
StackMap stack:
aload 2
aload 2
invokeinterface java.util.List.size:()I
aload 0
invokeinterface java.util.List.size:()I
isub
aload 2
invokeinterface java.util.List.size:()I
invokeinterface java.util.List.subList:(II)Ljava/util/List;
4: aload 0
invokeinterface java.util.List.equals:(Ljava/lang/Object;)Z
5: ireturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 srvHostDomainParts Ljava/util/List<Ljava/lang/String;>;
0 6 1 resolvedHostDomain Ljava/lang/String;
1 6 2 resolvedHostDomainParts Ljava/util/List<Ljava/lang/String;>;
Signature: (Ljava/util/List<Ljava/lang/String;>;Ljava/lang/String;)Z
MethodParameters:
Name Flags
srvHostDomainParts final
resolvedHostDomain final
public java.lang.String resolveAdditionalQueryParametersFromTxtRecords(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/String;
flags: (0x0001) ACC_PUBLIC
Code:
stack=7, locals=8, args_size=2
start local 0 start local 1 0: ldc ""
astore 2
start local 2 1: invokestatic com.mongodb.internal.dns.DefaultDnsResolver.createDnsDirContext:()Ljavax/naming/directory/InitialDirContext;
astore 3
start local 3 2: aload 3
aload 1
iconst_1
anewarray java.lang.String
dup
iconst_0
ldc "TXT"
aastore
invokevirtual javax.naming.directory.InitialDirContext.getAttributes:(Ljava/lang/String;[Ljava/lang/String;)Ljavax/naming/directory/Attributes;
astore 4
start local 4 3: aload 4
ldc "TXT"
invokeinterface javax.naming.directory.Attributes.get:(Ljava/lang/String;)Ljavax/naming/directory/Attribute;
astore 5
start local 5 4: aload 5
ifnull 19
5: aload 5
invokeinterface javax.naming.directory.Attribute.getAll:()Ljavax/naming/NamingEnumeration;
astore 6
start local 6 6: aload 6
invokeinterface javax.naming.NamingEnumeration.hasMore:()Z
ifeq 19
7: aload 6
invokeinterface javax.naming.NamingEnumeration.next:()Ljava/lang/Object;
checkcast java.lang.String
ldc "\\s"
ldc ""
invokevirtual java.lang.String.replaceAll:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
astore 2
8: aload 6
invokeinterface javax.naming.NamingEnumeration.hasMore:()Z
ifeq 19
9: new com.mongodb.MongoConfigurationException
dup
ldc "Multiple TXT records found for host '%s'. Only one is permitted"
iconst_1
anewarray java.lang.Object
dup
iconst_0
10: aload 1
aastore
11: invokestatic java.lang.String.format:(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;
invokespecial com.mongodb.MongoConfigurationException.<init>:(Ljava/lang/String;)V
athrow
end local 6 end local 5 end local 4 12: StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String javax.naming.directory.InitialDirContext
StackMap stack: javax.naming.NamingException
astore 4
start local 4 13: new com.mongodb.MongoConfigurationException
dup
new java.lang.StringBuilder
dup
ldc "Unable to look up TXT record for host "
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 1
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
aload 4
invokespecial com.mongodb.MongoConfigurationException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 4 14: StackMap locals:
StackMap stack: java.lang.Throwable
astore 7
15: aload 3
invokevirtual javax.naming.directory.InitialDirContext.close:()V
16: goto 18
StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String javax.naming.directory.InitialDirContext top top top java.lang.Throwable
StackMap stack: javax.naming.NamingException
17: pop
18: StackMap locals:
StackMap stack:
aload 7
athrow
19: StackMap locals: com.mongodb.internal.dns.DefaultDnsResolver java.lang.String java.lang.String javax.naming.directory.InitialDirContext
StackMap stack:
aload 3
invokevirtual javax.naming.directory.InitialDirContext.close:()V
20: goto 22
StackMap locals:
StackMap stack: javax.naming.NamingException
21: pop
22: StackMap locals:
StackMap stack:
aload 2
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 23 0 this Lcom/mongodb/internal/dns/DefaultDnsResolver;
0 23 1 host Ljava/lang/String;
1 23 2 additionalQueryParameters Ljava/lang/String;
2 23 3 dirContext Ljavax/naming/directory/InitialDirContext;
3 12 4 attributes Ljavax/naming/directory/Attributes;
4 12 5 attribute Ljavax/naming/directory/Attribute;
6 12 6 txtRecordEnumeration Ljavax/naming/NamingEnumeration<*>;
13 14 4 e Ljavax/naming/NamingException;
Exception table:
from to target type
2 12 12 Class javax.naming.NamingException
2 14 14 any
15 16 17 Class javax.naming.NamingException
19 20 21 Class javax.naming.NamingException
MethodParameters:
Name Flags
host final
private static javax.naming.directory.InitialDirContext createDnsDirContext();
descriptor: ()Ljavax/naming/directory/InitialDirContext;
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=2, args_size=0
0: new java.util.Hashtable
dup
invokespecial java.util.Hashtable.<init>:()V
astore 0
start local 0 1: aload 0
ldc "java.naming.factory.initial"
ldc "com.sun.jndi.dns.DnsContextFactory"
invokevirtual java.util.Hashtable.put:(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
pop
2: new javax.naming.directory.InitialDirContext
dup
aload 0
invokespecial javax.naming.directory.InitialDirContext.<init>:(Ljava/util/Hashtable;)V
3: areturn
4: StackMap locals: java.util.Hashtable
StackMap stack: javax.naming.NamingException
astore 1
start local 1 5: new com.mongodb.MongoClientException
dup
ldc "Unable to support mongodb+srv// style connections as the 'com.sun.jndi.dns.DnsContextFactory' class is not available in this JRE. A JNDI context is required for resolving SRV records."
6: aload 1
7: invokespecial com.mongodb.MongoClientException.<init>:(Ljava/lang/String;Ljava/lang/Throwable;)V
athrow
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
1 8 0 envProps Ljava/util/Hashtable<Ljava/lang/String;Ljava/lang/String;>;
5 8 1 e Ljavax/naming/NamingException;
Exception table:
from to target type
2 3 4 Class javax.naming.NamingException
}
SourceFile: "DefaultDnsResolver.java"