Adding configurable properties for max_binary_size

This commit is contained in:
Sean McIlvenna
2020-02-10 15:17:44 -08:00
parent 88445618dd
commit b108ef73e4
2 changed files with 376 additions and 364 deletions

View File

@@ -168,7 +168,13 @@ public class FhirServerConfigCommon {
@Lazy
@Bean
public IBinaryStorageSvc binaryStorageSvc() {
return new DatabaseBlobBinaryStorageSvcImpl();
DatabaseBlobBinaryStorageSvcImpl binaryStorageSvc = new DatabaseBlobBinaryStorageSvcImpl();
if (HapiProperties.getMaxBinarySize() != null) {
binaryStorageSvc.setMaximumBinarySize(HapiProperties.getMaxBinarySize());
}
return binaryStorageSvc;
}
@Bean()

View File

@@ -63,12 +63,13 @@ public class HapiProperties {
static final String ALLOW_CONTAINS_SEARCHES = "allow_contains_searches";
static final String ALLOW_OVERRIDE_DEFAULT_SEARCH_PARAMS = "allow_override_default_search_params";
static final String EMAIL_FROM = "email.from";
private static final String VALIDATE_REQUESTS_ENABLED = "validation.requests.enabled";
private static final String VALIDATE_RESPONSES_ENABLED = "validation.responses.enabled";
private static final String FILTER_SEARCH_ENABLED = "filter_search.enabled";
private static final String GRAPHQL_ENABLED = "graphql.enabled";
private static final String BULK_EXPORT_ENABLED = "bulk.export.enabled";
public static final String EXPIRE_SEARCH_RESULTS_AFTER_MINS = "retain_cached_searches_mins";
static final String VALIDATE_REQUESTS_ENABLED = "validation.requests.enabled";
static final String VALIDATE_RESPONSES_ENABLED = "validation.responses.enabled";
static final String FILTER_SEARCH_ENABLED = "filter_search.enabled";
static final String GRAPHQL_ENABLED = "graphql.enabled";
static final String BULK_EXPORT_ENABLED = "bulk.export.enabled";
static final String EXPIRE_SEARCH_RESULTS_AFTER_MINS = "retain_cached_searches_mins";
static final String MAX_BINARY_SIZE = "max_binary_size";
private static Properties ourProperties;
public static boolean isElasticSearchEnabled() {
@@ -442,6 +443,11 @@ public class HapiProperties {
public static boolean getEnableIndexMissingFields() {
return HapiProperties.getBooleanProperty(ENABLE_INDEX_MISSING_FIELDS, false);
}
public static Integer getMaxBinarySize() {
return getIntegerProperty(MAX_BINARY_SIZE, null);
}
private static boolean getPropertyBoolean(String thePropertyName, boolean theDefaultValue) {
String value = getProperty(thePropertyName, Boolean.toString(theDefaultValue));
return Boolean.parseBoolean(value);