Merge pull request #200 from jtheory/feature/issue-186_config_tidyup
issue 186: minor fixes in partitioning config
This commit is contained in:
@@ -8,9 +8,9 @@ import ca.uhn.fhir.rest.api.EncodingEnum;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.ImmutableMap;
|
|
||||||
import org.hl7.fhir.r4.model.Bundle;
|
import org.hl7.fhir.r4.model.Bundle;
|
||||||
|
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
@@ -30,7 +30,7 @@ public class AppProperties {
|
|||||||
private Boolean allow_multiple_delete = false;
|
private Boolean allow_multiple_delete = false;
|
||||||
private Boolean allow_override_default_search_params = true;
|
private Boolean allow_override_default_search_params = true;
|
||||||
private Boolean allow_placeholder_references = true;
|
private Boolean allow_placeholder_references = true;
|
||||||
private Boolean auto_create_placeholder_reference_targets = true;
|
private Boolean auto_create_placeholder_reference_targets = false;
|
||||||
private Boolean enable_index_missing_fields = false;
|
private Boolean enable_index_missing_fields = false;
|
||||||
private Boolean enforce_referential_integrity_on_delete = true;
|
private Boolean enforce_referential_integrity_on_delete = true;
|
||||||
private Boolean enforce_referential_integrity_on_write = true;
|
private Boolean enforce_referential_integrity_on_write = true;
|
||||||
@@ -365,7 +365,11 @@ public class AppProperties {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setReuse_cached_search_results_millis(Long reuse_cached_search_results_millis) {
|
public void setReuse_cached_search_results_millis(Long reuse_cached_search_results_millis) {
|
||||||
this.reuse_cached_search_results_millis = reuse_cached_search_results_millis;
|
if (Objects.equals(reuse_cached_search_results_millis, 0L)) {
|
||||||
|
this.reuse_cached_search_results_millis = null;
|
||||||
|
} else {
|
||||||
|
this.reuse_cached_search_results_millis = reuse_cached_search_results_millis;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<String, Tester> getTester() {
|
public Map<String, Tester> getTester() {
|
||||||
@@ -554,7 +558,7 @@ public class AppProperties {
|
|||||||
public static class Partitioning {
|
public static class Partitioning {
|
||||||
|
|
||||||
private Boolean partitioning_include_in_search_hashes = false;
|
private Boolean partitioning_include_in_search_hashes = false;
|
||||||
|
private Boolean allow_references_across_partitions = false;
|
||||||
|
|
||||||
public Boolean getPartitioning_include_in_search_hashes() {
|
public Boolean getPartitioning_include_in_search_hashes() {
|
||||||
return partitioning_include_in_search_hashes;
|
return partitioning_include_in_search_hashes;
|
||||||
@@ -563,6 +567,13 @@ public class AppProperties {
|
|||||||
public void setPartitioning_include_in_search_hashes(Boolean partitioning_include_in_search_hashes) {
|
public void setPartitioning_include_in_search_hashes(Boolean partitioning_include_in_search_hashes) {
|
||||||
this.partitioning_include_in_search_hashes = partitioning_include_in_search_hashes;
|
this.partitioning_include_in_search_hashes = partitioning_include_in_search_hashes;
|
||||||
}
|
}
|
||||||
|
public Boolean getAllow_references_across_partitions() {
|
||||||
|
return allow_references_across_partitions;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setAllow_references_across_partitions(Boolean allow_references_across_partitions) {
|
||||||
|
this.allow_references_across_partitions = allow_references_across_partitions;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Subscription {
|
public static class Subscription {
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import ca.uhn.fhir.jpa.binstore.DatabaseBlobBinaryStorageSvcImpl;
|
|||||||
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
|
import ca.uhn.fhir.jpa.binstore.IBinaryStorageSvc;
|
||||||
import ca.uhn.fhir.jpa.config.HibernateDialectProvider;
|
import ca.uhn.fhir.jpa.config.HibernateDialectProvider;
|
||||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||||
|
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
||||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
||||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||||
@@ -77,7 +78,6 @@ public class FhirServerConfigCommon {
|
|||||||
retVal.setAllowMultipleDelete(appProperties.getAllow_multiple_delete());
|
retVal.setAllowMultipleDelete(appProperties.getAllow_multiple_delete());
|
||||||
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
|
retVal.setAllowExternalReferences(appProperties.getAllow_external_references());
|
||||||
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
|
retVal.setExpungeEnabled(appProperties.getExpunge_enabled());
|
||||||
retVal.setAutoCreatePlaceholderReferenceTargets(appProperties.getAllow_placeholder_references());
|
|
||||||
if(appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
|
if(appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null)
|
||||||
retVal.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
|
retVal.setEmailFromAddress(appProperties.getSubscription().getEmail().getFrom());
|
||||||
|
|
||||||
@@ -126,6 +126,12 @@ public class FhirServerConfigCommon {
|
|||||||
// Partitioning
|
// Partitioning
|
||||||
if (appProperties.getPartitioning() != null) {
|
if (appProperties.getPartitioning() != null) {
|
||||||
retVal.setPartitioningEnabled(true);
|
retVal.setPartitioningEnabled(true);
|
||||||
|
retVal.setIncludePartitionInSearchHashes(appProperties.getPartitioning().getPartitioning_include_in_search_hashes());
|
||||||
|
if(appProperties.getPartitioning().getAllow_references_across_partitions()) {
|
||||||
|
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.ALLOWED_UNQUALIFIED);
|
||||||
|
} else {
|
||||||
|
retVal.setAllowReferencesAcrossPartitions(CrossPartitionReferenceMode.NOT_ALLOWED);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal;
|
return retVal;
|
||||||
|
|||||||
@@ -68,9 +68,8 @@ hapi:
|
|||||||
# graphql_enabled: true
|
# graphql_enabled: true
|
||||||
# narrative_enabled: true
|
# narrative_enabled: true
|
||||||
#partitioning:
|
#partitioning:
|
||||||
# cross_partition_reference_mode: true
|
# allow_references_across_partitions: false
|
||||||
# multitenancy_enabled: true
|
# partitioning_include_in_search_hashes: false
|
||||||
# partitioning_include_in_search_hashes: true
|
|
||||||
#cors:
|
#cors:
|
||||||
# allow_Credentials: true
|
# allow_Credentials: true
|
||||||
# Supports multiple, comma separated allowed origin entries
|
# Supports multiple, comma separated allowed origin entries
|
||||||
@@ -109,7 +108,6 @@ hapi:
|
|||||||
# responses_enabled: true
|
# responses_enabled: true
|
||||||
# binary_storage_enabled: true
|
# binary_storage_enabled: true
|
||||||
# bulk_export_enabled: true
|
# bulk_export_enabled: true
|
||||||
# partitioning_multitenancy_enabled:
|
|
||||||
# subscription:
|
# subscription:
|
||||||
# resthook_enabled: false
|
# resthook_enabled: false
|
||||||
# websocket_enabled: false
|
# websocket_enabled: false
|
||||||
|
|||||||
Reference in New Issue
Block a user