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 BranchNameKey
branch
-
Fields inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
NotificationEmail(EmailArguments args, String messageClass, BranchNameKey branch)
-
Method Summary
All Methods Static 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.protected static String
getInstanceAndProjectName(String instanceName, String projectName)
protected static String
getShortProjectName(String projectName)
String
getSshHost()
protected abstract ProjectWatch.Watchers
getWatchers(NotifyConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
Returns all watchers that are relevantprotected void
includeWatchers(NotifyConfig.NotifyType type)
Include users and groups that want notification of events.protected void
includeWatchers(NotifyConfig.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()
-
Methods inherited from class com.google.gerrit.server.mail.send.OutgoingEmail
add, add, add, add, addByEmail, addByEmail, appendHtml, appendText, format, getFromLine, getGerritHost, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, isVisibleTo, removeHeader, removeUser, send, setFrom, setHeader, setHeader, setMessageId, setNotify, shouldSendMessage, soyHtmlTemplate, textTemplate, useHtml
-
-
-
-
Field Detail
-
branch
protected BranchNameKey branch
-
-
Constructor Detail
-
NotificationEmail
protected NotificationEmail(EmailArguments args, String messageClass, BranchNameKey branch)
-
-
Method Detail
-
init
protected void init() throws com.google.gerrit.exceptions.EmailException
Description copied from class:OutgoingEmail
Setup the message headers and envelope (TO, CC, BCC).- Overrides:
init
in classOutgoingEmail
- Throws:
com.google.gerrit.exceptions.EmailException
- if an error occurred.
-
includeWatchers
protected void includeWatchers(NotifyConfig.NotifyType type)
Include users and groups that want notification of events.
-
includeWatchers
protected void includeWatchers(NotifyConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
Include users and groups that want notification of events.
-
getWatchers
protected abstract ProjectWatch.Watchers getWatchers(NotifyConfig.NotifyType type, boolean includeWatchersFromNotifyConfig)
Returns all watchers that are relevant
-
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()
-
setupSoyContext
protected void setupSoyContext()
- Overrides:
setupSoyContext
in classOutgoingEmail
-
-