Skip to content

Commit

Permalink
issue #3136 moved reconciliation app to its own project
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Arnold <[email protected]>
  • Loading branch information
punktilious committed Feb 23, 2022
1 parent 9786f6b commit 960d880
Show file tree
Hide file tree
Showing 6 changed files with 225 additions and 54 deletions.
1 change: 1 addition & 0 deletions fhir-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
<module>../fhir-persistence-cassandra</module>
<module>../fhir-persistence-cassandra-app</module>
<module>../fhir-persistence-blob</module>
<module>../fhir-persistence-blob-app</module>
<module>../fhir-provider</module>
<module>../cql</module>
<module>../operation/fhir-operation-test</module>
Expand Down
181 changes: 181 additions & 0 deletions fhir-persistence-blob-app/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,181 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<artifactId>fhir-persistence-blob-app</artifactId>

<parent>
<groupId>com.ibm.fhir</groupId>
<artifactId>fhir-parent</artifactId>
<version>4.11.0-SNAPSHOT</version>
<relativePath>../fhir-parent</relativePath>
</parent>

<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-persistence</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-examples</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-persistence-schema</artifactId>
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-persistence-jdbc</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-config</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-model</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-path</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-persistence-blob</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-validation</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-validation</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-model</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-persistence</artifactId>
<version>${project.version}</version>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>fhir-search</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>jakarta.transaction</groupId>
<artifactId>jakarta.transaction-api</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<exclusions>
<exclusion>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-okhttp</artifactId>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
</dependency>
<!-- The specific DB driver jars are marked as optional; must be re-declared by consuming modules -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<optional>true</optional>
</dependency>
<!-- End of optional DB drivers -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.skyscreamer</groupId>
<artifactId>jsonassert</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<shadedArtifactAttached>true</shadedArtifactAttached>
<shadedClassifierName>cli</shadedClassifierName>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>com.ibm.fhir.persistence.blob.app.Main</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

import com.ibm.fhir.config.FHIRConfiguration;
import com.ibm.fhir.database.utils.model.DbType;
import com.ibm.fhir.persistence.blob.BlobContainerManager;

/**
* Standalone application to provide support services (like reconciliation) for
Expand All @@ -24,9 +25,6 @@
public class Main {
private static final Logger logger = Logger.getLogger(Main.class.getName());

// properties to configure the application
private final Properties applicationProperties = new Properties();

// properties for connecting to the database
private final Properties databaseProperties = new Properties();

Expand Down Expand Up @@ -63,13 +61,6 @@ protected void parseArgs(String[] args) {
throw new IllegalArgumentException("Missing value for --continuation-token");
}
break;
case "--app-properties":
if (++i < args.length) {
readApplicationProperties(args[i]);
} else {
throw new IllegalArgumentException("missing value for --app-properties");
}
break;
case "--db-properties":
if (++i < args.length) {
readDatabaseProperties(args[i]);
Expand Down Expand Up @@ -118,18 +109,6 @@ protected void parseArgs(String[] args) {
}
}

/**
* Read application properties from the given filename
* @param filename
*/
protected void readApplicationProperties(String filename) {
try (InputStream is = new FileInputStream(filename)) {
applicationProperties.load(is);
} catch (IOException x) {
throw new IllegalArgumentException(x);
}
}

/**
* Read database properties from the given filename
* @param filename
Expand Down Expand Up @@ -176,6 +155,13 @@ protected void runReconciliation() throws Exception {
}
}

/**
* Shut down any thread pools so we can make a quick exit
*/
protected void terminate() {
BlobContainerManager.shutdown();
}

/**
* Entry point
* @param args
Expand All @@ -185,6 +171,7 @@ public static void main(String[] args) {
try {
m.parseArgs(args);
m.process();
m.terminate();
} catch (Exception x) {
logger.log(Level.SEVERE, "failed", x);
System.exit(-1);
Expand Down
22 changes: 0 additions & 22 deletions fhir-persistence-blob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,28 +103,6 @@
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
</dependency>
<!-- The specific DB driver jars are marked as optional; must be re-declared by consuming modules -->
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derby</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.apache.derby</groupId>
<artifactId>derbytools</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>com.ibm.db2</groupId>
<artifactId>jcc</artifactId>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<optional>true</optional>
</dependency>
<!-- End of optional DB drivers -->
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
Expand Down
Loading

0 comments on commit 960d880

Please sign in to comment.