BrightSide Workbench Full Report + Source Code
org.turro.mail.sender.MailHeavy Class Reference
Inheritance diagram for org.turro.mail.sender.MailHeavy:
Collaboration diagram for org.turro.mail.sender.MailHeavy:

Public Member Functions

void run ()
 
- Public Member Functions inherited from org.turro.mail.sender.AbstractMailSender
IMailSender setCategory (String idCategory)
 
IMailSender setReason (String reason)
 
IMailSender setPool (String pool)
 
IMailSender setFrom (IContact from)
 
IMailSender setRoot (String root)
 
IMailSender addAdministrators ()
 
IMailSender addBySyndication (String syndication)
 
IMailSender addByRole (String role)
 
IMailSender addByEntity (Object entity, Object data)
 
IMailSender addByEntity (Object entity, boolean deep, Object data)
 
IMailSender addByEntity (String path, Object data)
 
IMailSender addByEntity (String path, boolean deep, Object data)
 
IMailSender addContact (IContact contact)
 
IMailSender addContacts (Collection< IContact > contacts)
 
IMailSender addAssistant (Assistant assistant)
 
IMailSender addAssistants (AssistantSet assistants)
 
IMailSender addUser (String name, String email)
 
IMailSender addAttachment (File file)
 
IMailSender addAttachments (Collection< File > files)
 
IMailSender addMailAttachments (Collection< MailAttachment > mas)
 
IMailSender onStart (Consumer command)
 
IMailSender onCancel (Consumer command)
 
IMailSender onBuild (Consumer command)
 
IMailSender onFinish (Consumer command)
 
AssistantSet getAssistants ()
 
void removeAttachments ()
 
IMailSender putIf (Object key, Supplier< Boolean > condition, Supplier value)
 
IMailSender put (Object key, Object value)
 
IMailSender putAll (Map attributes)
 
void send (String subject, String message)
 
void send (NotificationCategory category, String subject, String message)
 
void sendTemplate (String template, String subject) throws EmailException
 
void sendTemplate (Object entity, String template, String subject) throws EmailException
 
void sendTemplate (NotificationCategory category, Object entity, String template, String subject) throws EmailException
 
void silentSendTemplate (String template, String subject)
 
void silentSendTemplate (Object entity, String template, String subject)
 
void silentSendTemplate (NotificationCategory category, Object entity, String template, String subject)
 
String processMacros (IContact contact, String text, boolean web)
 
- Public Member Functions inherited from org.turro.action.IContactSender< IMailSender >
addAdministrators ()
 
addByEntity (Object entity, Object data)
 
addByEntity (Object entity, boolean deep, Object data)
 
addByEntity (String path, Object data)
 
addByEntity (String path, boolean deep, Object data)
 
addByRole (String role)
 
addBySyndication (String syndication)
 
addContact (IContact contact)
 
addContacts (Collection< IContact > contacts)
 
addAssistant (Assistant assistant)
 
addAssistants (AssistantSet assistants)
 
addUser (String name, String email)
 
AssistantSet getAssistants ()
 
default void copyFrom (IContactSender sender)
 

Protected Member Functions

void doSendTemplate (NotificationCategory category, Object entity, String template, String subject) throws EmailException
 
void doSend (NotificationCategory category, String subject, String message)
 
- Protected Member Functions inherited from org.turro.mail.sender.AbstractMailSender
boolean isFromValid ()
 
String getFromString ()
 
Map getAttributes ()
 

Additional Inherited Members

- Public Attributes inherited from org.turro.mail.sender.AbstractMailSender
final AssistantSet assistants = new AssistantSet()
 
- Protected Attributes inherited from org.turro.mail.sender.AbstractMailSender
String defaultCategory = GenericElephantNotification.SYSTEM_NOTIFICATION
 
String reason
 
Set< File > attachments = new HashSet<>()
 
Set< MailAttachmentmailAttachments = new HashSet<>()
 
Consumer onStart
 
IContact from
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 36 of file MailHeavy.java.

Member Function Documentation

◆ doSend()

void org.turro.mail.sender.MailHeavy.doSend ( NotificationCategory  category,
String  subject,
String  message 
)
protected

Reimplemented from org.turro.mail.sender.MailPool.

Definition at line 52 of file MailHeavy.java.

52  {
53  this.category = category;
54  this.subject = subject;
55  this.message = message;
56  doBuild();
57  }

◆ doSendTemplate()

void org.turro.mail.sender.MailHeavy.doSendTemplate ( NotificationCategory  category,
Object  entity,
String  template,
String  subject 
) throws EmailException
protected

Reimplemented from org.turro.mail.sender.MailPool.

Definition at line 43 of file MailHeavy.java.

43  {
44  this.category = category;
45  this.entity = entity;
46  this.template = template;
47  this.subject = subject;
48  doBuild();
49  }

◆ run()

void org.turro.mail.sender.MailHeavy.run ( )

Definition at line 69 of file MailHeavy.java.

69  {
70  boolean lockAcquired = HEAVY_LOCK.tryLock();
71  if(lockAcquired) {
72  try {
73  if(onStart != null) onStart.accept(MailHeavy.this);
74  onBuild.accept(MailHeavy.this);
75  if(!Strings.isBlank(template)) {
76  super.doSendTemplate(category, entity, template, subject);
77  } else {
78  super.doSend(category, subject, message);
79  }
80  } catch (Exception ex) {
81  Logger.getLogger(MailHeavy.class.getName()).log(Level.SEVERE, ElephantContext.logMsg("onBuild"), ex);
82  } finally {
83  HEAVY_LOCK.unlock();
84  }
85  } else {
86  if(onCancel != null) onCancel.accept(MailHeavy.this);
87  }
88  }

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