use of org.nhindirect.gateway.smtp.RawMessageSettings in project nhin-d by DirectProject.
the class RESTSmtpAgentConfig method buildMessageSettings.
protected void buildMessageSettings(String type) {
Setting folderSettings;
try {
folderSettings = settingsService.getSetting("MessageSaveFolder");
} catch (Exception e) {
throw new SmtpAgentException(SmtpAgentError.InvalidConfigurationFormat, "WebService error getting " + type + " message settings: " + e.getMessage(), e);
}
String saveFolder = (folderSettings == null) ? null : folderSettings.getValue();
MessageProcessingSettings settings = null;
if (type.equalsIgnoreCase(MESSAGE_SETTING_RAW))
settings = rawSettings = new RawMessageSettings();
else if (type.equalsIgnoreCase(MESSAGE_SETTING_INCOMING))
settings = incomingSettings = new ProcessIncomingSettings();
else if (type.equalsIgnoreCase(MESSAGE_SETTING_OUTGOING))
settings = outgoingSettings = new ProcessOutgoingSettings();
else if (type.equalsIgnoreCase(MESSAGE_SETTING_BAD))
settings = badSettings = new ProcessBadMessageSettings();
if (saveFolder != null && settings != null)
settings.setSaveMessageFolder(new File(saveFolder));
}
use of org.nhindirect.gateway.smtp.RawMessageSettings in project nhin-d by DirectProject.
the class WSSmtpAgentConfig method buildMessageSettings.
protected void buildMessageSettings(String type) {
Setting folderSettings;
try {
folderSettings = cfService.getSettingByName(type + "MessageSaveFolder");
} catch (Exception e) {
throw new SmtpAgentException(SmtpAgentError.InvalidConfigurationFormat, "WebService error getting " + type + " message settings: " + e.getMessage(), e);
}
String saveFolder = (folderSettings == null) ? null : folderSettings.getValue();
MessageProcessingSettings settings = null;
if (type.equalsIgnoreCase(MESSAGE_SETTING_RAW))
settings = rawSettings = new RawMessageSettings();
else if (type.equalsIgnoreCase(MESSAGE_SETTING_INCOMING))
settings = incomingSettings = new ProcessIncomingSettings();
else if (type.equalsIgnoreCase(MESSAGE_SETTING_OUTGOING))
settings = outgoingSettings = new ProcessOutgoingSettings();
else if (type.equalsIgnoreCase(MESSAGE_SETTING_BAD))
settings = badSettings = new ProcessBadMessageSettings();
if (saveFolder != null && settings != null)
settings.setSaveMessageFolder(new File(saveFolder));
}
use of org.nhindirect.gateway.smtp.RawMessageSettings in project nhin-d by DirectProject.
the class XMLSmtpAgentConfig method buildRawMessageSettings.
private void buildRawMessageSettings(Node rawMsgNode) {
if (rawMsgNode.getNodeType() == Node.ELEMENT_NODE) {
Element rawMsg = (Element) rawMsgNode;
String saveFolder = rawMsg.getAttribute("saveFolder");
RawMessageSettings settings = new RawMessageSettings();
if (saveFolder != null)
settings.setSaveMessageFolder(new File(saveFolder));
rawSettings = settings;
}
}
Aggregations