Class NotificationEmail
- java.lang.Object
-
- com.google.gerrit.server.mail.send.OutgoingEmail
-
- com.google.gerrit.server.mail.send.NotificationEmail
-
- Direct Known Subclasses:
ChangeEmail
public abstract class NotificationEmail extends OutgoingEmail
Common class for notifications that are related to a project and branch
-
-
Field Summary
Fields Modifier and Type Field Description protected Branch.NameKey
branch
-
Fields inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData, velocityContext
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NotificationEmail(EmailArguments ea, String mc, Branch.NameKey branch)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
add(RecipientType type, com.google.gerrit.server.mail.send.ProjectWatch.Watchers.List list)
Add users or email addresses to the TO, CC, or BCC list.String
getListId()
String
getSshHost()
protected abstract ProjectWatch.Watchers
getWatchers(WatchConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
Returns all watchers that are relevantprotected void
includeWatchers(WatchConfig.NotifyType type)
Include users and groups that want notification of events.protected void
includeWatchers(WatchConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
Include users and groups that want notification of events.protected void
init()
Setup the message headers and envelope (TO, CC, BCC).protected void
setupSoyContext()
protected void
setupVelocityContext()
-
Methods inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
add, add, add, add, add, add, add, add, addByEmail, addByEmail, appendHtml, appendText, format, getFromLine, getGerritHost, getGerritUrl, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, isVisibleTo, removeHeader, removeUser, send, setAccountsToNotify, setFrom, setHeader, setHeader, setNotify, setVHeader, shouldSendMessage, soyHtmlTemplate, soyTextTemplate, supportsHtml, textTemplate, useHtml, velocify, velocifyFile
-
-
-
-
Field Detail
-
branch
protected Branch.NameKey branch
-
-
Constructor Detail
-
NotificationEmail
protected NotificationEmail(EmailArguments ea, String mc, Branch.NameKey branch)
-
-
Method Detail
-
init
protected void init() throws EmailException
Description copied from class:OutgoingEmail
Setup the message headers and envelope (TO, CC, BCC).- Overrides:
init
in classOutgoingEmail
- Throws:
EmailException
- if an error occurred.
-
getListId
public String getListId() throws EmailException
- Throws:
EmailException
-
includeWatchers
protected void includeWatchers(WatchConfig.NotifyType type)
Include users and groups that want notification of events.
-
includeWatchers
protected void includeWatchers(WatchConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
Include users and groups that want notification of events.
-
getWatchers
protected abstract ProjectWatch.Watchers getWatchers(WatchConfig.NotifyType type, boolean includeWatchersFromNotifyConfig) throws com.google.gwtorm.server.OrmException
Returns all watchers that are relevant- Throws:
com.google.gwtorm.server.OrmException
-
add
protected void add(RecipientType type, com.google.gerrit.server.mail.send.ProjectWatch.Watchers.List list)
Add users or email addresses to the TO, CC, or BCC list.
-
getSshHost
public String getSshHost()
-
setupVelocityContext
protected void setupVelocityContext()
- Overrides:
setupVelocityContext
in classOutgoingEmail
-
setupSoyContext
protected void setupSoyContext()
- Overrides:
setupSoyContext
in classOutgoingEmail
-
-