public abstract class ChangeEmail extends NotificationEmail
Modifier and Type | Field and Description |
---|---|
protected java.util.Set<Account.Id> |
authors |
protected Change |
change |
protected ChangeData |
changeData |
protected java.lang.String |
changeMessage |
protected boolean |
emailOnlyAuthors |
protected PatchSet |
patchSet |
protected PatchSetInfo |
patchSetInfo |
protected ProjectState |
projectState |
protected com.google.common.collect.ListMultimap<Account.Id,java.lang.String> |
stars |
protected java.sql.Timestamp |
timestamp |
branch
args, footers, fromId, messageClass, notify, soyContext, soyContextEmailData
Modifier | Constructor and Description |
---|---|
protected |
ChangeEmail(EmailArguments ea,
java.lang.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 were added as reviewers to this 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 |
formatFooter()
Format the message footer by calling
OutgoingEmail.appendText(String) . |
protected java.util.Set<Account.Id> |
getAuthors()
Find all users who are authors of any part of this change.
|
java.lang.String |
getChangeDetail()
Create the change message and the affected file list.
|
java.lang.String |
getChangeMessageThreadId() |
java.lang.String |
getChangeUrl()
Get a link to the change; null if the server doesn't know its own address.
|
java.lang.String |
getCoverLetter()
Get the text of the "cover letter".
|
boolean |
getIncludeDiff() |
protected PatchList |
getPatchList()
Get the patch list corresponding to this patch set.
|
protected PatchList |
getPatchList(int patchSetId)
Get the patch list corresponding to patch set patchSetId of this change.
|
protected ProjectState |
getProjectState()
Get the project entity the change is in; null if its been deleted.
|
java.lang.String |
getUnifiedDiff()
Show patch set as unified difference.
|
protected ProjectWatch.Watchers |
getWatchers(ProjectWatches.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(java.lang.String cm,
java.sql.Timestamp t) |
void |
setFrom(Account.Id id) |
void |
setPatchSet(PatchSet ps) |
void |
setPatchSet(PatchSet ps,
PatchSetInfo psi) |
protected void |
setupSoyContext() |
add, getInstanceAndProjectName, getShortProjectName, getSshHost, includeWatchers, includeWatchers
add, add, add, add, add, add, add, addByEmail, addByEmail, appendHtml, appendText, getFromLine, getGerritHost, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, removeHeader, removeUser, send, setAccountsToNotify, setHeader, setHeader, setNotify, shouldSendMessage, soyHtmlTemplate, supportsHtml, textTemplate, useHtml
protected final Change change
protected final ChangeData changeData
protected com.google.common.collect.ListMultimap<Account.Id,java.lang.String> stars
protected PatchSet patchSet
protected PatchSetInfo patchSetInfo
protected java.lang.String changeMessage
protected java.sql.Timestamp timestamp
protected ProjectState projectState
protected java.util.Set<Account.Id> authors
protected boolean emailOnlyAuthors
protected ChangeEmail(EmailArguments ea, java.lang.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)
public void setChangeMessage(java.lang.String cm, java.sql.Timestamp t)
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 java.lang.String getChangeUrl()
public java.lang.String getChangeMessageThreadId()
public java.lang.String getCoverLetter()
public java.lang.String getChangeDetail()
protected PatchList getPatchList(int patchSetId) throws PatchListNotAvailableException
PatchListNotAvailableException
protected PatchList getPatchList() throws PatchListNotAvailableException
PatchListNotAvailableException
protected ProjectState getProjectState()
protected void rcptToAuthors(RecipientType rt)
protected void bccStarredBy()
protected void removeUsersThatIgnoredTheChange()
protected final ProjectWatch.Watchers getWatchers(ProjectWatches.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 PermissionBackendException
isVisibleTo
in class OutgoingEmail
to
- account.PermissionBackendException
protected java.util.Set<Account.Id> getAuthors()
protected void setupSoyContext()
setupSoyContext
in class NotificationEmail
public boolean getIncludeDiff()
public java.lang.String getUnifiedDiff()