Class DriverLoadingJdbcAdapter
- java.lang.Object
-
- com.c12e.cortex.profiles.module.connection.jdbc.DriverLoadingJdbcAdapter
-
- All Implemented Interfaces:
JdbcSparkAdapter
public class DriverLoadingJdbcAdapter extends java.lang.Object implements JdbcSparkAdapter
JDBC Spark Adapter that supports parsing Connection Plugin Properties and attempts to modify the classpath. This will only work if theJvmClasspathAgent
is attached to the JVM. This can be done statically by including the"-javaagent:<profiles-sdk-jar>"
argument when running the JVM.
-
-
Field Summary
Fields Modifier and Type Field Description protected org.slf4j.Logger
logger
-
Fields inherited from interface com.c12e.cortex.profiles.module.connection.jdbc.JdbcSparkAdapter
CDATA_CHECKSUM_SECRET, CDATA_OEM_KEY_SECRET, CDATA_SHARED_PROJECT, DEFAULT_CDATA_CHECKSUM_SECRET, DEFAULT_CDATA_OEM_KEY_SECRET, DEFAULT_CDATA_SHARED_PROJECT, DOWNLOADS_DIRECTORY, MANAGED_CONTENT_ENDPOINT, MANAGED_CONTENT_KEY
-
-
Constructor Summary
Constructors Constructor Description DriverLoadingJdbcAdapter(java.util.Map<java.lang.String,java.lang.String> sessionOptions, CortexSecretsClient cortexSecretsClient, java.lang.String token, java.lang.String phoenixUrl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
checkDriverInClassPath(java.lang.String driver)
Checks if the JDBC driver is in the class path.java.lang.String
contentKeyForDriver(java.lang.String driver)
Returns the corresponding Key in Managed Content for the JDBC driver name.java.util.Map<java.lang.String,java.lang.String>
getSharedCDataKey()
Returns options for the CData Keys in the Shared Cortex Project.void
includeDriverInClassPath(java.lang.String driver, java.lang.String managedContentKey)
Checks if the JDBC Driver is in the class path and if not includes the corresponding Jar file from Managed Content to the current classpath.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.c12e.cortex.profiles.module.connection.jdbc.JdbcSparkAdapter
jdbcUrlFromDriver, parseCDataPluginProperties
-
-
-
-
Constructor Detail
-
DriverLoadingJdbcAdapter
@Inject public DriverLoadingJdbcAdapter(java.util.Map<java.lang.String,java.lang.String> sessionOptions, CortexSecretsClient cortexSecretsClient, @Named("spark.cortex.phoenix.token") java.lang.String token, @Named("spark.cortex.client.phoenix.url") java.lang.String phoenixUrl)
-
-
Method Detail
-
contentKeyForDriver
public java.lang.String contentKeyForDriver(java.lang.String driver)
Description copied from interface:JdbcSparkAdapter
Returns the corresponding Key in Managed Content for the JDBC driver name.- Specified by:
contentKeyForDriver
in interfaceJdbcSparkAdapter
- Parameters:
driver
- JDBC driver name- Returns:
- Key in Managed Content
-
getSharedCDataKey
public java.util.Map<java.lang.String,java.lang.String> getSharedCDataKey()
Description copied from interface:JdbcSparkAdapter
Returns options for the CData Keys in the Shared Cortex Project.- Specified by:
getSharedCDataKey
in interfaceJdbcSparkAdapter
- Returns:
- Options for CData Keys
-
checkDriverInClassPath
public void checkDriverInClassPath(java.lang.String driver)
Description copied from interface:JdbcSparkAdapter
Checks if the JDBC driver is in the class path.- Specified by:
checkDriverInClassPath
in interfaceJdbcSparkAdapter
- Parameters:
driver
- JDBC Driver name
-
includeDriverInClassPath
public void includeDriverInClassPath(java.lang.String driver, java.lang.String managedContentKey)
Description copied from interface:JdbcSparkAdapter
Checks if the JDBC Driver is in the class path and if not includes the corresponding Jar file from Managed Content to the current classpath.- Specified by:
includeDriverInClassPath
in interfaceJdbcSparkAdapter
- Parameters:
driver
- JDBC Driver namemanagedContentKey
- Key in Managed COntnet
-
-