add property to turn on userRequestRetryVersionConflictsInterceptor (#752)

This commit is contained in:
craig mcclendon
2024-11-11 13:29:54 -06:00
committed by GitHub
parent 5d84d9fc59
commit 69fede99a4
4 changed files with 181 additions and 3 deletions

View File

@@ -106,8 +106,9 @@ public class AppProperties {
private final List<String> custom_provider_classes = new ArrayList<>();
private Boolean upliftedRefchains_enabled = false;
private List<Integer> search_prefetch_thresholds = new ArrayList<>();
private boolean userRequestRetryVersionConflictsInterceptorEnabled = false;
private List<Integer> search_prefetch_thresholds = new ArrayList<>();
public List<String> getCustomInterceptorClasses() {
return custom_interceptor_classes;
@@ -671,6 +672,14 @@ public Cors getCors() {
this.upliftedRefchains_enabled = upliftedRefchains_enabled;
}
public Boolean getUserRequestRetryVersionConflictsInterceptorEnabled() {
return userRequestRetryVersionConflictsInterceptorEnabled;
}
public void setUserRequestRetryVersionConflictsInterceptorEnabled(Boolean userRequestRetryVersionConflictsInterceptorEnabled) {
this.userRequestRetryVersionConflictsInterceptorEnabled = userRequestRetryVersionConflictsInterceptorEnabled;
}
public static class Cors {
private Boolean allow_Credentials = true;
private List<String> allowed_origin = List.of("*");
@@ -690,8 +699,6 @@ public Cors getCors() {
public void setAllow_Credentials(Boolean allow_Credentials) {
this.allow_Credentials = allow_Credentials;
}
}
public static class Logger {

View File

@@ -28,6 +28,7 @@ import ca.uhn.fhir.jpa.dao.search.IHSearchSortHelper;
import ca.uhn.fhir.jpa.delete.ThreadSafeResourceDeleterSvc;
import ca.uhn.fhir.jpa.graphql.GraphQLProvider;
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
import ca.uhn.fhir.jpa.interceptor.UserRequestRetryVersionConflictsInterceptor;
import ca.uhn.fhir.jpa.interceptor.validation.RepositoryValidatingInterceptor;
import ca.uhn.fhir.jpa.ips.provider.IpsOperationProvider;
import ca.uhn.fhir.jpa.model.config.SubscriptionSettings;
@@ -457,6 +458,10 @@ public class StarterJpaConfig {
fhirServer.registerProvider(theIpsOperationProvider.get());
}
if (appProperties.getUserRequestRetryVersionConflictsInterceptorEnabled() ) {
fhirServer.registerInterceptor(new UserRequestRetryVersionConflictsInterceptor());
}
// register custom providers
registerCustomProviders(fhirServer, appContext, appProperties.getCustomProviderClasses());