Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,375 changes: 1,375 additions & 0 deletions .extra/q-dev-chat-2025-06-12.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@
<artifactId>guice</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.squareup.retrofit</groupId>
<artifactId>converter-jackson</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,13 @@

package org.nmdp.service.epitope.client;

import static org.junit.Assert.assertNotNull;

import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;

import org.junit.Before;
import org.junit.Test;
import org.nmdp.service.epitope.client.EndpointUrl;
import org.nmdp.service.epitope.client.EpitopeService;
import org.nmdp.service.epitope.client.EpitopeServiceModule;

import static org.junit.Assert.assertNotNull;

/**
* Unit test for EpitopeServiceModule.
Expand Down
5 changes: 2 additions & 3 deletions db/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>11.9.1</version>
<configuration>
<url>jdbc:sqlite:epitope-service.db</url>
</configuration>
<!--
<dependencies>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.8.7</version>
<version>3.42.0.0</version>
</dependency>
</dependencies>
-->
</plugin>
</plugins>
</build>
Expand Down
8 changes: 5 additions & 3 deletions db/src/main/java/db/migration/V2__load_initial_data.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,14 @@

import java.sql.Connection;

import org.flywaydb.core.api.migration.jdbc.JdbcMigration;
import org.flywaydb.core.api.migration.BaseJavaMigration;
import org.flywaydb.core.api.migration.Context;

public class V2__load_initial_data implements JdbcMigration {
public class V2__load_initial_data extends BaseJavaMigration {

@Override
public void migrate(Connection conn) throws Exception {
public void migrate(Context context) throws Exception {
Connection conn = context.getConnection();
loadCsv(conn,
"insert into detail_race (detail_race, broad_race, description) values (?, ?, ?);",
"db/v2/detail_race.csv");
Expand Down
47 changes: 47 additions & 0 deletions dropwizard/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,53 @@
<groupId>org.nmdp.service</groupId>
<artifactId>common-service</artifactId>
</dependency>
<dependency>
<groupId>org.nmdp.service</groupId>
<artifactId>epitope-service</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.nmdp.service</groupId>
<artifactId>epitope-resource-impl</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-core</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard</groupId>
<artifactId>dropwizard-jdbi</artifactId>
</dependency>
<dependency>
<groupId>io.dropwizard.modules</groupId>
<artifactId>dropwizard-flyway</artifactId>
</dependency>
<dependency>
<groupId>io.swagger</groupId>
<artifactId>swagger-jersey2-jaxrs</artifactId>
</dependency>
<dependency>
<groupId>org.nmdp.service</groupId>
<artifactId>common-dropwizard</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>

</dependencies>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,20 @@

package org.nmdp.service.epitope.dropwizard;

import static java.util.concurrent.TimeUnit.MILLISECONDS;

import java.util.Arrays;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;

import org.apache.log4j.Logger;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import io.dropwizard.jdbi.DBIFactory;
import io.dropwizard.jdbi.bundles.DBIExceptionsBundle;
import io.dropwizard.lifecycle.Managed;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.models.Info;
import org.nmdp.service.common.domain.ConfigurationModule;
import org.nmdp.service.common.dropwizard.CommonServiceApplication;
import org.nmdp.service.epitope.guice.ConfigurationBindings;
Expand All @@ -47,33 +53,24 @@
import org.nmdp.service.epitope.task.GGroupInitializer;
import org.nmdp.service.epitope.task.ImmuneGroupInitializer;
import org.skife.jdbi.v2.DBI;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.SerializationFeature;
import com.google.inject.AbstractModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
import com.google.inject.Key;
import java.util.Arrays;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
import java.util.concurrent.ScheduledExecutorService;

import io.dropwizard.db.DataSourceFactory;
import io.dropwizard.flyway.FlywayBundle;
import io.dropwizard.flyway.FlywayFactory;
import io.dropwizard.jdbi.DBIFactory;
import io.dropwizard.jdbi.bundles.DBIExceptionsBundle;
import io.dropwizard.lifecycle.Managed;
import io.dropwizard.setup.Bootstrap;
import io.dropwizard.setup.Environment;
import io.swagger.jaxrs.config.BeanConfig;
import io.swagger.models.Info;
import static java.util.concurrent.TimeUnit.MILLISECONDS;

/**
* Dropwizard main application wrapper
*/
public class EpitopeServiceApplication extends CommonServiceApplication<EpitopeServiceConfiguration> {

Logger log = Logger.getLogger(getClass());


Logger log = LoggerFactory.getLogger(getClass());


/**
* Application main method
*/
Expand All @@ -89,26 +86,45 @@ public String getName() {
/**
* Dropwizard application initialization
*/
@Override
public void initializeService(Bootstrap<EpitopeServiceConfiguration> bootstrap) {
bootstrap.addBundle(new FlywayMigrationBundle<EpitopeServiceConfiguration>() {
@Override
public DataSourceFactory getDataSourceFactory(EpitopeServiceConfiguration configuration) {
return configuration.getDataSourceFactory();
}
});
bootstrap.addBundle(new DBIExceptionsBundle());
bootstrap.addBundle(new FlywayBundle<EpitopeServiceConfiguration>() {
@Override
public DataSourceFactory getDataSourceFactory(EpitopeServiceConfiguration configuration) {
return configuration.getDataSourceFactory();
}
@Override
public FlywayFactory getFlywayFactory(EpitopeServiceConfiguration configuration) {
return configuration.getFlywayFactory();
}
});
}
// @Override
// public void initializeService(Bootstrap<EpitopeServiceConfiguration> bootstrap) {
// bootstrap.addBundle(new FlywayMigrationBundle<EpitopeServiceConfiguration>() {
// @Override
// public DataSourceFactory getDataSourceFactory(EpitopeServiceConfiguration configuration) {
// return configuration.getDataSourceFactory();
// }
// });
// bootstrap.addBundle(new DBIExceptionsBundle());
// bootstrap.addBundle(new FlywayBundle<EpitopeServiceConfiguration>() {
// @Override
// public DataSourceFactory getDataSourceFactory(EpitopeServiceConfiguration configuration) {
// return configuration.getDataSourceFactory();
// }
// @Override
// public FlywayFactory getFlywayFactory(EpitopeServiceConfiguration configuration) {
// return configuration.getFlywayFactory();
// }
// });
// }
@Override
public void initializeService(Bootstrap<EpitopeServiceConfiguration> bootstrap) {
bootstrap.addBundle(new DBIExceptionsBundle());

// Use a type parameter to explicitly specify the configuration type
// TODO: Fix the configuration
// bootstrap.addBundle((io.dropwizard.ConfiguredBundle<EpitopeServiceConfiguration>) new FlywayBundle<io.dropwizard.Configuration>() {
// @Override
// public DataSourceFactory getDataSourceFactory(io.dropwizard.Configuration configuration) {
// return ((EpitopeServiceConfiguration) configuration).getDataSourceFactory();
// }
//
// @Override
// public FlywayFactory getFlywayFactory(io.dropwizard.Configuration configuration) {
// return ((EpitopeServiceConfiguration) configuration).getFlywayFactory();
// }
// });
}


/**
* Dropwizard service runner. Application resources are registered here.
Expand Down Expand Up @@ -219,5 +235,13 @@ public void setupSwagger(BeanConfig beanConfig) {
beanConfig.setInfo(info);
}

// @Override
// public void setupSwagger(BeanConfig beanConfig) {
// Info info = new Info();
// info.setTitle("DPB1 Epitope Service");
// info.setDescription("This service reports on alleles and their associated immunogenicity groups and provides matching functions.");
// beanConfig.setResourcePackage("org.nmdp.service.epitope.resource");
// }


}
Loading