Skip to content

Commit

Permalink
[DUOS-2775][risk=no] Remove outdated/deprecated consent and summary c…
Browse files Browse the repository at this point in the history
…ode. (#2189)
  • Loading branch information
rushtong authored Dec 5, 2023
1 parent 380584b commit ca77785
Show file tree
Hide file tree
Showing 52 changed files with 456 additions and 3,599 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,6 @@
import org.broadinstitute.consent.http.resources.VersionResource;
import org.broadinstitute.consent.http.resources.VoteResource;
import org.broadinstitute.consent.http.service.AcknowledgementService;
import org.broadinstitute.consent.http.service.AuditService;
import org.broadinstitute.consent.http.service.ConsentService;
import org.broadinstitute.consent.http.service.DacService;
import org.broadinstitute.consent.http.service.DarCollectionService;
import org.broadinstitute.consent.http.service.DataAccessRequestService;
Expand All @@ -92,7 +90,6 @@
import org.broadinstitute.consent.http.service.MatchService;
import org.broadinstitute.consent.http.service.MetricsService;
import org.broadinstitute.consent.http.service.NihService;
import org.broadinstitute.consent.http.service.SummaryService;
import org.broadinstitute.consent.http.service.SupportRequestService;
import org.broadinstitute.consent.http.service.TDRService;
import org.broadinstitute.consent.http.service.UserService;
Expand Down Expand Up @@ -160,7 +157,6 @@ public void run(ConsentConfiguration config, Environment env) {
final HttpClientUtil clientUtil = new HttpClientUtil(config.getServicesConfiguration());

// Services
final ConsentService consentService = injector.getProvider(ConsentService.class).get();
final DarCollectionService darCollectionService = injector.getProvider(
DarCollectionService.class).get();
final DacService dacService = injector.getProvider(DacService.class).get();
Expand All @@ -177,8 +173,6 @@ public void run(ConsentConfiguration config, Environment env) {
final MetricsService metricsService = injector.getProvider(MetricsService.class).get();
final UserService userService = injector.getProvider(UserService.class).get();
final VoteService voteService = injector.getProvider(VoteService.class).get();
final AuditService auditService = injector.getProvider(AuditService.class).get();
final SummaryService summaryService = injector.getProvider(SummaryService.class).get();
final MatchService matchService = injector.getProvider(MatchService.class).get();
final OAuthAuthenticator authenticator = injector.getProvider(OAuthAuthenticator.class).get();
final LibraryCardService libraryCardService = injector.getProvider(LibraryCardService.class)
Expand Down Expand Up @@ -224,14 +218,13 @@ public void run(ConsentConfiguration config, Environment env) {
env.jersey().register(new DatasetResource(datasetService, userService, dataAccessRequestService,
datasetRegistrationService, elasticSearchService));
env.jersey().register(new DatasetAssociationsResource(datasetAssociationService));
env.jersey()
.register(new ConsentResource(auditService, userService, consentService, matchService));
env.jersey().register(new ConsentCasesResource(summaryService));
env.jersey().register(injector.getInstance(ConsentResource.class));
env.jersey().register(injector.getInstance(ConsentCasesResource.class));
env.jersey().register(new DacResource(dacService, userService, datasetService));
env.jersey().register(new DACUserResource(userService));
env.jersey().register(
new DarCollectionResource(darCollectionService, userService));
env.jersey().register(new DataRequestCasesResource(summaryService));
env.jersey().register(injector.getInstance(DataRequestCasesResource.class));
env.jersey().register(new DataRequestReportsResource(dataAccessRequestService));
env.jersey().register(new EmailNotifierResource(emailService));
env.jersey().register(new InstitutionResource(userService, institutionService));
Expand Down
51 changes: 0 additions & 51 deletions src/main/java/org/broadinstitute/consent/http/ConsentModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import org.broadinstitute.consent.http.cloudstore.GCSService;
import org.broadinstitute.consent.http.configurations.ConsentConfiguration;
import org.broadinstitute.consent.http.db.AcknowledgementDAO;
import org.broadinstitute.consent.http.db.ConsentAuditDAO;
import org.broadinstitute.consent.http.db.ConsentDAO;
import org.broadinstitute.consent.http.db.CounterDAO;
import org.broadinstitute.consent.http.db.DAOContainer;
import org.broadinstitute.consent.http.db.DacDAO;
Expand All @@ -37,8 +35,6 @@
import org.broadinstitute.consent.http.mail.SendGridAPI;
import org.broadinstitute.consent.http.mail.freemarker.FreeMarkerTemplateHelper;
import org.broadinstitute.consent.http.service.AcknowledgementService;
import org.broadinstitute.consent.http.service.AuditService;
import org.broadinstitute.consent.http.service.ConsentService;
import org.broadinstitute.consent.http.service.CounterService;
import org.broadinstitute.consent.http.service.DacService;
import org.broadinstitute.consent.http.service.DarCollectionService;
Expand All @@ -57,7 +53,6 @@
import org.broadinstitute.consent.http.service.NihService;
import org.broadinstitute.consent.http.service.OntologyService;
import org.broadinstitute.consent.http.service.ResearcherService;
import org.broadinstitute.consent.http.service.SummaryService;
import org.broadinstitute.consent.http.service.SupportRequestService;
import org.broadinstitute.consent.http.service.UseRestrictionConverter;
import org.broadinstitute.consent.http.service.UserService;
Expand Down Expand Up @@ -87,7 +82,6 @@ public class ConsentModule extends AbstractModule {

private final Client client;
private final Jdbi jdbi;
private final ConsentDAO consentDAO;
private final CounterDAO counterDAO;
private final ElectionDAO electionDAO;
private final VoteDAO voteDAO;
Expand All @@ -100,7 +94,6 @@ public class ConsentModule extends AbstractModule {
private final MatchDAO matchDAO;
private final MailMessageDAO mailMessageDAO;
private final UserPropertyDAO userPropertyDAO;
private final ConsentAuditDAO consentAuditDAO;
private final DataAccessRequestDAO dataAccessRequestDAO;
private final DarCollectionDAO darCollectionDAO;
private final DarCollectionSummaryDAO darCollectionSummaryDAO;
Expand All @@ -124,7 +117,6 @@ public class ConsentModule extends AbstractModule {
jdbi.installPlugin(new GuavaPlugin());
jdbi.getConfig().get(Gson2Config.class).setGson(GsonUtil.buildGson());

this.consentDAO = this.jdbi.onDemand(ConsentDAO.class);
this.counterDAO = this.jdbi.onDemand(CounterDAO.class);
this.electionDAO = this.jdbi.onDemand(ElectionDAO.class);
this.voteDAO = this.jdbi.onDemand(VoteDAO.class);
Expand All @@ -137,7 +129,6 @@ public class ConsentModule extends AbstractModule {
this.matchDAO = this.jdbi.onDemand(MatchDAO.class);
this.mailMessageDAO = this.jdbi.onDemand(MailMessageDAO.class);
this.userPropertyDAO = this.jdbi.onDemand(UserPropertyDAO.class);
this.consentAuditDAO = this.jdbi.onDemand(ConsentAuditDAO.class);
this.dataAccessRequestDAO = this.jdbi.onDemand(DataAccessRequestDAO.class);
this.darCollectionDAO = this.jdbi.onDemand(DarCollectionDAO.class);
this.darCollectionSummaryDAO = this.jdbi.onDemand(DarCollectionSummaryDAO.class);
Expand All @@ -156,8 +147,6 @@ protected void configure() {
@Provides
public DAOContainer providesDAOContainer() {
DAOContainer container = new DAOContainer();
container.setConsentAuditDAO(providesConsentAuditDAO());
container.setConsentDAO(providesConsentDAO());
container.setCounterDAO(providesCounterDAO());
container.setDacDAO(providesDacDAO());
container.setDataAccessRequestDAO(providesDataAccessRequestDAO());
Expand Down Expand Up @@ -209,13 +198,6 @@ OAuthAuthenticator providesOAuthAuthenticator() {
return new OAuthAuthenticator(providesClient(), providesSamService());
}

@Provides
AuditService providesAuditService() {
return new AuditService(
providesUserDAO(),
providesConsentAuditDAO());
}

@Provides
DarCollectionService providesDarCollectionService() {
return new DarCollectionService(
Expand Down Expand Up @@ -244,18 +226,6 @@ GCSService providesGCSService() {
return new GCSService(config.getCloudStoreConfiguration());
}

@Provides
ConsentService providesConsentService() {
return new ConsentService(
providesConsentDAO(),
providesElectionDAO());
}

@Provides
ConsentDAO providesConsentDAO() {
return consentDAO;
}

@Provides
CounterDAO providesCounterDAO() {
return counterDAO;
Expand Down Expand Up @@ -322,7 +292,6 @@ FreeMarkerTemplateHelper providesFreeMarkerTemplateHelper() {
EmailService providesEmailService() {
return new EmailService(
providesDARCollectionDAO(),
providesConsentDAO(),
providesVoteDAO(),
providesElectionDAO(),
providesUserDAO(),
Expand Down Expand Up @@ -465,7 +434,6 @@ MatchService providesMatchService() {
return new MatchService(
providesClient(),
config.getServicesConfiguration(),
providesConsentDAO(),
providesMatchDAO(),
providesDataAccessRequestDAO(),
providesDatasetDAO(),
Expand Down Expand Up @@ -499,11 +467,6 @@ UserPropertyDAO providesUserPropertyDAO() {
return userPropertyDAO;
}

@Provides
ConsentAuditDAO providesConsentAuditDAO() {
return consentAuditDAO;
}

@Provides
InstitutionDAO providesInstitutionDAO() {
return institutionDAO;
Expand Down Expand Up @@ -603,20 +566,6 @@ NihServiceDAO providesNIHServiceDAO() {
return new NihServiceDAO(jdbi);
}

@Provides
SummaryService providesSummaryService() {
return new SummaryService(
providesDataAccessRequestService(),
providesVoteDAO(),
providesElectionDAO(),
providesUserDAO(),
providesConsentDAO(),
providesDatasetDAO(),
providesMatchDAO(),
providesDARCollectionDAO()
);
}

@Provides
SamService providesSamService() {
return new SamService(providesSamDAO());
Expand Down

This file was deleted.

100 changes: 0 additions & 100 deletions src/main/java/org/broadinstitute/consent/http/db/ConsentDAO.java

This file was deleted.

18 changes: 0 additions & 18 deletions src/main/java/org/broadinstitute/consent/http/db/DAOContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
@SuppressWarnings("unused")
public class DAOContainer {

private ConsentDAO consentDAO;
private CounterDAO counterDAO;
private DacDAO dacDAO;
private DataAccessRequestDAO dataAccessRequestDAO;
Expand All @@ -23,19 +22,10 @@ public class DAOContainer {
private UserRoleDAO userRoleDAO;
private VoteDAO voteDAO;
private StudyDAO studyDAO;
private ConsentAuditDAO consentAuditDAO;
private InstitutionDAO institutionDAO;
private FileStorageObjectDAO fileStorageObjectDAO;
private AcknowledgementDAO acknowledgementDAO;

public ConsentDAO getConsentDAO() {
return consentDAO;
}

public void setConsentDAO(ConsentDAO consentDAO) {
this.consentDAO = consentDAO;
}

public CounterDAO getCounterDAO() {
return counterDAO;
}
Expand Down Expand Up @@ -162,14 +152,6 @@ public void setStudyDAO(StudyDAO studyDAO) {
this.studyDAO = studyDAO;
}

public ConsentAuditDAO getConsentAuditDAO() {
return consentAuditDAO;
}

public void setConsentAuditDAO(ConsentAuditDAO consentAuditDAO) {
this.consentAuditDAO = consentAuditDAO;
}

public InstitutionDAO getInstitutionDAO() {
return institutionDAO;
}
Expand Down
Loading

0 comments on commit ca77785

Please sign in to comment.