atg.deployment.common.event
Class DeploymentEmailer

java.lang.Object
  extended by atg.deployment.common.event.DeploymentEmailer
All Implemented Interfaces:
DeploymentEventListener, java.util.EventListener

public class DeploymentEmailer
extends java.lang.Object
implements DeploymentEventListener

A deployment event listener that sends email out when a deployment succeeds or fails.

When registered with the deployment server as a deployment event listener, this listener will wait for a deployment completion event or any event that is an error. Upon receiving either, the listener will use the SMTPEmailSender service to send an email to the specified address. The useShortMessage property can be set accordingly for either a brief message (ideal for pagers) or a detailed listing of properties from the deployment event.

Multiple email listeners can be registered and customized to suit varying needs. The email listener properties file will look similar to:

  $class=atg.deployment.common.event.DeploymentEmailer
  
  SMTPEmailSender=/atg/dynamo/service/SMTPEmail
  
  fromAddress=important-guy@thebigcompany.com
  toAddress=another-important-guy@thebigcompany.com

  useShortMessage=true
 
The listener can conveniently be turned off and on via the active property in the ComponentBrowser.

See Also:
DeploymentEventListener

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
DeploymentEmailer()
          Constructs the DeploymentEmailer with no special arguments.
 
Method Summary
 void deploymentEvent(DeploymentEvent pEvent)
          DeploymentEventListener method called for event firing.
 java.lang.String getFromAddress()
          The email address deployment notifications should claim to be from.
 SMTPEmailSender getSMTPEmailSender()
          The SMTPEmailSender service to send emails through.
 java.lang.String getToAddress()
          The email address to send deployment notifications to.
 boolean getUseShortMessage()
          Whether to send a short, pager-sized message or a longer, more verbose message.
 boolean isActive()
          Whether or not the listener should send email notifications.
 void setActive(boolean pActive)
          Whether or not the listener should send email notifications.
 void setFromAddress(java.lang.String pFromAddress)
          The email address deployment notifications should claim to be from.
 void setSMTPEmailSender(SMTPEmailSender pSMTPEmailSender)
          The SMTPEmailSender service to send emails through.
 void setToAddress(java.lang.String pToAddress)
          The email address to send deployment notifications to.
 void setUseShortMessage(boolean pUseShortMessage)
          Whether to send a short, pager-sized message or a longer, more verbose message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

DeploymentEmailer

public DeploymentEmailer()
Constructs the DeploymentEmailer with no special arguments. (It's more of a passive class.)

Method Detail

setSMTPEmailSender

public void setSMTPEmailSender(SMTPEmailSender pSMTPEmailSender)
The SMTPEmailSender service to send emails through.

Parameters:
pSMTPEmailSender - new value to set

getSMTPEmailSender

public SMTPEmailSender getSMTPEmailSender()
The SMTPEmailSender service to send emails through.

Returns:
SMTPEmailSender

setFromAddress

public void setFromAddress(java.lang.String pFromAddress)
The email address deployment notifications should claim to be from.

Parameters:
pFromAddress - new value to set

getFromAddress

public java.lang.String getFromAddress()
The email address deployment notifications should claim to be from.

Returns:
String

setToAddress

public void setToAddress(java.lang.String pToAddress)
The email address to send deployment notifications to.

Parameters:
pAddress - new value to set

getToAddress

public java.lang.String getToAddress()
The email address to send deployment notifications to.

Returns:
String

setUseShortMessage

public void setUseShortMessage(boolean pUseShortMessage)
Whether to send a short, pager-sized message or a longer, more verbose message.

Parameters:
pUseShortMessage - new value to set

getUseShortMessage

public boolean getUseShortMessage()
Whether to send a short, pager-sized message or a longer, more verbose message.

Returns:
boolean

setActive

public void setActive(boolean pActive)
Whether or not the listener should send email notifications.

Parameters:
pActive - new value to set

isActive

public boolean isActive()
Whether or not the listener should send email notifications.

Returns:
boolean

deploymentEvent

public void deploymentEvent(DeploymentEvent pEvent)
DeploymentEventListener method called for event firing.

Specified by:
deploymentEvent in interface DeploymentEventListener