Class IpfFhirStreamingUploadAutoConfiguration
java.lang.Object
org.openehealth.ipf.boot.fhir.IpfFhirStreamingUploadAutoConfiguration
@Configuration
@ConditionalOnWebApplication
@ConditionalOnProperty(prefix="ipf.fhir.streaming-upload",
name="enabled")
@AutoConfigureAfter(IpfFhirAutoConfiguration.class)
@EnableConfigurationProperties(IpfFhirConfigurationProperties.class)
public class IpfFhirStreamingUploadAutoConfiguration
extends Object
Registers the
Base64SplittingFilter, which streams the document content of a large FHIR upload past
the FHIR parser instead of letting it materialize on the heap.
This is the runtime half of the bridge to the split: the split itself knows nothing about Spring, about configuration properties or about metrics, so everything it needs is assembled here. Two pieces of that are deployment specific and can be contributed as beans:
- a
StreamedDocumentListener, to meter the split - the filter answers to it without having to know about any particular metrics library - a
UnaryOperator<String>namedSTREAMING_UPLOAD_DIAGNOSTICS_POLICY, applied to the diagnostics of a rejection before it is sent. The filter answers a rejected upload itself and therefore bypasses whatever the FHIR servlet's interceptors would have applied, so an application that does not disclose error details to its clients has to redact them here as well.
ipf.fhir.streaming-upload.enabled is set; when off, it is not registered at
all.- Author:
- Christian Ohr
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.boot.web.servlet.FilterRegistrationBean<Base64SplittingFilter> base64SplittingFilterRegistration(IpfFhirConfigurationProperties config, FhirContext fhirContext, ObjectProvider<StreamedDocumentListener> listener, ObjectProvider<UnaryOperator<String>> diagnosticsPolicy)
-
Field Details
-
STREAMING_UPLOAD_DIAGNOSTICS_POLICY
Bean name of theUnaryOperator<String>that the filter applies to the diagnostics of a rejection.- See Also:
-
FILTER_NAME
-
-
Constructor Details
-
IpfFhirStreamingUploadAutoConfiguration
public IpfFhirStreamingUploadAutoConfiguration()
-
-
Method Details
-
base64SplittingFilterRegistration
@Bean @ConditionalOnMissingBean(name="base64SplittingFilterRegistration") public org.springframework.boot.web.servlet.FilterRegistrationBean<Base64SplittingFilter> base64SplittingFilterRegistration(IpfFhirConfigurationProperties config, FhirContext fhirContext, ObjectProvider<StreamedDocumentListener> listener, @Qualifier("streamingUploadDiagnosticsPolicy") ObjectProvider<UnaryOperator<String>> diagnosticsPolicy)
-