public abstract class org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy extends java.lang.Object
{
private static final org.slf4j.Logger LOGGER;
private static final int CONNECTION_TIMEOUT;
public static java.lang.String AUTHENTICATION_STRATEGY_KEY;
protected org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics authenticationStatistics;
public void <init>()
{
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
specialinvoke v.<java.lang.Object: void <init>()>();
v = new org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics;
specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics: void <init>()>();
v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics authenticationStatistics> = v;
return;
}
public java.sql.Connection getConnection(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
{
org.finos.legend.engine.shared.core.identity.Identity v;
java.sql.Connection v;
org.slf4j.Logger v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceStatistics v;
java.lang.Integer v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics v;
int v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
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 = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: java.sql.Connection getConnectionImpl(org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics,org.finos.legend.engine.shared.core.identity.Identity)>(v, v);
label:
return v;
label:
v := @caughtexception;
virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics: void logConnectionError()>();
v = <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.slf4j.Logger LOGGER>;
v = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceWithStatistics: org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceStatistics getStatistics()>();
v = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.DataSourceStatistics: int getTotalConnectionErrors()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String,java.lang.Object,java.lang.Object)>("error getting connection (total : {}) {}", v, v);
throw v;
catch org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException from label to label with label;
}
public abstract 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;
public abstract org.eclipse.collections.api.tuple.Pair handleConnection(java.lang.String, java.util.Properties, org.finos.legend.engine.plan.execution.stores.relational.connection.driver.DatabaseManager);
protected java.sql.Connection getConnectionUsingKerberos(javax.sql.DataSource, javax.security.auth.Subject)
{
java.security.PrivilegedActionException v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics v;
org.slf4j.Logger v, v;
java.lang.RuntimeException v;
java.security.PrivilegedExceptionAction v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
java.lang.Exception v;
javax.security.auth.Subject v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException v, v;
javax.sql.DataSource v;
java.lang.Object v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
v := @parameter: javax.sql.DataSource;
v := @parameter: javax.security.auth.Subject;
label:
virtualinvoke v.<java.lang.Object: java.lang.Class getClass()>();
v = staticinvoke <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy$getConnection__13: java.security.PrivilegedExceptionAction bootstrap$(javax.sql.DataSource)>(v);
v = staticinvoke <javax.security.auth.Subject: java.lang.Object doAs(javax.security.auth.Subject,java.security.PrivilegedExceptionAction)>(v, v);
label:
goto label;
label:
v := @caughtexception;
v = v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics authenticationStatistics>;
virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics: void logAuthenticationError()>();
v = <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.slf4j.Logger LOGGER>;
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String,java.lang.Object,java.lang.Object)>("PrivilegedActionException for subject {} {}", v, v);
v = new org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException;
v = virtualinvoke v.<java.security.PrivilegedActionException: java.lang.Exception getException()>();
specialinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ConnectionException: void <init>(java.lang.Exception)>(v);
throw v;
label:
v := @caughtexception;
v = <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.slf4j.Logger LOGGER>;
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String,java.lang.Object,java.lang.Object)>("RuntimeException for subject {} {}", v, v);
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;
label:
return v;
catch java.security.PrivilegedActionException from label to label with label;
catch java.lang.RuntimeException from label to label with label;
}
public org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics getAuthenticationStatistics()
{
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
v = v.<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStatistics authenticationStatistics>;
return v;
}
public int getConnectionTimeout()
{
int v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
v = <org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: int CONNECTION_TIMEOUT>;
return v;
}
public abstract org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.strategy.keys.AuthenticationStrategyKey getKey();
protected org.finos.legend.engine.shared.core.identity.Credential getDatabaseCredential(org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState)
{
org.finos.legend.engine.shared.core.identity.Identity v;
org.finos.legend.engine.shared.core.identity.Credential v;
java.lang.RuntimeException v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
java.lang.Exception v;
java.util.Optional v;
java.lang.Object v;
org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
v := @parameter: org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState;
label:
v = virtualinvoke v.<org.finos.legend.engine.plan.execution.stores.relational.connection.ds.state.IdentityState: org.finos.legend.engine.shared.core.identity.Identity getIdentity()>();
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: java.lang.Object get()>();
v = virtualinvoke v.<org.finos.legend.engine.authentication.credential.CredentialSupplier: org.finos.legend.engine.shared.core.identity.Credential getCredential(org.finos.legend.engine.shared.core.identity.Identity)>(v);
label:
return v;
label:
v := @caughtexception;
v = new java.lang.RuntimeException;
specialinvoke v.<java.lang.RuntimeException: void <init>(java.lang.Throwable)>(v);
throw v;
catch java.lang.Exception from label to label with label;
}
public java.util.Properties getAuthenticationPropertiesForConnection()
{
java.util.Properties v;
org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy v;
v := @this: org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy;
v = new java.util.Properties;
specialinvoke v.<java.util.Properties: void <init>()>();
return v;
}
static void <clinit>()
{
java.util.concurrent.TimeUnit v;
org.slf4j.Logger v;
int v;
long v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/finos/legend/engine/plan/execution/stores/relational/connection/authentication/AuthenticationStrategy;");
<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: org.slf4j.Logger LOGGER> = v;
v = <java.util.concurrent.TimeUnit: java.util.concurrent.TimeUnit SECONDS>;
v = virtualinvoke v.<java.util.concurrent.TimeUnit: long toMillis(long)>(30L);
v = staticinvoke <java.lang.Math: int toIntExact(long)>(v);
<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: int CONNECTION_TIMEOUT> = v;
<org.finos.legend.engine.plan.execution.stores.relational.connection.authentication.AuthenticationStrategy: java.lang.String AUTHENTICATION_STRATEGY_KEY> = "AUTHENTICATION_STRATEGY_KEY";
return;
}
}