public class EmailNotifier extends Object implements QueryUpdateSubscriber
Constructor and Description |
---|
EmailNotifier(String bodyTemplate,
String subjectTemplate,
String fromEmail,
MetacardFormatter metacardFormatter,
SubscriptionsPersistentStore subscriptionsPersistentStore,
SmtpClient smtpClient)
The
bodyTemplate and subjectTemplate may contain the tags supported by the
metacardFormatter . |
Modifier and Type | Method and Description |
---|---|
void |
notify(Map<String,org.apache.commons.lang3.tuple.Pair<WorkspaceMetacardImpl,Long>> workspaceMetacardMap) |
void |
setBodyTemplate(String bodyTemplate)
The template string used for the email body.
|
void |
setFromEmail(String fromEmail)
The FROM email address.
|
void |
setSubjectTemplate(String subjectTemplate)
The template string used for the email subject.
|
String |
toString() |
public EmailNotifier(String bodyTemplate, String subjectTemplate, String fromEmail, MetacardFormatter metacardFormatter, SubscriptionsPersistentStore subscriptionsPersistentStore, SmtpClient smtpClient)
bodyTemplate
and subjectTemplate
may contain the tags supported by the
metacardFormatter
.bodyTemplate
- A string that represents the email body, will be passed to MetacardFormatter
.subjectTemplate
- A string that represents the subject line of the email, will be passed
to MetacardFormatter
.fromEmail
- The 'from' email address to be set in the email.metacardFormatter
- Used to format the body and subject line.subscriptionsPersistentStore
- Used to find the email address associated with a workspace
id.smtpClient
- The SmtpClient
that will send the email.public void setBodyTemplate(String bodyTemplate)
bodyTemplate
- must be non-nullpublic void setSubjectTemplate(String subjectTemplate)
subjectTemplate
- must be non-nullpublic void setFromEmail(String fromEmail)
fromEmail
- must be non-blankpublic void notify(Map<String,org.apache.commons.lang3.tuple.Pair<WorkspaceMetacardImpl,Long>> workspaceMetacardMap)
notify
in interface QueryUpdateSubscriber
workspaceMetacardMap
- map of workspace identifiers to workspace metacards and query hit
count (must be non-null)This work is licensed under a Creative Commons Attribution 4.0 International License.