Skip to content

Commit

Permalink
Extract Subscription Settings from Storage Settings (#5887)
Browse files Browse the repository at this point in the history
* first cut

* first cut

* cleanup

* that took way too long

* fix test

* licenses

* merge master

* merge master

* changelog

* review feedback

* bump version
  • Loading branch information
fil512 committed Jun 15, 2024
1 parent 024d848 commit 57d1815
Show file tree
Hide file tree
Showing 149 changed files with 727 additions and 542 deletions.
2 changes: 1 addition & 1 deletion hapi-deployable-pom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-android/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
4 changes: 2 additions & 2 deletions hapi-fhir-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
<modelVersion>4.0.0</modelVersion>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-bom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<packaging>pom</packaging>
<name>HAPI FHIR BOM</name>

<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-checkstyle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/hapi-fhir-cli-app/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client-okhttp/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-converter/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-dist/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
type: change
issue: 5887
title: "Extract Subscription Settings from Storage Settings so they can be managed independently."
2 changes: 1 addition & 1 deletion hapi-fhir-jacoco/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jaxrsserver-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import ca.uhn.fhir.jpa.dao.SearchBuilderFactory;
import ca.uhn.fhir.jpa.dao.mdm.MdmExpansionCacheSvc;
import ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService;
import ca.uhn.fhir.jpa.entity.MdmLink;
import ca.uhn.fhir.jpa.model.dao.JpaPid;
import ca.uhn.fhir.jpa.model.search.SearchBuilderLoadIncludesParameters;
import ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails;
Expand Down Expand Up @@ -109,9 +110,8 @@ public class JpaBulkExportProcessor implements IBulkExportProcessor<JpaPid> {
@Autowired
private IIdHelperService<JpaPid> myIdHelperService;

@SuppressWarnings("rawtypes")
@Autowired
protected IMdmLinkDao myMdmLinkDao;
protected IMdmLinkDao<JpaPid, MdmLink> myMdmLinkDao;

@Autowired
private MdmExpansionCacheSvc myMdmExpansionCacheSvc;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@
import ca.uhn.fhir.jpa.bulk.export.api.IBulkExportProcessor;
import ca.uhn.fhir.jpa.bulk.export.svc.BulkExportHelperService;
import ca.uhn.fhir.jpa.bulk.export.svc.JpaBulkExportProcessor;
import ca.uhn.fhir.jpa.model.dao.JpaPid;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class JpaBulkExportConfig {
@Bean
public IBulkExportProcessor jpaBulkExportProcessor() {
public IBulkExportProcessor<JpaPid> jpaBulkExportProcessor() {
return new JpaBulkExportProcessor();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ public class RequestPartitionHelperSvc extends BaseRequestPartitionHelperSvc {
@Autowired
IPartitionLookupSvc myPartitionConfigSvc;

public RequestPartitionHelperSvc() {}

@Override
public RequestPartitionId validateAndNormalizePartitionIds(RequestPartitionId theRequestPartitionId) {
List<String> names = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,6 @@ protected void postProcess(FhirTerser theTerser, IBaseConformance theCapabilityS
theTerser.addElement(theCapabilityStatement, "patchFormat", Constants.CT_XML_PATCH);
}

@Override
protected void postProcessRest(FhirTerser theTerser, IBase theRest) {
super.postProcessRest(theTerser, theRest);

if (myStorageSettings
.getSupportedSubscriptionTypes()
.contains(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET)) {
if (isNotBlank(myStorageSettings.getWebsocketContextPath())) {
ExtensionUtil.setExtension(
myContext,
theRest,
Constants.CAPABILITYSTATEMENT_WEBSOCKET_URL,
"uri",
myStorageSettings.getWebsocketContextPath());
}
}
}

@Override
protected void postProcessRestResource(FhirTerser theTerser, IBase theResource, String theResourceName) {
super.postProcessRestResource(theTerser, theResource, theResourceName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.util.ResourceCountCache;
import ca.uhn.fhir.model.api.ExtensionDt;
import ca.uhn.fhir.model.dstu2.composite.MetaDt;
import ca.uhn.fhir.model.dstu2.resource.Bundle;
import ca.uhn.fhir.model.dstu2.resource.Conformance;
Expand All @@ -37,15 +36,12 @@
import ca.uhn.fhir.model.dstu2.valueset.SearchParamTypeEnum;
import ca.uhn.fhir.model.primitive.BoundCodeDt;
import ca.uhn.fhir.model.primitive.DecimalDt;
import ca.uhn.fhir.model.primitive.UriDt;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.provider.dstu2.ServerConformanceProvider;
import ca.uhn.fhir.util.CoverageIgnore;
import ca.uhn.fhir.util.ExtensionConstants;
import jakarta.servlet.http.HttpServletRequest;
import org.hl7.fhir.dstu2.model.Subscription;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -135,17 +131,6 @@ public Conformance getServerConformance(HttpServletRequest theRequest, RequestDe
}
}

if (myStorageSettings
.getSupportedSubscriptionTypes()
.contains(Subscription.SubscriptionChannelType.WEBSOCKET)) {
if (isNotBlank(myStorageSettings.getWebsocketContextPath())) {
ExtensionDt websocketExtension = new ExtensionDt();
websocketExtension.setUrl(Constants.CAPABILITYSTATEMENT_WEBSOCKET_URL);
websocketExtension.setValue(new UriDt(myStorageSettings.getWebsocketContextPath()));
retVal.getRestFirstRep().addUndeclaredExtension(websocketExtension);
}
}

if (isNotBlank(myImplementationDescription)) {
retVal.getImplementation().setDescription(myImplementationDescription);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
import org.hl7.fhir.dstu3.model.Enumerations.SearchParamType;
import org.hl7.fhir.dstu3.model.Extension;
import org.hl7.fhir.dstu3.model.Meta;
import org.hl7.fhir.dstu3.model.UriType;

import java.util.Collections;
import java.util.List;
Expand Down Expand Up @@ -176,17 +175,6 @@ public CapabilityStatement getServerConformance(HttpServletRequest theRequest, R

massage(retVal);

if (myStorageSettings
.getSupportedSubscriptionTypes()
.contains(org.hl7.fhir.dstu2.model.Subscription.SubscriptionChannelType.WEBSOCKET)) {
if (isNotBlank(myStorageSettings.getWebsocketContextPath())) {
Extension websocketExtension = new Extension();
websocketExtension.setUrl(Constants.CAPABILITYSTATEMENT_WEBSOCKET_URL);
websocketExtension.setValue(new UriType(myStorageSettings.getWebsocketContextPath()));
retVal.getRestFirstRep().addExtension(websocketExtension);
}
}

retVal.getImplementation().setDescription(myImplementationDescription);
myCachedValue = retVal;
return retVal;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class JpaHapiTransactionService extends HapiTransactionService {

private volatile Boolean myCustomIsolationSupported;

public JpaHapiTransactionService() {}

@Override
public boolean isCustomIsolationSupported() {
if (myCustomIsolationSupported == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import ca.uhn.fhir.jpa.dao.mdm.MdmExpansionCacheSvc;
import ca.uhn.fhir.jpa.dao.tx.IHapiTransactionService;
import ca.uhn.fhir.jpa.dao.tx.NonTransactionalHapiTransactionService;
import ca.uhn.fhir.jpa.entity.MdmLink;
import ca.uhn.fhir.jpa.model.dao.JpaPid;
import ca.uhn.fhir.jpa.model.search.SearchBuilderLoadIncludesParameters;
import ca.uhn.fhir.jpa.model.search.SearchRuntimeDetails;
Expand Down Expand Up @@ -138,7 +139,7 @@ public JpaPid next() {
private IIdHelperService<JpaPid> myIdHelperService;

@Mock
private IMdmLinkDao<JpaPid,?> myMdmLinkDao;
private IMdmLinkDao<JpaPid, MdmLink> myMdmLinkDao;

@Mock
private MdmExpansionCacheSvc myMdmExpansionCacheSvc;
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-elastic-test-utilities/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-hfql/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import org.mockito.Spy;
import org.mockito.junit.jupiter.MockitoExtension;

import javax.annotation.Nonnull;
import jakarta.annotation.Nonnull;
import java.util.ArrayList;
import java.util.List;

Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-ips/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>

<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion hapi-fhir-jpaserver-mdm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>7.3.5-SNAPSHOT</version>
<version>7.3.6-SNAPSHOT</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import ca.uhn.fhir.jpa.api.config.JpaStorageSettings;
import ca.uhn.fhir.jpa.mdm.helper.MdmHelperR4;
import ca.uhn.fhir.jpa.model.config.SubscriptionSettings;
import ca.uhn.fhir.jpa.subscription.channel.config.SubscriptionChannelConfig;
import ca.uhn.fhir.jpa.subscription.submit.config.SubscriptionSubmitterConfig;
import ca.uhn.fhir.jpa.test.config.TestSubscriptionMatcherInterceptorConfig;
Expand All @@ -19,8 +20,8 @@ MdmHelperR4 mdmHelperR4() {

@Primary
@Bean
public JpaStorageSettings storageSettings() {
JpaStorageSettings retVal = new JpaStorageSettings();
public SubscriptionSettings subscriptionSettings() {
SubscriptionSettings retVal = new SubscriptionSettings();

retVal.addSupportedSubscriptionType(Subscription.SubscriptionChannelType.MESSAGE);

Expand Down
Loading

0 comments on commit 57d1815

Please sign in to comment.