public abstract class ChangeEmail extends NotificationEmail
Modifier and Type | Field and Description |
---|---|
protected Set<Account.Id> |
authors |
protected Change |
change |
protected ChangeData |
changeData |
protected String |
changeMessage |
protected boolean |
emailOnlyAuthors |
protected PatchSet |
patchSet |
protected PatchSetInfo |
patchSetInfo |
protected ProjectState |
projectState |
protected com.google.common.collect.ListMultimap<Account.Id,String> |
stars |
protected Timestamp |
timestamp |
branch
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData, velocityContext
Modifier | Constructor and Description |
---|---|
protected |
ChangeEmail(EmailArguments ea,
String mc,
ChangeData cd) |
Modifier and Type | Method and Description |
---|---|
protected void |
add(RecipientType rt,
Account.Id to)
Schedule delivery of this message to the given account.
|
protected void |
bccStarredBy()
BCC any user who has starred this change.
|
protected void |
ccAllApprovals()
Any user who has published comments on this change.
|
protected void |
ccExistingReviewers()
Users who have non-zero approval codes on the change.
|
protected void |
format()
Format the message body by calling
OutgoingEmail.appendText(String) . |
protected abstract void |
formatChange()
Format the message body by calling
OutgoingEmail.appendText(String) . |
protected void |
formatChangeDetail()
Format the change message and the affected file list.
|
protected void |
formatCoverLetter()
Format the sender's "cover letter",
getCoverLetter() . |
protected void |
formatFooter()
Format the message footer by calling
OutgoingEmail.appendText(String) . |
protected Set<Account.Id> |
getAuthors()
Find all users who are authors of any part of this change.
|
String |
getChangeDetail()
Create the change message and the affected file list.
|
String |
getChangeMessageThreadId() |
String |
getChangeUrl()
Get a link to the change; null if the server doesn't know its own address.
|
String |
getCoverLetter()
Get the text of the "cover letter".
|
boolean |
getIncludeDiff() |
protected PatchList |
getPatchList()
Get the patch list corresponding to this patch set.
|
protected Set<AccountGroup.UUID> |
getProjectOwners()
Get the groups which own the project.
|
protected ProjectState |
getProjectState()
Get the project entity the change is in; null if its been deleted.
|
String |
getUnifiedDiff()
Show patch set as unified difference.
|
protected ProjectWatch.Watchers |
getWatchers(WatchConfig.NotifyType type,
boolean includeWatchersFromNotifyConfig)
Returns all watchers that are relevant
|
protected void |
init()
Setup the message headers and envelope (TO, CC, BCC).
|
protected boolean |
isVisibleTo(Account.Id to) |
protected static ChangeData |
newChangeData(EmailArguments ea,
Project.NameKey project,
Change.Id id) |
protected void |
rcptToAuthors(RecipientType rt)
TO or CC all vested parties (change owner, patch set uploader, author).
|
protected void |
removeUsersThatIgnoredTheChange() |
void |
setChangeMessage(ChangeMessage cm)
Deprecated.
|
void |
setChangeMessage(String cm,
Timestamp t) |
void |
setFrom(Account.Id id) |
void |
setPatchSet(PatchSet ps) |
void |
setPatchSet(PatchSet ps,
PatchSetInfo psi) |
protected void |
setupSoyContext() |
protected void |
setupVelocityContext() |
add, getListId, getSshHost, includeWatchers, includeWatchers
add, add, add, appendHtml, appendText, getFromLine, getGerritHost, getGerritUrl, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, joinStrings, joinStrings, removeHeader, removeUser, send, setAccountsToNotify, setHeader, setHeader, setNotify, setVHeader, shouldSendMessage, soyHtmlTemplate, soyTextTemplate, supportsHtml, textTemplate, useHtml, velocify, velocifyFile
protected final Change change
protected final ChangeData changeData
protected com.google.common.collect.ListMultimap<Account.Id,String> stars
protected PatchSet patchSet
protected PatchSetInfo patchSetInfo
protected String changeMessage
protected Timestamp timestamp
protected ProjectState projectState
protected Set<Account.Id> authors
protected boolean emailOnlyAuthors
protected ChangeEmail(EmailArguments ea, String mc, ChangeData cd) throws com.google.gwtorm.server.OrmException
com.google.gwtorm.server.OrmException
protected static ChangeData newChangeData(EmailArguments ea, Project.NameKey project, Change.Id id)
public void setFrom(Account.Id id)
setFrom
in class OutgoingEmail
public void setPatchSet(PatchSet ps)
public void setPatchSet(PatchSet ps, PatchSetInfo psi)
@Deprecated public void setChangeMessage(ChangeMessage cm)
protected void format() throws EmailException
OutgoingEmail.appendText(String)
.format
in class OutgoingEmail
EmailException
protected abstract void formatChange() throws EmailException
OutgoingEmail.appendText(String)
.EmailException
protected void formatFooter() throws EmailException
OutgoingEmail.appendText(String)
.EmailException
- if an error occurred.protected void init() throws EmailException
init
in class NotificationEmail
EmailException
- if an error occurred.public String getChangeUrl()
public String getChangeMessageThreadId() throws EmailException
EmailException
protected void formatCoverLetter()
getCoverLetter()
.public String getCoverLetter()
protected void formatChangeDetail()
public String getChangeDetail()
protected PatchList getPatchList() throws PatchListNotAvailableException
PatchListNotAvailableException
protected ProjectState getProjectState()
protected Set<AccountGroup.UUID> getProjectOwners()
protected void rcptToAuthors(RecipientType rt)
protected void bccStarredBy()
protected void removeUsersThatIgnoredTheChange()
protected final ProjectWatch.Watchers getWatchers(WatchConfig.NotifyType type, boolean includeWatchersFromNotifyConfig) throws com.google.gwtorm.server.OrmException
NotificationEmail
getWatchers
in class NotificationEmail
com.google.gwtorm.server.OrmException
protected void ccAllApprovals()
protected void ccExistingReviewers()
protected void add(RecipientType rt, Account.Id to)
OutgoingEmail
add
in class OutgoingEmail
protected boolean isVisibleTo(Account.Id to) throws com.google.gwtorm.server.OrmException
isVisibleTo
in class OutgoingEmail
to
- account.com.google.gwtorm.server.OrmException
protected Set<Account.Id> getAuthors()
protected void setupVelocityContext()
setupVelocityContext
in class NotificationEmail
protected void setupSoyContext()
setupSoyContext
in class NotificationEmail
public boolean getIncludeDiff()
public String getUnifiedDiff()