org.rhq.enterprise.server.core
Class EmailManagerBean

java.lang.Object
  extended by org.rhq.enterprise.server.core.EmailManagerBean
All Implemented Interfaces:
EmailManagerLocal

public class EmailManagerBean
extends java.lang.Object
implements EmailManagerLocal

EJB interface to an SMTP email system.

Author:
John Mazzitelli

Constructor Summary
EmailManagerBean()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.String> getAlertEmailMessage(java.lang.String resourceHierarchy, java.lang.String resourceName, java.lang.String alertName, java.lang.String priority, java.lang.String timestamp, java.lang.String conditionLogs, java.lang.String alertUrl)
          This returns an email message based on the alert email template with its replacement tokens replaced with the given strings.
 void sendEmail(java.util.Collection<java.lang.String> toAddresses, java.lang.String messageSubject, java.lang.String messageBody)
          Sends an email message to the given a set of email addresses where the subject and body of the message are passed in.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EmailManagerBean

public EmailManagerBean()
Method Detail

sendEmail

public void sendEmail(java.util.Collection<java.lang.String> toAddresses,
                      java.lang.String messageSubject,
                      java.lang.String messageBody)
               throws java.lang.Exception
Description copied from interface: EmailManagerLocal
Sends an email message to the given a set of email addresses where the subject and body of the message are passed in. The message body is considered to have a MIME type of text/plain.

This method will attempt to send to all addresses, even if one or more failed. The first exception that is encountered will be the one that is eventually thrown.

Specified by:
sendEmail in interface EmailManagerLocal
Throws:
java.lang.Exception - if failed to send to one or more email addresses

getAlertEmailMessage

public java.util.Map<java.lang.String,java.lang.String> getAlertEmailMessage(java.lang.String resourceHierarchy,
                                                                             java.lang.String resourceName,
                                                                             java.lang.String alertName,
                                                                             java.lang.String priority,
                                                                             java.lang.String timestamp,
                                                                             java.lang.String conditionLogs,
                                                                             java.lang.String alertUrl)
Description copied from interface: EmailManagerLocal
This returns an email message based on the alert email template with its replacement tokens replaced with the given strings. The returns Map has size 1 - the key is the subject and the value is the body of the message.

Specified by:
getAlertEmailMessage in interface EmailManagerLocal
Parameters:
resourceHierarchy - ascii tree structure containing the names of resources up to the corresponding platform
resourceName - name of the resource that triggered the alert
alertName - name of the alert that was triggered
priority - the priority of the alert
timestamp - the date/time when the alert was triggered
conditionLogs - that conditionLogs that were met that caused the alert to trigger
alertUrl - URL to the GUI page of the alert that was triggered
Returns:
alert email message (key=subject, value=body)


Copyright © 2008-2009 Red Hat, Inc.. All Rights Reserved.