public class org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy extends org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy
{
private static final java.lang.String SA_USER;
private static final java.lang.String SA_PASSWORD;
private static final java.util.List LEGEND_H2_EXTENSION_SQLs;
private static final java.util.List LEGEND_H2_1_4_200_EXTENSION_SQLs;
public void <init>()
{
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy;
specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: void <init>()>();
return;
}
public java.sql.Connection getConnectionImpl(org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics, org.finos.legend.engine.shared.core.identity.Identity) throws org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException
{
java.lang.Throwable v;
org.finos.legend.engine.shared.core.identity.Identity v;
java.sql.Connection v;
java.util.Iterator v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException v;
java.sql.SQLException v, v;
java.util.List v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics v;
int v;
java.sql.Statement v;
javax.sql.DataSource v;
java.lang.Object v;
boolean v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy;
v := @parameter: org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics;
v := @parameter: org.finos.legend.engine.shared.core.identity.Identity;
label:
v = staticinvoke <org.finos.legend.engine.plan.execution.stores.relational.connection.driver.vendors.h.H2Manager: int getMajorVersion()>();
if v != 2 goto label;
v = <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: java.util.List LEGEND_H2_EXTENSION_SQLs>;
goto label;
label:
v = <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: java.util.List LEGEND_H2_1_4_200_EXTENSION_SQLs>;
label:
v = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics: javax.sql.DataSource getDataSource()>();
v = interfaceinvoke v.<javax.sql.DataSource: java.sql.Connection getConnection()>();
v = interfaceinvoke v.<java.util.List: java.util.Iterator iterator()>();
label:
v = interfaceinvoke v.<java.util.Iterator: boolean hasNext()>();
if v == 0 goto label;
v = interfaceinvoke v.<java.util.Iterator: java.lang.Object next()>();
label:
v = interfaceinvoke v.<java.sql.Connection: java.sql.Statement createStatement()>();
label:
interfaceinvoke v.<java.sql.Statement: boolean execute(java.lang.String)>(v);
label:
interfaceinvoke v.<java.sql.Statement: void close()>();
goto label;
label:
v := @caughtexception;
throw v;
label:
v := @caughtexception;
goto label;
label:
return v;
label:
v := @caughtexception;
v = new org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException;
specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException: void <init>(java.lang.Exception)>(v);
throw v;
catch java.lang.Throwable from label to label with label;
catch java.sql.SQLException from label to label with label;
catch java.sql.SQLException from label to label with label;
}
public org.eclipse.collections.api.tuple.Pair handleConnection(java.lang.String, java.util.Properties, org.finos.legend.engine.plan.execution.stores.relational.connection.driver.DatabaseManager)
{
org.finos.legend.engine.plan.execution.stores.relational.connection.driver.DatabaseManager v;
java.util.Properties v;
org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy v;
java.lang.String v, v, v;
org.eclipse.collections.api.tuple.Pair v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy;
v := @parameter: java.lang.String;
v := @parameter: java.util.Properties;
v := @parameter: org.finos.legend.engine.plan.execution.stores.relational.connection.driver.DatabaseManager;
v = specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential resolveCredential(java.util.Properties)>(v);
v = virtualinvoke v.<org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential: java.lang.String getUser()>();
virtualinvoke v.<java.util.Properties: java.lang.Object put(java.lang.Object,java.lang.Object)>("user", v);
v = virtualinvoke v.<org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential: java.lang.String getPassword()>();
virtualinvoke v.<java.util.Properties: java.lang.Object put(java.lang.Object,java.lang.Object)>("password", v);
v = staticinvoke <org.eclipse.collections.impl.tuple.Tuples: org.eclipse.collections.api.tuple.Pair pair(java.lang.Object,java.lang.Object)>(v, v);
return v;
}
private org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential resolveCredential(java.util.Properties)
{
java.util.Properties v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.ConnectionStateManager v;
org.finos.legend.engine.shared.core.identity.Credential v;
org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy v;
java.util.Optional v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState v;
boolean v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy;
v := @parameter: java.util.Properties;
v = staticinvoke <org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.ConnectionStateManager: org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.ConnectionStateManager getInstance()>();
v = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.ConnectionStateManager: org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState getIdentityStateUsing(java.util.Properties)>(v);
if v == null goto label;
v = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState: java.util.Optional getCredentialSupplier()>();
v = virtualinvoke v.<java.util.Optional: boolean isPresent()>();
if v != 0 goto label;
label:
v = new org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential;
specialinvoke v.<org.finos.legend.engine.shared.core.identity.credential.PlaintextUserPasswordCredential: void <init>(java.lang.String,java.lang.String)>("sa", "");
return v;
label:
v = specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.finos.legend.engine.shared.core.identity.Credential getDatabaseCredential(org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState)>(v);
return v;
}
public org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.keys.AuthenticationStrategyKey getKey()
{
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.keys.DefaultH2AuthenticationStrategyKey v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy;
v = new org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.keys.DefaultH2AuthenticationStrategyKey;
specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.keys.DefaultH2AuthenticationStrategyKey: void <init>()>();
return v;
}
private static java.util.List getLegendH2ExtensionSQLs()
{
java.lang.String[] v;
java.util.List v;
v = newarray (java.lang.String)[9];
v[0] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_json_navigate FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_json_navigate\";";
v[1] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_json_parse FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_json_parse\";";
v[2] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_base64_decode FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_base64_decode\";";
v[3] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_base64_encode FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_base64_encode\";";
v[4] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_reverse_string FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_reverse_string\";";
v[5] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_flatten_array FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_flatten_array\";";
v[6] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_split_part FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_split_part\";";
v[7] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_edit_distance FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_edit_distance\";";
v[8] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_jaro_winkler_similarity FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions.legend_h2_extension_jaro_winkler_similarity\";";
v = staticinvoke <java.util.Arrays: java.util.List asList(java.lang.Object[])>(v);
return v;
}
private static java.util.List getLegendH2_1_4_200_ExtensionSQLs()
{
java.lang.String[] v;
java.util.List v;
v = newarray (java.lang.String)[11];
v[0] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_json_navigate FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_json_navigate\";";
v[1] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_json_parse FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_json_parse\";";
v[2] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_base64_decode FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_base64_decode\";";
v[3] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_base64_encode FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_base64_encode\";";
v[4] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_reverse_string FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_reverse_string\";";
v[5] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_hash_md FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_hash_md5\";";
v[6] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_hash_sha FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_hash_sha1\";";
v[7] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_flatten_array FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_flatten_array\";";
v[8] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_split_part FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_split_part\";";
v[9] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_edit_distance FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_edit_distance\";";
v[10] = "CREATE ALIAS IF NOT EXISTS legend_h2_extension_jaro_winkler_similarity FOR \"org.finos.legend.engine.plan.execution.stores.relational.LegendH2Extensions_1_4_200.legend_h2_extension_jaro_winkler_similarity\";";
v = staticinvoke <java.util.Arrays: java.util.List asList(java.lang.Object[])>(v);
return v;
}
static void <clinit>()
{
java.util.List v, v;
v = staticinvoke <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: java.util.List getLegendH2ExtensionSQLs()>();
<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: java.util.List LEGEND_H2_EXTENSION_SQLs> = v;
v = staticinvoke <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: java.util.List getLegendH2_1_4_200_ExtensionSQLs()>();
<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.DefaultH2AuthenticationStrategy: java.util.List LEGEND_H2_1_4_200_EXTENSION_SQLs> = v;
return;
}
}