public class org.apache.drill.exec.store.splunk.SplunkConnection extends java.lang.Object
{
private static final org.slf4j.Logger logger;
private final java.util.Optional credentials;
private final java.lang.String scheme;
private final java.lang.String hostname;
private final java.lang.Integer port;
private final boolean validateCertificates;
private final java.lang.String app;
private final java.lang.String owner;
private final java.lang.String token;
private final java.lang.String cookie;
private com.splunk.Service service;
private int connectionAttempts;
public void <init>(org.apache.drill.exec.store.splunk.SplunkPluginConfig, java.lang.String)
{
java.lang.Integer v;
int v, v;
java.lang.String v, v, v, v, v, v, v;
boolean v;
org.apache.drill.common.logical.StoragePluginConfig$AuthMode v, v;
org.apache.drill.exec.store.splunk.SplunkConnection v;
com.splunk.Service v;
org.apache.drill.exec.store.splunk.SplunkPluginConfig v;
java.util.Optional v, v;
v := @this: org.apache.drill.exec.store.splunk.SplunkConnection;
v := @parameter: org.apache.drill.exec.store.splunk.SplunkPluginConfig;
v := @parameter: java.lang.String;
specialinvoke v.<java.lang.Object: void <init>()>();
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: org.apache.drill.common.logical.StoragePluginConfig$AuthMode getAuthMode()>();
v = <org.apache.drill.common.logical.StoragePluginConfig$AuthMode: org.apache.drill.common.logical.StoragePluginConfig$AuthMode USER_TRANSLATION>;
if v != v goto label;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.util.Optional getUsernamePasswordCredentials(java.lang.String)>(v);
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.util.Optional credentials> = v;
goto label;
label:
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.util.Optional getUsernamePasswordCredentials()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.util.Optional credentials> = v;
label:
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getScheme()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String scheme> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getHostname()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String hostname> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: int getPort()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.Integer port> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getApp()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String app> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getOwner()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String owner> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getToken()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String token> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getCookie()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String cookie> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: boolean getValidateCertificates()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: boolean validateCertificates> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: int getReconnectRetries()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: int connectionAttempts> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service connect()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service service> = v;
return;
}
public void <init>(org.apache.drill.exec.store.splunk.SplunkPluginConfig, com.splunk.Service, java.lang.String)
{
java.lang.Integer v;
int v;
java.lang.String v, v, v, v, v, v, v;
boolean v;
org.apache.drill.common.logical.StoragePluginConfig$AuthMode v, v;
org.apache.drill.exec.store.splunk.SplunkConnection v;
com.splunk.Service v;
org.apache.drill.exec.store.splunk.SplunkPluginConfig v;
java.util.Optional v, v;
v := @this: org.apache.drill.exec.store.splunk.SplunkConnection;
v := @parameter: org.apache.drill.exec.store.splunk.SplunkPluginConfig;
v := @parameter: com.splunk.Service;
v := @parameter: java.lang.String;
specialinvoke v.<java.lang.Object: void <init>()>();
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: org.apache.drill.common.logical.StoragePluginConfig$AuthMode getAuthMode()>();
v = <org.apache.drill.common.logical.StoragePluginConfig$AuthMode: org.apache.drill.common.logical.StoragePluginConfig$AuthMode USER_TRANSLATION>;
if v != v goto label;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.util.Optional getUsernamePasswordCredentials(java.lang.String)>(v);
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.util.Optional credentials> = v;
goto label;
label:
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.util.Optional getUsernamePasswordCredentials()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.util.Optional credentials> = v;
label:
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getScheme()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String scheme> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getHostname()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String hostname> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: int getPort()>();
v = staticinvoke <java.lang.Integer: java.lang.Integer valueOf(int)>(v);
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.Integer port> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getApp()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String app> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getOwner()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String owner> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getToken()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String token> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: java.lang.String getCookie()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String cookie> = v;
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkPluginConfig: boolean getValidateCertificates()>();
v.<org.apache.drill.exec.store.splunk.SplunkConnection: boolean validateCertificates> = v;
v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service service> = v;
return;
}
public com.splunk.Service connect()
{
org.apache.drill.common.exceptions.UserException v, v;
java.lang.Integer v, v, v, v;
boolean v, v;
java.security.KeyManagementException v;
java.lang.Exception v;
javax.net.ssl.SSLSocketFactory v;
com.splunk.ServiceArgs v;
com.splunk.Service v, v, v;
java.util.Optional v, v, v, v;
java.lang.Object[] v, v;
org.apache.drill.common.exceptions.UserException$Builder v, v, v, v, v;
java.util.function.Function v, v;
int v, v, v, v;
java.lang.String v, v, v, v, v, v, v, v, v, v, v, v, v;
org.slf4j.Logger v, v, v, v;
org.apache.drill.exec.store.splunk.SplunkConnection v;
java.util.concurrent.TimeUnit v;
com.splunk.SSLSecurityProtocol v;
java.lang.InterruptedException v;
java.lang.Object v, v;
v := @this: org.apache.drill.exec.store.splunk.SplunkConnection;
v = <com.splunk.SSLSecurityProtocol: com.splunk.SSLSecurityProtocol TLSv1_2>;
staticinvoke <com.splunk.HttpService: void setSslSecurityProtocol(com.splunk.SSLSecurityProtocol)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: boolean validateCertificates>;
staticinvoke <com.splunk.HttpService: void setValidateCertificates(boolean)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: boolean validateCertificates>;
if v != 0 goto label;
label:
v = specialinvoke v.<org.apache.drill.exec.store.splunk.SplunkConnection: javax.net.ssl.SSLSocketFactory createAllTrustingSSLFactory()>();
staticinvoke <com.splunk.HttpService: void setSSLSocketFactory(javax.net.ssl.SSLSocketFactory)>(v);
label:
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.drill.common.exceptions.UserException: org.apache.drill.common.exceptions.UserException$Builder connectionError(java.lang.Throwable)>(v);
v = virtualinvoke v.<java.security.KeyManagementException: java.lang.String getMessage()>();
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[])>("Error validating SSL Certificates: \u0001");
v = newarray (java.lang.Object)[0];
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException$Builder message(java.lang.String,java.lang.Object[])>(v, v);
v = <org.apache.drill.exec.store.splunk.SplunkConnection: org.slf4j.Logger logger>;
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException build(org.slf4j.Logger)>(v);
throw v;
label:
v = new com.splunk.ServiceArgs;
specialinvoke v.<com.splunk.ServiceArgs: void <init>()>();
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String scheme>;
if v == null goto label;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String scheme>;
virtualinvoke v.<com.splunk.ServiceArgs: void setScheme(java.lang.String)>(v);
label:
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String hostname>;
if v == null goto label;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String hostname>;
virtualinvoke v.<com.splunk.ServiceArgs: void setHost(java.lang.String)>(v);
label:
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.Integer port>;
if v == null goto label;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.Integer port>;
v = virtualinvoke v.<java.lang.Integer: int intValue()>();
virtualinvoke v.<com.splunk.ServiceArgs: void setPort(int)>(v);
label:
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.util.Optional credentials>;
v = staticinvoke <org.apache.drill.exec.store.splunk.SplunkConnection$getPassword__1: java.util.function.Function bootstrap$()>();
v = virtualinvoke v.<java.util.Optional: java.util.Optional map(java.util.function.Function)>(v);
v = virtualinvoke v.<java.util.Optional: java.lang.Object orElse(java.lang.Object)>(null);
virtualinvoke v.<com.splunk.ServiceArgs: void setPassword(java.lang.String)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.util.Optional credentials>;
v = staticinvoke <org.apache.drill.exec.store.splunk.SplunkConnection$getUsername__2: java.util.function.Function bootstrap$()>();
v = virtualinvoke v.<java.util.Optional: java.util.Optional map(java.util.function.Function)>(v);
v = virtualinvoke v.<java.util.Optional: java.lang.Object orElse(java.lang.Object)>(null);
virtualinvoke v.<com.splunk.ServiceArgs: void setUsername(java.lang.String)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String app>;
virtualinvoke v.<com.splunk.ServiceArgs: void setApp(java.lang.String)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String owner>;
virtualinvoke v.<com.splunk.ServiceArgs: void setOwner(java.lang.String)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String token>;
virtualinvoke v.<com.splunk.ServiceArgs: void setToken(java.lang.String)>(v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String cookie>;
virtualinvoke v.<com.splunk.ServiceArgs: void setCookie(java.lang.String)>(v);
label:
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: int connectionAttempts>;
v = v - 1;
v.<org.apache.drill.exec.store.splunk.SplunkConnection: int connectionAttempts> = v;
v = staticinvoke <com.splunk.Service: com.splunk.Service connect(java.util.Map)>(v);
v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service service> = v;
label:
goto label;
label:
v := @caughtexception;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: int connectionAttempts>;
if v <= 0 goto label;
label:
v = <java.util.concurrent.TimeUnit: java.util.concurrent.TimeUnit SECONDS>;
virtualinvoke v.<java.util.concurrent.TimeUnit: void sleep(long)>(2L);
label:
goto label;
label:
v := @caughtexception;
v = <org.apache.drill.exec.store.splunk.SplunkConnection: org.slf4j.Logger logger>;
interfaceinvoke v.<org.slf4j.Logger: void error(java.lang.String)>("Unable to wait 2 secs before next connection try to Splunk");
label:
v = virtualinvoke v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service connect()>();
return v;
label:
v = staticinvoke <org.apache.drill.common.exceptions.UserException: org.apache.drill.common.exceptions.UserException$Builder connectionError(java.lang.Throwable)>(v);
v = newarray (java.lang.Object)[2];
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String hostname>;
v[0] = v;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.Integer port>;
v[1] = v;
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException$Builder message(java.lang.String,java.lang.Object[])>("Unable to connect to Splunk at %s:%s", v);
v = virtualinvoke v.<java.lang.Exception: java.lang.String getMessage()>();
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException$Builder addContext(java.lang.String)>(v);
v = <org.apache.drill.exec.store.splunk.SplunkConnection: org.slf4j.Logger logger>;
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException build(org.slf4j.Logger)>(v);
throw v;
label:
v = <org.apache.drill.exec.store.splunk.SplunkConnection: org.slf4j.Logger logger>;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.String hostname>;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: java.lang.Integer port>;
interfaceinvoke v.<org.slf4j.Logger: void info(java.lang.String,java.lang.Object,java.lang.Object)>("Successfully connected to {} on port {}", v, v);
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service service>;
return v;
catch java.security.KeyManagementException from label to label with label;
catch java.lang.Exception from label to label with label;
catch java.lang.InterruptedException from label to label with label;
}
public com.splunk.EntityCollection getIndexes()
{
org.apache.drill.exec.store.splunk.SplunkConnection v;
com.splunk.IndexCollection v;
com.splunk.Service v;
v := @this: org.apache.drill.exec.store.splunk.SplunkConnection;
v = v.<org.apache.drill.exec.store.splunk.SplunkConnection: com.splunk.Service service>;
v = virtualinvoke v.<com.splunk.Service: com.splunk.IndexCollection getIndexes()>();
return v;
}
private javax.net.ssl.SSLSocketFactory createAllTrustingSSLFactory() throws java.security.KeyManagementException
{
javax.net.ssl.SSLContext v;
java.lang.Object[] v;
org.slf4j.Logger v;
org.apache.drill.common.exceptions.UserException$Builder v, v;
org.apache.drill.common.exceptions.UserException v;
org.apache.drill.exec.store.splunk.SplunkConnection v;
javax.net.ssl.SSLSocketFactory v;
javax.net.ssl.TrustManager[] v;
java.security.NoSuchAlgorithmException v;
org.apache.drill.exec.store.splunk.SplunkConnection$1 v;
java.lang.String v, v;
v := @this: org.apache.drill.exec.store.splunk.SplunkConnection;
label:
v = staticinvoke <javax.net.ssl.SSLContext: javax.net.ssl.SSLContext getInstance(java.lang.String)>("TLS");
label:
goto label;
label:
v := @caughtexception;
v = staticinvoke <org.apache.drill.common.exceptions.UserException: org.apache.drill.common.exceptions.UserException$Builder validationError(java.lang.Throwable)>(v);
v = virtualinvoke v.<java.security.NoSuchAlgorithmException: java.lang.String getMessage()>();
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[])>("Error establishing SSL connection: Invalid scheme: \u0001");
v = newarray (java.lang.Object)[0];
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException$Builder message(java.lang.String,java.lang.Object[])>(v, v);
v = <org.apache.drill.exec.store.splunk.SplunkConnection: org.slf4j.Logger logger>;
v = virtualinvoke v.<org.apache.drill.common.exceptions.UserException$Builder: org.apache.drill.common.exceptions.UserException build(org.slf4j.Logger)>(v);
throw v;
label:
v = newarray (javax.net.ssl.TrustManager)[1];
v = new org.apache.drill.exec.store.splunk.SplunkConnection$1;
specialinvoke v.<org.apache.drill.exec.store.splunk.SplunkConnection$1: void <init>(org.apache.drill.exec.store.splunk.SplunkConnection)>(v);
v[0] = v;
virtualinvoke v.<javax.net.ssl.SSLContext: void init(javax.net.ssl.KeyManager[],javax.net.ssl.TrustManager[],java.security.SecureRandom)>(null, v, null);
v = virtualinvoke v.<javax.net.ssl.SSLContext: javax.net.ssl.SSLSocketFactory getSocketFactory()>();
return v;
catch java.security.NoSuchAlgorithmException from label to label with label;
}
static void <clinit>()
{
org.slf4j.Logger v;
v = staticinvoke <org.slf4j.LoggerFactory: org.slf4j.Logger getLogger(java.lang.Class)>(class "Lorg/apache/drill/exec/store/splunk/SplunkConnection;");
<org.apache.drill.exec.store.splunk.SplunkConnection: org.slf4j.Logger logger> = v;
return;
}
}