Class CommonUtil
- java.lang.Object
-
- org.linuxforhealth.fhir.schema.app.util.CommonUtil
-
public final class CommonUtil extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description CommonUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
configureLogger()
Set up the logger using the log.dir system propertystatic void
configureLogger(java.lang.String logDir)
Configure the logger to use the given directory.static IDatabaseAdapter
getDbAdapter(DbType dbType, IConnectionProvider connectionProvider)
static IDatabaseAdapter
getDbAdapter(DbType dbType, JdbcTarget target)
static JdbcPropertyAdapter
getPropertyAdapter(DbType dbType, java.util.Properties props)
static java.lang.String
getRandomKey()
Generate a random 32 byte value encoded as a Base64 string (44 characters).static ISchemaAdapter
getSchemaAdapter(SchemaType schemaType, IDatabaseAdapter dbAdapter)
Wrap the given databaseAdapter in an ISchemaAdapter implementation selected by the given schemaTypestatic ISchemaAdapter
getSchemaAdapter(SchemaType schemaType, DbType dbType, IConnectionProvider connectionProvider)
Get the schema adapter which will build the schema variant described by the given schemaTypestatic void
loadDriver(IDatabaseTranslator translator)
Load the driver classstatic void
logClasspath(java.util.logging.Logger logger)
Print the classpath so we can see what on earth is going on with connecting to DB2 using an api key.
-
-
-
Method Detail
-
configureLogger
public static void configureLogger()
Set up the logger using the log.dir system property
-
logClasspath
public static void logClasspath(java.util.logging.Logger logger)
Print the classpath so we can see what on earth is going on with connecting to DB2 using an api key.
-
configureLogger
public static void configureLogger(java.lang.String logDir)
Configure the logger to use the given directory.- Parameters:
logDir
-
-
getRandomKey
public static java.lang.String getRandomKey()
Generate a random 32 byte value encoded as a Base64 string (44 characters).- Returns:
-
loadDriver
public static void loadDriver(IDatabaseTranslator translator)
Load the driver class
-
getPropertyAdapter
public static JdbcPropertyAdapter getPropertyAdapter(DbType dbType, java.util.Properties props)
-
getDbAdapter
public static IDatabaseAdapter getDbAdapter(DbType dbType, JdbcTarget target)
-
getSchemaAdapter
public static ISchemaAdapter getSchemaAdapter(SchemaType schemaType, DbType dbType, IConnectionProvider connectionProvider)
Get the schema adapter which will build the schema variant described by the given schemaType- Parameters:
schemaType
-dbType
-connectionProvider
-- Returns:
-
getSchemaAdapter
public static ISchemaAdapter getSchemaAdapter(SchemaType schemaType, IDatabaseAdapter dbAdapter)
Wrap the given databaseAdapter in an ISchemaAdapter implementation selected by the given schemaType- Parameters:
schemaType
-dbAdapter
-- Returns:
-
getDbAdapter
public static IDatabaseAdapter getDbAdapter(DbType dbType, IConnectionProvider connectionProvider)
-
-