Class Main
- java.lang.Object
-
- org.linuxforhealth.fhir.bucket.app.Main
-
public class Main extends java.lang.Object
The 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 void
addDbProperty(java.lang.String arg)
Add the property from the arg given in the form of: param=valuevoid
bootstrapDb()
Create or update the database schema to the latest definitionvoid
checkConfig()
Rudimentary check of the configuration to make sure the basics have been providedvoid
configure()
Set up the database configuration we are going to use to coordinate loading activities.protected VersionHistoryService
createVersionHistoryService()
Create the version history table and a simple service which is used to access information from it.protected void
loadCosProperties(java.lang.String filename)
Load COS properties from the given properties fileprotected void
loadDbProperties(java.lang.String filename)
Load DB properties from the given properties fileprotected void
loadFhirClientProperties(java.lang.String filename)
Load the FHIR client properties from the given properties filestatic void
main(java.lang.String[] args)
void
parseArgs(java.lang.String[] args)
Parse command line argumentsvoid
process()
Choose which mode of the program we want to run: - create the schema - drive reindex - scan and loadprotected void
scanAndLoad()
Start the processing threads and wait until we get told to stopvoid
setupDerbyRepository()
Set up the connection pool and transaction provider for connecting to a Derby databasevoid
setupPostgresRepository()
Set up the connection pool and transaction provider for connecting to a PostgreSQL databaseprotected void
shutdown()
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
-
-
-