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, velocityContext
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 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 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 java.util.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.
|
java.lang.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(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() |
protected void |
setupVelocityContext() |
add, getListId, getSshHost, includeWatchers, includeWatchers
add, add, add, add, add, add, add, addByEmail, addByEmail, appendHtml, appendText, getFromLine, getGerritHost, getGerritUrl, getNameEmailFor, getNameFor, getSettingsUrl, getUserNameEmailFor, 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,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)
@Deprecated public void setChangeMessage(ChangeMessage cm)
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() throws EmailException
EmailException
protected void formatCoverLetter()
getCoverLetter()
.public java.lang.String getCoverLetter()
protected void formatChangeDetail()
public java.lang.String getChangeDetail()
protected PatchList getPatchList() throws PatchListNotAvailableException
PatchListNotAvailableException
protected ProjectState getProjectState()
protected java.util.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, PermissionBackendException
isVisibleTo
in class OutgoingEmail
to
- account.com.google.gwtorm.server.OrmException
PermissionBackendException
protected java.util.Set<Account.Id> getAuthors()
protected void setupVelocityContext()
setupVelocityContext
in class NotificationEmail
protected void setupSoyContext()
setupSoyContext
in class NotificationEmail
public boolean getIncludeDiff()
public java.lang.String getUnifiedDiff()