org.sadun.util.watchdog.listeners
Class MailAlarmListener

java.lang.Object
  extended byorg.sadun.util.watchdog.listeners.WaitAndRetryListener
      extended byorg.sadun.util.watchdog.listeners.MailAlarmListener
All Implemented Interfaces:
WatchDog.Listener

public class MailAlarmListener
extends WaitAndRetryListener

NOTE: this class relies on javamail. You need to download and install both the JavaBeans Activation Framework and JavaMail to compile and run it.

Version:
1.0
Author:
Cristiano Sadun

Field Summary
 
Fields inherited from class org.sadun.util.watchdog.listeners.WaitAndRetryListener
DEFAULT_MAX_RETRY_COUNT
 
Constructor Summary
MailAlarmListener()
           
MailAlarmListener(int maxRetryCount, java.lang.String emailAddresses, java.lang.String hostname, java.lang.String mailTemplateURL)
           
MailAlarmListener(java.lang.String emailAddresses, java.lang.String hostname, java.lang.String mailTemplateURL)
           
 
Method Summary
 void checkFailed(java.lang.Object obj, java.lang.Throwable e)
          Notifies the listener that a check has failed.
 java.lang.String getEmailAddresses()
           
 java.lang.String getHostname()
           
 java.lang.String getMailTemplateURL()
           
 void setEmailAddresses(java.lang.String emailAddresses)
           
 void setHostname(java.lang.String hostname)
           
 void setMailTemplateURL(java.lang.String mailTemplateURL)
           
 
Methods inherited from class org.sadun.util.watchdog.listeners.WaitAndRetryListener
checkImpossible, checkOk, getMaxRetryCount, reset, setMaxRetryCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailAlarmListener

public MailAlarmListener(java.lang.String emailAddresses,
                         java.lang.String hostname,
                         java.lang.String mailTemplateURL)
                  throws java.net.MalformedURLException

MailAlarmListener

public MailAlarmListener(int maxRetryCount,
                         java.lang.String emailAddresses,
                         java.lang.String hostname,
                         java.lang.String mailTemplateURL)
                  throws java.net.MalformedURLException
Parameters:
emailAddresses - a comma-separated list of email addresses
hostname - the name of the SMTP host
maxRetryCount -

MailAlarmListener

public MailAlarmListener()
Method Detail

checkFailed

public void checkFailed(java.lang.Object obj,
                        java.lang.Throwable e)
Description copied from interface: WatchDog.Listener
Notifies the listener that a check has failed.

Specified by:
checkFailed in interface WatchDog.Listener
Specified by:
checkFailed in class WaitAndRetryListener

getMailTemplateURL

public java.lang.String getMailTemplateURL()
Returns:
Returns the mailTemplateURL.

setMailTemplateURL

public void setMailTemplateURL(java.lang.String mailTemplateURL)
                        throws java.net.MalformedURLException
Parameters:
mailTemplateURL - The mailTemplateURL to set.
Throws:
java.net.MalformedURLException

getEmailAddresses

public java.lang.String getEmailAddresses()
Returns:
Returns the emailAddresses.

setEmailAddresses

public void setEmailAddresses(java.lang.String emailAddresses)
Parameters:
emailAddresses - The emailAddresses to set.

getHostname

public java.lang.String getHostname()
Returns:
Returns the hostname.

setHostname

public void setHostname(java.lang.String hostname)
Parameters:
hostname - The hostname to set.