Fix for bean scope inconsistenices
This commit is contained in:
parent
5f97428d38
commit
03643a7b3c
|
@ -22,6 +22,7 @@ package ca.uhn.fhir.jpa.mdm.config;
|
|||
|
||||
import ca.uhn.fhir.context.FhirContext;
|
||||
import ca.uhn.fhir.mdm.api.IMdmChannelSubmitterSvc;
|
||||
import ca.uhn.fhir.mdm.api.IMdmSettings;
|
||||
import ca.uhn.fhir.mdm.api.IMdmSubmitSvc;
|
||||
import ca.uhn.fhir.mdm.rules.config.MdmRuleValidator;
|
||||
import ca.uhn.fhir.jpa.dao.mdm.MdmLinkDeleteSvc;
|
||||
|
@ -31,6 +32,7 @@ import ca.uhn.fhir.jpa.mdm.svc.MdmGoldenResourceDeletingSvc;
|
|||
import ca.uhn.fhir.jpa.mdm.svc.MdmSearchParamSvc;
|
||||
import ca.uhn.fhir.jpa.mdm.svc.MdmSubmitSvcImpl;
|
||||
import ca.uhn.fhir.jpa.subscription.channel.api.IChannelFactory;
|
||||
import ca.uhn.fhir.mdm.util.MessageHelper;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
|
@ -70,7 +72,7 @@ public class MdmSubmitterConfig {
|
|||
}
|
||||
|
||||
@Bean
|
||||
IMdmSubmitSvc mdmBatchService() {
|
||||
IMdmSubmitSvc mdmBatchService(IMdmSettings theMdmSetting) {
|
||||
return new MdmSubmitSvcImpl();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,6 +50,7 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
|
||||
public class MdmSubmitSvcImpl implements IMdmSubmitSvc {
|
||||
|
||||
private static final Logger ourLog = Logs.getMdmTroubleshootingLog();
|
||||
|
||||
@Autowired
|
||||
|
@ -148,6 +149,11 @@ public class MdmSubmitSvcImpl implements IMdmSubmitSvc {
|
|||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setMdmSettings(IMdmSettings theMdmSettings) {
|
||||
myMdmSettings = theMdmSettings;
|
||||
}
|
||||
|
||||
private void validateTargetType(String theResourceType) {
|
||||
if(!myMdmSettings.getMdmRules().getMdmTypes().contains(theResourceType)) {
|
||||
throw new InvalidRequestException(ProviderConstants.OPERATION_MDM_SUBMIT + " does not support resource type: " + theResourceType);
|
||||
|
|
|
@ -70,4 +70,10 @@ public interface IMdmSubmitSvc {
|
|||
*/
|
||||
long submitTargetToMdm(IIdType theId);
|
||||
|
||||
/**
|
||||
* This setter exists to allow imported modules to override settings.
|
||||
*
|
||||
* @param theMdmSettings Settings to set
|
||||
*/
|
||||
void setMdmSettings(IMdmSettings theMdmSettings);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue