use of org.nhindirect.gateway.smtp.provider.WSSmtpAgentConfigProvider in project nhin-d by DirectProject.
the class NHINDSecurityAndTrustMailet method createCompatConfigProvider.
protected Provider<SmtpAgentConfig> createCompatConfigProvider(URL configURL) {
Provider<SmtpAgentConfig> provider;
if (configURL.getProtocol().equalsIgnoreCase("HTTP") || configURL.getProtocol().equalsIgnoreCase("HTTPS")) {
// web services based
provider = new WSSmtpAgentConfigProvider(configURL, null);
} else {
// use the default XML configuration
// convert URL to file location
File fl = FileUtils.toFile(configURL);
provider = new XMLSmtpAgentConfigProvider(fl.getAbsolutePath(), null);
}
return provider;
}
use of org.nhindirect.gateway.smtp.provider.WSSmtpAgentConfigProvider in project nhin-d by DirectProject.
the class SmtpAgentConfigModule method configure.
protected void configure() {
Provider<SmtpAgentConfig> provider = smtpAgentConfigProvider;
if (provider == null) {
if (configLocation.getProtocol().equalsIgnoreCase("HTTP") || configLocation.getProtocol().equalsIgnoreCase("HTTPS")) {
// web services based
provider = new WSSmtpAgentConfigProvider(configLocation, agentProvider);
} else {
// use the default XML configuration
// convert URL to file location
File fl = FileUtils.toFile(configLocation);
provider = new XMLSmtpAgentConfigProvider(fl.getAbsolutePath(), agentProvider);
}
}
bind(SmtpAgentConfig.class).toProvider(provider);
}
Aggregations