WIP
This commit is contained in:
@@ -74,6 +74,9 @@ public class AppProperties {
|
||||
private Boolean use_apache_address_strategy = false;
|
||||
private Boolean use_apache_address_strategy_https = false;
|
||||
|
||||
private Integer bundle_batch_pool_size = 20;
|
||||
private Integer bundle_batch_pool_max_size = 100;
|
||||
|
||||
public Boolean getUse_apache_address_strategy() {
|
||||
return use_apache_address_strategy;
|
||||
}
|
||||
@@ -471,6 +474,22 @@ public class AppProperties {
|
||||
this.install_transitive_ig_dependencies = install_transitive_ig_dependencies;
|
||||
}
|
||||
|
||||
public Integer getBundle_batch_pool_size() {
|
||||
return this.bundle_batch_pool_size;
|
||||
}
|
||||
|
||||
public void setBundle_batch_pool_size(Integer bundle_batch_pool_size) {
|
||||
this.bundle_batch_pool_size = bundle_batch_pool_size;
|
||||
}
|
||||
|
||||
public Integer getBundle_batch_pool_max_size() {
|
||||
return bundle_batch_pool_max_size;
|
||||
}
|
||||
|
||||
public void setBundle_batch_pool_max_size(Integer bundle_batch_pool_max_size) {
|
||||
this.bundle_batch_pool_max_size = bundle_batch_pool_max_size;
|
||||
}
|
||||
|
||||
public static class Cors {
|
||||
private Boolean allow_Credentials = true;
|
||||
private List<String> allowed_origin = ImmutableList.of("*");
|
||||
|
||||
@@ -373,6 +373,11 @@ public class BaseJpaRestfulServer extends RestfulServer {
|
||||
daoConfig.setResourceServerIdStrategy(DaoConfig.IdStrategyEnum.UUID);
|
||||
daoConfig.setResourceClientIdStrategy(appProperties.getClient_id_strategy());
|
||||
}
|
||||
//Parallel Batch GET execution settings
|
||||
daoConfig.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_size());
|
||||
daoConfig.setBundleBatchPoolSize(appProperties.getBundle_batch_pool_max_size());
|
||||
System.out.println("BATCH SIZE IS " + appProperties.getBundle_batch_pool_size());
|
||||
System.out.println("BATCH MAX SIZE IS " + appProperties.getBundle_batch_pool_max_size());
|
||||
|
||||
if (appProperties.getImplementationGuides() != null) {
|
||||
Map<String, AppProperties.ImplementationGuide> guides = appProperties.getImplementationGuides();
|
||||
|
||||
@@ -8,10 +8,16 @@ import ca.uhn.fhir.jpa.model.config.PartitionSettings;
|
||||
import ca.uhn.fhir.jpa.model.config.PartitionSettings.CrossPartitionReferenceMode;
|
||||
import ca.uhn.fhir.jpa.model.entity.ModelConfig;
|
||||
import ca.uhn.fhir.jpa.subscription.channel.subscription.SubscriptionDeliveryHandlerFactory;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.EmailSenderImpl;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.IEmailSender;
|
||||
import ca.uhn.fhir.jpa.subscription.match.deliver.email.JavaMailEmailSender;
|
||||
import ca.uhn.fhir.rest.server.mail.MailConfig;
|
||||
import com.google.common.base.Strings;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.hl7.fhir.dstu2.model.Subscription;
|
||||
import org.simplejavamail.api.email.Email;
|
||||
import org.simplejavamail.api.mailer.Mailer;
|
||||
import org.simplejavamail.api.mailer.config.TransportStrategy;
|
||||
import org.simplejavamail.mailer.MailerBuilder;
|
||||
import org.springframework.boot.env.YamlPropertySourceLoader;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
@@ -205,23 +211,20 @@ public class FhirServerConfigCommon {
|
||||
@Bean()
|
||||
public IEmailSender emailSender(AppProperties appProperties, Optional<SubscriptionDeliveryHandlerFactory> subscriptionDeliveryHandlerFactory) {
|
||||
if (appProperties.getSubscription() != null && appProperties.getSubscription().getEmail() != null) {
|
||||
JavaMailEmailSender retVal = new JavaMailEmailSender();
|
||||
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||
MailConfig mailConfig = new MailConfig();
|
||||
mailConfig.setSmtpHostname(email.getHost());
|
||||
mailConfig.setSmtpUseStartTLS(email.getStartTlsRequired());
|
||||
mailConfig.setSmtpPort(email.getPort());
|
||||
mailConfig.setSmtpUsername(email.getUsername());
|
||||
mailConfig.setSmtpPassword(email.getPassword());
|
||||
EmailSenderImpl emailSender = new EmailSenderImpl(mailConfig);
|
||||
|
||||
AppProperties.Subscription.Email email = appProperties.getSubscription().getEmail();
|
||||
retVal.setSmtpServerHostname(email.getHost());
|
||||
retVal.setSmtpServerPort(email.getPort());
|
||||
retVal.setSmtpServerUsername(email.getUsername());
|
||||
retVal.setSmtpServerPassword(email.getPassword());
|
||||
retVal.setAuth(email.getAuth());
|
||||
retVal.setStartTlsEnable(email.getStartTlsEnable());
|
||||
retVal.setStartTlsRequired(email.getStartTlsRequired());
|
||||
retVal.setQuitWait(email.getQuitWait());
|
||||
if(subscriptionDeliveryHandlerFactory.isPresent()) {
|
||||
subscriptionDeliveryHandlerFactory.get().setEmailSender(emailSender);
|
||||
}
|
||||
|
||||
if(subscriptionDeliveryHandlerFactory.isPresent())
|
||||
subscriptionDeliveryHandlerFactory.get().setEmailSender(retVal);
|
||||
|
||||
return retVal;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user