Class Main
- java.lang.Object
-
- org.linuxforhealth.fhir.bucket.app.Main
-
public class Main extends java.lang.ObjectThe fhir-bucket application for loading data from COS into a FHIR server and tracking the returned ids along with response times.
-
-
Constructor Summary
Constructors Constructor Description Main()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddDbProperty(java.lang.String arg)Add the property from the arg given in the form of: param=valuevoidbootstrapDb()Create or update the database schema to the latest definitionvoidcheckConfig()Rudimentary check of the configuration to make sure the basics have been providedvoidconfigure()Set up the database configuration we are going to use to coordinate loading activities.protected VersionHistoryServicecreateVersionHistoryService()Create the version history table and a simple service which is used to access information from it.protected voidloadCosProperties(java.lang.String filename)Load COS properties from the given properties fileprotected voidloadDbProperties(java.lang.String filename)Load DB properties from the given properties fileprotected voidloadFhirClientProperties(java.lang.String filename)Load the FHIR client properties from the given properties filestatic voidmain(java.lang.String[] args)voidparseArgs(java.lang.String[] args)Parse command line argumentsvoidprocess()Choose which mode of the program we want to run: - create the schema - drive reindex - scan and loadprotected voidscanAndLoad()Start the processing threads and wait until we get told to stopvoidsetupDerbyRepository()Set up the connection pool and transaction provider for connecting to a Derby databasevoidsetupPostgresRepository()Set up the connection pool and transaction provider for connecting to a PostgreSQL databaseprotected voidshutdown()Called by the shutdown hook to stop everything in an orderly fashion
-
-
-
Method Detail
-
parseArgs
public void parseArgs(java.lang.String[] args)
Parse command line arguments- Parameters:
args-
-
loadCosProperties
protected void loadCosProperties(java.lang.String filename)
Load COS properties from the given properties file- Parameters:
filename-
-
loadFhirClientProperties
protected void loadFhirClientProperties(java.lang.String filename)
Load the FHIR client properties from the given properties file- Parameters:
filename-
-
loadDbProperties
protected void loadDbProperties(java.lang.String filename)
Load DB properties from the given properties file- Parameters:
filename-
-
addDbProperty
protected void addDbProperty(java.lang.String arg)
Add the property from the arg given in the form of: param=value- Parameters:
arg-
-
checkConfig
public void checkConfig()
Rudimentary check of the configuration to make sure the basics have been provided
-
configure
public void configure()
Set up the database configuration we are going to use to coordinate loading activities. Only one instance should be performing the schema update, so we need a special table which can be used to serialize the schema update process and avoid race conditions.
-
setupDerbyRepository
public void setupDerbyRepository()
Set up the connection pool and transaction provider for connecting to a Derby database
-
setupPostgresRepository
public void setupPostgresRepository()
Set up the connection pool and transaction provider for connecting to a PostgreSQL database
-
createVersionHistoryService
protected VersionHistoryService createVersionHistoryService()
Create the version history table and a simple service which is used to access information from it.- Throws:
java.sql.SQLException
-
bootstrapDb
public void bootstrapDb()
Create or update the database schema to the latest definition
-
shutdown
protected void shutdown()
Called by the shutdown hook to stop everything in an orderly fashion
-
process
public void process()
Choose which mode of the program we want to run: - create the schema - drive reindex - scan and load
-
scanAndLoad
protected void scanAndLoad()
Start the processing threads and wait until we get told to stop
-
main
public static void main(java.lang.String[] args)
- Parameters:
args-
-
-