Search in sources :

Example 1 with ProcessOutgoingSettings

use of org.nhindirect.gateway.smtp.ProcessOutgoingSettings 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));
}
Also used : ProcessOutgoingSettings(org.nhindirect.gateway.smtp.ProcessOutgoingSettings) SmtpAgentException(org.nhindirect.gateway.smtp.SmtpAgentException) ProcessBadMessageSettings(org.nhindirect.gateway.smtp.ProcessBadMessageSettings) Setting(org.nhindirect.config.model.Setting) MessageProcessingSettings(org.nhindirect.gateway.smtp.MessageProcessingSettings) ProcessIncomingSettings(org.nhindirect.gateway.smtp.ProcessIncomingSettings) RawMessageSettings(org.nhindirect.gateway.smtp.RawMessageSettings) File(java.io.File) AddressException(javax.mail.internet.AddressException) SmtpAgentException(org.nhindirect.gateway.smtp.SmtpAgentException) PolicyParseException(org.nhindirect.policy.PolicyParseException)

Example 2 with ProcessOutgoingSettings

use of org.nhindirect.gateway.smtp.ProcessOutgoingSettings 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));
}
Also used : ProcessOutgoingSettings(org.nhindirect.gateway.smtp.ProcessOutgoingSettings) SmtpAgentException(org.nhindirect.gateway.smtp.SmtpAgentException) ProcessBadMessageSettings(org.nhindirect.gateway.smtp.ProcessBadMessageSettings) Setting(org.nhind.config.Setting) MessageProcessingSettings(org.nhindirect.gateway.smtp.MessageProcessingSettings) ProcessIncomingSettings(org.nhindirect.gateway.smtp.ProcessIncomingSettings) RawMessageSettings(org.nhindirect.gateway.smtp.RawMessageSettings) File(java.io.File) AddressException(javax.mail.internet.AddressException) SmtpAgentException(org.nhindirect.gateway.smtp.SmtpAgentException) PolicyParseException(org.nhindirect.policy.PolicyParseException) IOException(java.io.IOException) CertificateException(java.security.cert.CertificateException)

Example 3 with ProcessOutgoingSettings

use of org.nhindirect.gateway.smtp.ProcessOutgoingSettings in project nhin-d by DirectProject.

the class XMLSmtpAgentConfig method buildOutgoingMessageSettings.

private void buildOutgoingMessageSettings(Node outgoingMsgNode) {
    if (outgoingMsgNode.getNodeType() == Node.ELEMENT_NODE) {
        Element outgoingMsg = (Element) outgoingMsgNode;
        String saveFolder = outgoingMsg.getAttribute("saveFolder");
        ProcessOutgoingSettings settings = new ProcessOutgoingSettings();
        if (saveFolder != null)
            settings.setSaveMessageFolder(new File(saveFolder));
        outgoingSettings = settings;
    }
}
Also used : ProcessOutgoingSettings(org.nhindirect.gateway.smtp.ProcessOutgoingSettings) Element(org.w3c.dom.Element) File(java.io.File)

Aggregations

File (java.io.File)3 ProcessOutgoingSettings (org.nhindirect.gateway.smtp.ProcessOutgoingSettings)3 AddressException (javax.mail.internet.AddressException)2 MessageProcessingSettings (org.nhindirect.gateway.smtp.MessageProcessingSettings)2 ProcessBadMessageSettings (org.nhindirect.gateway.smtp.ProcessBadMessageSettings)2 ProcessIncomingSettings (org.nhindirect.gateway.smtp.ProcessIncomingSettings)2 RawMessageSettings (org.nhindirect.gateway.smtp.RawMessageSettings)2 SmtpAgentException (org.nhindirect.gateway.smtp.SmtpAgentException)2 PolicyParseException (org.nhindirect.policy.PolicyParseException)2 IOException (java.io.IOException)1 CertificateException (java.security.cert.CertificateException)1 Setting (org.nhind.config.Setting)1 Setting (org.nhindirect.config.model.Setting)1 Element (org.w3c.dom.Element)1