Merge pull request #386 from ehealth-co-id/fix-binary
add BinaryAccessProvider to BaseJpaRestfulServer when binary_storage_enabled is true
This commit is contained in:
@@ -11,6 +11,7 @@ import ca.uhn.fhir.jpa.api.config.DaoConfig;
|
|||||||
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
import ca.uhn.fhir.jpa.api.dao.DaoRegistry;
|
||||||
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
|
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
|
||||||
import ca.uhn.fhir.jpa.binary.interceptor.BinaryStorageInterceptor;
|
import ca.uhn.fhir.jpa.binary.interceptor.BinaryStorageInterceptor;
|
||||||
|
import ca.uhn.fhir.jpa.binary.provider.BinaryAccessProvider;
|
||||||
import ca.uhn.fhir.jpa.bulk.export.provider.BulkDataExportProvider;
|
import ca.uhn.fhir.jpa.bulk.export.provider.BulkDataExportProvider;
|
||||||
import ca.uhn.fhir.jpa.graphql.GraphQLProvider;
|
import ca.uhn.fhir.jpa.graphql.GraphQLProvider;
|
||||||
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
import ca.uhn.fhir.jpa.interceptor.CascadingDeleteInterceptor;
|
||||||
@@ -86,6 +87,8 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
@Autowired
|
@Autowired
|
||||||
BinaryStorageInterceptor binaryStorageInterceptor;
|
BinaryStorageInterceptor binaryStorageInterceptor;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
Optional<BinaryAccessProvider> binaryAccessProvider;
|
||||||
|
@Autowired
|
||||||
IPackageInstallerSvc packageInstallerSvc;
|
IPackageInstallerSvc packageInstallerSvc;
|
||||||
@Autowired
|
@Autowired
|
||||||
AppProperties appProperties;
|
AppProperties appProperties;
|
||||||
@@ -317,7 +320,8 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Binary Storage
|
// Binary Storage
|
||||||
if (appProperties.getBinary_storage_enabled()) {
|
if (appProperties.getBinary_storage_enabled() && binaryAccessProvider.isPresent()) {
|
||||||
|
registerProvider(binaryAccessProvider.get());
|
||||||
getInterceptorService().registerInterceptor(binaryStorageInterceptor);
|
getInterceptorService().registerInterceptor(binaryStorageInterceptor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user