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 Object
implements EmailManagerLocal

EJB interface to an SMTP email system.

Author:
John Mazzitelli

Constructor Summary
EmailManagerBean()
           
 
Method Summary
 Map<String,String> getAlertEmailMessage(String resourceHierarchy, String resourceName, String alertName, String priority, String timestamp, String conditionLogs, String alertUrl)
          This returns an email message based on the alert email template with its replacement tokens replaced with the given strings.
 Collection<String> sendEmail(Collection<String> toAddresses, String messageSubject, String messageBody)
          Send email to the addressses passed in toAddresses with the passed subject and body.
 
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 Collection<String> sendEmail(Collection<String> toAddresses,
                                    String messageSubject,
                                    String messageBody)
Send email to the addressses passed in toAddresses with the passed subject and body. Invalid emails will be reported back. This can only catch sender errors up to the first smtp gateway.

Specified by:
sendEmail in interface EmailManagerLocal
Parameters:
toAddresses - list of email addresses to send to
messageSubject - subject of the email sent
messageBody - body of the email to be sent
Returns:
list of email receivers for which initial delivery failed.

getAlertEmailMessage

public Map<String,String> getAlertEmailMessage(String resourceHierarchy,
                                               String resourceName,
                                               String alertName,
                                               String priority,
                                               String timestamp,
                                               String conditionLogs,
                                               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-2012 Red Hat, Inc.. All Rights Reserved.