public abstract class OutgoingEmail
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected EmailArguments |
args |
protected com.google.gerrit.reviewdb.client.Account.Id |
fromId |
protected java.lang.String |
messageClass |
protected org.apache.velocity.VelocityContext |
velocityContext |
Modifier | Constructor and Description |
---|---|
protected |
OutgoingEmail(EmailArguments ea,
java.lang.String mc) |
Modifier and Type | Method and Description |
---|---|
protected void |
add(RecipientType rt,
com.google.gerrit.reviewdb.client.Account.Id to)
Schedule delivery of this message to the given account.
|
protected void |
add(RecipientType rt,
Address addr)
Schedule delivery of this message to the given account.
|
protected void |
add(RecipientType rt,
java.util.Collection<com.google.gerrit.reviewdb.client.Account.Id> list)
Schedule this message for delivery to the listed accounts.
|
protected void |
add(RecipientType rt,
com.google.gerrit.reviewdb.client.UserIdentity who) |
protected void |
appendText(java.lang.String text)
Append text to the outgoing email body.
|
protected abstract void |
format()
Format the message body by calling
appendText(String) . |
protected java.lang.String |
getFromLine() |
java.lang.String |
getGerritHost() |
java.lang.String |
getGerritUrl() |
java.lang.String |
getNameEmailFor(com.google.gerrit.reviewdb.client.Account.Id accountId) |
protected java.lang.String |
getNameFor(com.google.gerrit.reviewdb.client.Account.Id accountId)
Lookup a human readable name for an account, usually the "full name".
|
java.lang.String |
getSettingsUrl() |
protected void |
init()
Setup the message headers and envelope (TO, CC, BCC).
|
protected boolean |
isVisibleTo(com.google.gerrit.reviewdb.client.Account.Id to) |
java.lang.String |
joinStrings(java.lang.Iterable<java.lang.Object> in,
java.lang.String joiner) |
java.lang.String |
joinStrings(java.util.Iterator<java.lang.Object> in,
java.lang.String joiner) |
void |
send()
Format and enqueue the message for delivery.
|
void |
setFrom(com.google.gerrit.reviewdb.client.Account.Id id) |
protected void |
setHeader(java.lang.String name,
java.util.Date date) |
protected void |
setHeader(java.lang.String name,
java.lang.String value)
Set a header in the outgoing message.
|
protected void |
setupVelocityContext() |
protected void |
setVHeader(java.lang.String name,
java.lang.String value)
Set a header in the outgoing message using a template.
|
protected boolean |
shouldSendMessage() |
protected java.lang.String |
velocify(java.lang.String template) |
protected java.lang.String |
velocifyFile(java.lang.String name) |
protected java.lang.String messageClass
protected org.apache.velocity.VelocityContext velocityContext
protected final EmailArguments args
protected com.google.gerrit.reviewdb.client.Account.Id fromId
protected OutgoingEmail(EmailArguments ea, java.lang.String mc)
public void setFrom(com.google.gerrit.reviewdb.client.Account.Id id)
public void send() throws com.google.gerrit.common.errors.EmailException
com.google.gerrit.common.errors.EmailException
protected abstract void format() throws com.google.gerrit.common.errors.EmailException
appendText(String)
.com.google.gerrit.common.errors.EmailException
protected void init() throws com.google.gerrit.common.errors.EmailException
com.google.gerrit.common.errors.EmailException
- if an error occurred.protected java.lang.String getFromLine()
public java.lang.String getGerritHost()
public java.lang.String getSettingsUrl()
public java.lang.String getGerritUrl()
protected void setVHeader(java.lang.String name, java.lang.String value) throws com.google.gerrit.common.errors.EmailException
com.google.gerrit.common.errors.EmailException
protected void setHeader(java.lang.String name, java.lang.String value)
protected void setHeader(java.lang.String name, java.util.Date date)
protected void appendText(java.lang.String text)
protected java.lang.String getNameFor(com.google.gerrit.reviewdb.client.Account.Id accountId)
public java.lang.String getNameEmailFor(com.google.gerrit.reviewdb.client.Account.Id accountId)
protected boolean shouldSendMessage()
protected void add(RecipientType rt, java.util.Collection<com.google.gerrit.reviewdb.client.Account.Id> list)
protected void add(RecipientType rt, com.google.gerrit.reviewdb.client.UserIdentity who)
protected void add(RecipientType rt, com.google.gerrit.reviewdb.client.Account.Id to)
protected boolean isVisibleTo(com.google.gerrit.reviewdb.client.Account.Id to) throws com.google.gwtorm.server.OrmException
to
- account.com.google.gwtorm.server.OrmException
protected void add(RecipientType rt, Address addr)
protected void setupVelocityContext()
protected java.lang.String velocify(java.lang.String template) throws com.google.gerrit.common.errors.EmailException
com.google.gerrit.common.errors.EmailException
protected java.lang.String velocifyFile(java.lang.String name) throws com.google.gerrit.common.errors.EmailException
com.google.gerrit.common.errors.EmailException
public java.lang.String joinStrings(java.lang.Iterable<java.lang.Object> in, java.lang.String joiner)
public java.lang.String joinStrings(java.util.Iterator<java.lang.Object> in, java.lang.String joiner)