org.rhq.enterprise.server.core
Interface EmailManagerLocal

All Known Implementing Classes:
EmailManagerBean

public interface EmailManagerLocal

Local interface that allows clients to send SMTP email messages.

Author:
John Mazzitelli

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.
 

Method Detail

sendEmail

void sendEmail(java.util.Collection<java.lang.String> toAddresses,
               java.lang.String messageSubject,
               java.lang.String messageBody)
               throws java.lang.Exception
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.

Parameters:
toAddresses -
messageSubject -
messageBody -
Throws:
java.lang.Exception - if failed to send to one or more email addresses

getAlertEmailMessage

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. The returns Map has size 1 - the key is the subject and the value is the body of the message.

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.