BrightSide Workbench Full Report + Source Code
org.turro.mail.pool.MailMessagePool Class Reference

Public Member Functions

MailMessage addToPoolTemplate (String from, String to, String cc, String subject, String message, String template, String name, String login)
 
MailMessage addToPoolTemplate (String from, String to, String cc, String subject, String message, String template, String name, String login, Map args)
 
MailMessage addToPool (String from, String to, String cc, String subject, String message)
 
MailMessage addToPool (MailMessage mail) throws EmailException
 
void sendPool ()
 
void sendPool (Consumer onFinish)
 
MailProvider getProvider ()
 
 MailMessagePool (IConstructor constructor, MailProvider provider)
 

Static Public Member Functions

static MailMessagePool of (IConstructor constructor, MailProvider provider)
 

Detailed Description

Constructor & Destructor Documentation

◆ MailMessagePool()

org.turro.mail.pool.MailMessagePool.MailMessagePool ( IConstructor  constructor,
MailProvider  provider 
)

Definition at line 143 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

143  {
144  this.constructor = constructor;
145  this.provider = provider;
146  }
Here is the caller graph for this function:

Member Function Documentation

◆ addToPool() [1/2]

MailMessage org.turro.mail.pool.MailMessagePool.addToPool ( MailMessage  mail) throws EmailException

Definition at line 94 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

94  {
95  try {
96  mail.addHeader("X-Mailer", "Elephant Mail System");
97  mail.setSentDate(date);
98  mail.setSubject(cleanSubject(mail.getSubject()));
99 
100  pool.add(mail);
101 
102  WebLoggers.info(this).message("Added mail from %s to %s. Subject: %s",
103  mail.getProvider().getFrom().getMail(),
104  InternetAddress.toString((InternetAddress[]) mail.getEmail().getToAddresses().toArray(new InternetAddress[0])),
105  mail.getSubject()
106  ).log();
107 
108  return mail;
109  } catch(Exception ex) {
110  WebLoggers.severe(this).exception(ex).log();
111  }
112  return null;
113  }
Here is the call graph for this function:

◆ addToPool() [2/2]

MailMessage org.turro.mail.pool.MailMessagePool.addToPool ( String  from,
String  to,
String  cc,
String  subject,
String  message 
)

Definition at line 75 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

75  {
76  try {
77  if (to == null) {
78  return null;
79  }
80  MailMessage mail = MailMessage.of(provider);
81  mail.addTo(to);
82  if (cc != null) {
83  mail.addCc(cc);
84  }
85  mail.setSubject(subject);
86  mail.setMessage(message);
87  return addToPool(mail);
88  } catch (EmailException ex) {
89  WebLoggers.severe(this).exception(ex).log();
90  }
91  return null;
92  }
MailMessage addToPool(String from, String to, String cc, String subject, String message)
Here is the caller graph for this function:

◆ addToPoolTemplate() [1/2]

MailMessage org.turro.mail.pool.MailMessagePool.addToPoolTemplate ( String  from,
String  to,
String  cc,
String  subject,
String  message,
String  template,
String  name,
String  login 
)

Definition at line 44 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

45  {
46  return addToPoolTemplate(from, to, cc, subject, message, template, name, login, null);
47  }
MailMessage addToPoolTemplate(String from, String to, String cc, String subject, String message, String template, String name, String login)

◆ addToPoolTemplate() [2/2]

MailMessage org.turro.mail.pool.MailMessagePool.addToPoolTemplate ( String  from,
String  to,
String  cc,
String  subject,
String  message,
String  template,
String  name,
String  login,
Map  args 
)

Definition at line 49 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

50  {
51  try {
52  if (to == null) {
53  return null;
54  }
55  MailMessageTemplate mmt = MailMessageTemplate.of(provider);
56  mmt.setSubject(subject);
57  mmt.addTo(to);
58  if (cc != null) {
59  mmt.addCc(cc);
60  }
61  ElephantMarker em = new ElephantMarker(constructor, true);
62  em.put("email", to);
63  em.put("body", message);
64  if(args != null) {
65  em.putAll(args);
66  }
67  mmt.setMessage(em, template, to, name);
68  return addToPool(mmt);
69  } catch (EmailException ex) {
70  WebLoggers.severe(this).exception(ex).log();
71  }
72  return null;
73  }

◆ getProvider()

MailProvider org.turro.mail.pool.MailMessagePool.getProvider ( )

Definition at line 124 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

124  {
125  return provider;
126  }
Here is the caller graph for this function:

◆ of()

static MailMessagePool org.turro.mail.pool.MailMessagePool.of ( IConstructor  constructor,
MailProvider  provider 
)
static

Definition at line 139 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

139  {
140  return new MailMessagePool(constructor, provider);
141  }
Here is the call graph for this function:

◆ sendPool() [1/2]

void org.turro.mail.pool.MailMessagePool.sendPool ( )

Definition at line 115 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

Here is the caller graph for this function:

◆ sendPool() [2/2]

void org.turro.mail.pool.MailMessagePool.sendPool ( Consumer  onFinish)

Definition at line 119 of file elephant-mail/src/main/java/org/turro/mail/pool/MailMessagePool.java.

119  {
120  MailQueueConsumer.getInstance().addToQueue(pool, onFinish);
121  pool.clear();
122  }
Here is the call graph for this function:

The documentation for this class was generated from the following file: