public class DeploymentEmailer extends java.lang.Object implements DeploymentEventListener
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=trueThe listener can conveniently be turned off and on via the active property in the ComponentBrowser.
DeploymentEventListener
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string
|
Constructor and Description |
---|
DeploymentEmailer()
Constructs the DeploymentEmailer with no special arguments.
|
Modifier and Type | Method and Description |
---|---|
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.
|
public DeploymentEmailer()
public void setSMTPEmailSender(SMTPEmailSender pSMTPEmailSender)
pSMTPEmailSender
- new value to setpublic SMTPEmailSender getSMTPEmailSender()
public void setFromAddress(java.lang.String pFromAddress)
pFromAddress
- new value to setpublic java.lang.String getFromAddress()
public void setToAddress(java.lang.String pToAddress)
pAddress
- new value to setpublic java.lang.String getToAddress()
public void setUseShortMessage(boolean pUseShortMessage)
pUseShortMessage
- new value to setpublic boolean getUseShortMessage()
public void setActive(boolean pActive)
pActive
- new value to setpublic boolean isActive()
public void deploymentEvent(DeploymentEvent pEvent)
deploymentEvent
in interface DeploymentEventListener