com.waveset.notification
Class EmailNotifier

java.lang.Object
  extended bycom.waveset.notification.Notifier
      extended bycom.waveset.notification.EmailNotifier

public class EmailNotifier
extends Notifier

An implementation of the Notifier class that sends email notifications. The expected parameters are:

If the template parameter is specified, then it is expected to be the name of an EmailTemplate object in the repository which will be used as the basis for the email. If any of the parameters listed above are supplied in addition to the template, then the parameters override the fields of the template.


Nested Class Summary
static class EmailNotifier.ByteArrayDataSource
          A simple DataSource for sending various email type, specifically text/html, but others could work too..
static interface EmailNotifier.LocaleLocator
          This class is used to lookup the Locale of a user with a given email address.
 
Field Summary
static int _errorCount
          The number of times the notify() method will throw a ServiceNotResponding exception before sending the mail.
static java.lang.String BODY
           
static java.lang.String CC
           
static java.lang.String code_id
           
static java.lang.String CONTENT_CHARSET_DEFAULT
          The default character set to use
static java.lang.String CONTENT_CHARSET_SYSCFG
          A setting to control the character set for encoding the email subject and body.
static java.lang.String ENABLE_LOCALIZATION_SYSCFG
          We don't localize messages based on the user's locale if this is set to false.
static java.lang.String FROM
           
static java.lang.String FROM_ADDRESS
          Deprecated. - use FROM
static java.lang.String FROM_USER
          Deprecated. - use FROM
static java.lang.String LOCALE
           
static java.lang.String LOCALE_LOCATOR
           
static java.lang.String MIME_TYPE
           
static java.lang.String SMTP_HOST
           
static java.lang.String SUBJECT
           
static java.lang.String TEMPLATE
           
static java.lang.String TEST_RAW_EMAIL_FILE
           
static java.lang.String TEST_RESULT
           
static java.lang.String TO
           
static java.lang.String TO_ADDRESS
          Deprecated. - use TO
static java.lang.String TO_ADMIN
          Deprecated. - use TO
static java.lang.String TO_USER
          Deprecated. - use TO
 
Fields inherited from class com.waveset.notification.Notifier
TYPE_EMAIL, TYPE_TEST
 
Constructor Summary
EmailNotifier()
          Construct an EmailNotifier object.
 
Method Summary
 WavesetResult notify(LighthouseContext context, java.util.Map parameters, VariableResolver resolver)
          Notifier.notify method implementation.
static void setErrorCount(int c)
           
 
Methods inherited from class com.waveset.notification.Notifier
getFilterDomain, getNotificationFile, getNotifier, notify, setTestFile, setTestNotifier
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values

TEMPLATE

public static final java.lang.String TEMPLATE
See Also:
Constant Field Values

SMTP_HOST

public static final java.lang.String SMTP_HOST
See Also:
Constant Field Values

FROM_ADDRESS

public static final java.lang.String FROM_ADDRESS
Deprecated. - use FROM

See Also:
Constant Field Values

FROM_USER

public static final java.lang.String FROM_USER
Deprecated. - use FROM

See Also:
Constant Field Values

FROM

public static final java.lang.String FROM
See Also:
Constant Field Values

TO_ADDRESS

public static final java.lang.String TO_ADDRESS
Deprecated. - use TO

See Also:
Constant Field Values

TO_USER

public static final java.lang.String TO_USER
Deprecated. - use TO

See Also:
Constant Field Values

TO_ADMIN

public static final java.lang.String TO_ADMIN
Deprecated. - use TO

See Also:
Constant Field Values

TO

public static final java.lang.String TO
See Also:
Constant Field Values

CC

public static final java.lang.String CC
See Also:
Constant Field Values

SUBJECT

public static final java.lang.String SUBJECT
See Also:
Constant Field Values

BODY

public static final java.lang.String BODY
See Also:
Constant Field Values

MIME_TYPE

public static final java.lang.String MIME_TYPE
See Also:
Constant Field Values

LOCALE_LOCATOR

public static final java.lang.String LOCALE_LOCATOR
See Also:
Constant Field Values

LOCALE

public static final java.lang.String LOCALE
See Also:
Constant Field Values

TEST_RESULT

public static final java.lang.String TEST_RESULT
See Also:
Constant Field Values

TEST_RAW_EMAIL_FILE

public static final java.lang.String TEST_RAW_EMAIL_FILE
See Also:
Constant Field Values

ENABLE_LOCALIZATION_SYSCFG

public static final java.lang.String ENABLE_LOCALIZATION_SYSCFG
We don't localize messages based on the user's locale if this is set to false.

See Also:
Constant Field Values

CONTENT_CHARSET_SYSCFG

public static final java.lang.String CONTENT_CHARSET_SYSCFG
A setting to control the character set for encoding the email subject and body. This was added for 9597.

See Also:
Constant Field Values

CONTENT_CHARSET_DEFAULT

public static final java.lang.String CONTENT_CHARSET_DEFAULT
The default character set to use

See Also:
Constant Field Values

_errorCount

public static int _errorCount
The number of times the notify() method will throw a ServiceNotResponding exception before sending the mail. Only for simulating unresponsive servers during unit testing.

Constructor Detail

EmailNotifier

public EmailNotifier()
Construct an EmailNotifier object.

Method Detail

setErrorCount

public static void setErrorCount(int c)

notify

public WavesetResult notify(LighthouseContext context,
                            java.util.Map parameters,
                            VariableResolver resolver)
                     throws ServiceNotResponding,
                            WavesetException
Notifier.notify method implementation. Gathers parameters, expands variable references, and calls the inner send() method.

Specified by:
notify in class Notifier
Throws:
ServiceNotResponding
WavesetException