org.opennms.javamail
Class JavaSendMailer

java.lang.Object
  extended by org.opennms.javamail.JavaMailer2
      extended by org.opennms.javamail.JavaSendMailer

public class JavaSendMailer
extends JavaMailer2

Use this class for sending emailz. Crude extension of JavaMailer TODO: Improve class hierarchy. TODO: Needs testing

Author:
David Hustace

Nested Class Summary
 
Nested classes/interfaces inherited from class org.opennms.javamail.JavaMailer2
JavaMailer2.LoggingByteArrayOutputStream, JavaMailer2.LoggingTransportListener
 
Constructor Summary
JavaSendMailer(SendmailConfig config)
          Using this constructor implies overriding sendmail configuration with properties from the deprecated javamail-configuration.properties file.
JavaSendMailer(SendmailConfig config, boolean useJmProps)
          Constructs everything required to call send()
 
Method Summary
 org.springframework.mail.javamail.MimeMailMessage buildMimeMessage(SendmailMessage msg)
           
 Authenticator createAuthenticator()
          Helper method to create an Authenticator based on Password Authentication
 SendmailConfig getConfig()
           
 org.springframework.mail.javamail.MimeMailMessage getMessage()
           
 Properties getProperties()
           
 void send()
           
 void setConfig(SendmailConfig config)
           
 void setMessage(org.springframework.mail.javamail.MimeMailMessage message)
           
 void setProperties(Properties properties)
           
 
Methods inherited from class org.opennms.javamail.JavaMailer2
createAuthenticator, createFileAttachment, getMailProps, getSession, log, setDebug, setSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaSendMailer

public JavaSendMailer(SendmailConfig config,
                      boolean useJmProps)
               throws JavaMailerException
Constructs everything required to call send()

Parameters:
config - SendmailConfig
useJmProps - A boolean representing the handling of the deprecated javamail-configuration.properties file.
Throws:
JavaMailerException

JavaSendMailer

public JavaSendMailer(SendmailConfig config)
               throws JavaMailerException
Using this constructor implies overriding sendmail configuration with properties from the deprecated javamail-configuration.properties file.

Parameters:
config -
Throws:
JavaMailerException
Method Detail

buildMimeMessage

public org.springframework.mail.javamail.MimeMailMessage buildMimeMessage(SendmailMessage msg)

createAuthenticator

public Authenticator createAuthenticator()
Helper method to create an Authenticator based on Password Authentication

Returns:

send

public void send()
          throws JavaMailerException
Throws:
JavaMailerException

setConfig

public void setConfig(SendmailConfig config)

getConfig

public SendmailConfig getConfig()

setMessage

public void setMessage(org.springframework.mail.javamail.MimeMailMessage message)

getMessage

public org.springframework.mail.javamail.MimeMailMessage getMessage()

setProperties

public void setProperties(Properties properties)

getProperties

public Properties getProperties()


Copyright © 2009. All Rights Reserved.