Class BootPostOfficeImpl

java.lang.Object
org.summerboot.jexpress.integration.smtp.BootPostOfficeImpl
All Implemented Interfaces:
Comparable<Object>, HealthInspector<String>, PostOffice

public class BootPostOfficeImpl extends Object implements PostOffice
Author:
Changski Tie Zheng Zhang 张铁铮, 魏泽北, 杜旺财, 杜富贵
  • Field Details

    • appVersion

      protected String appVersion
    • log

      protected org.apache.logging.log4j.Logger log
    • debouncingData

      protected final Map<String,Long> debouncingData
  • Constructor Details

    • BootPostOfficeImpl

      public BootPostOfficeImpl()
  • Method Details

    • setAppVersion

      public void setAppVersion(String appVersion)
      Specified by:
      setAppVersion in interface PostOffice
    • updateAlertTitle

      protected String updateAlertTitle(String title)
      Update alert title
      Parameters:
      title -
      Returns:
    • updateAlertContent

      protected String updateAlertContent(String content, Throwable cause)
      Update alert content
      Parameters:
      content -
      cause -
      Returns:
    • sendAlertAsync

      public void sendAlertAsync(Collection<String> to, String title, String content, Throwable cause, boolean debouncing)
      Description copied from interface: PostOffice
      send alert email in async mode
      Specified by:
      sendAlertAsync in interface PostOffice
      Parameters:
      to -
      title -
      content -
      cause -
      debouncing -
    • sendAlertSync

      public void sendAlertSync(Collection<String> to, String title, String content, Throwable cause, boolean debouncing)
      Description copied from interface: PostOffice
      send alert email in sync mode
      Specified by:
      sendAlertSync in interface PostOffice
      Parameters:
      to -
      title -
      content -
      cause -
      debouncing -
    • sendAlert

      protected void sendAlert(Collection<String> to, String title, String content, Throwable cause, boolean debouncing, boolean async)
      The implementation of both sendAlertAsync and sendAlertSync
      Parameters:
      to -
      title -
      content -
      cause -
      debouncing -
      async -
    • sendEmailAsync

      public boolean sendEmailAsync(Collection<String> to, String title, String content, boolean isHTMLFormat)
      Description copied from interface: PostOffice
      send email in async mode
      Specified by:
      sendEmailAsync in interface PostOffice
      Parameters:
      to -
      title -
      content -
      isHTMLFormat -
      Returns:
    • sendEmailSync

      public boolean sendEmailSync(Collection<String> to, String title, String content, boolean isHTMLFormat)
      Description copied from interface: PostOffice
      send email in sync mode
      Specified by:
      sendEmailSync in interface PostOffice
      Parameters:
      to -
      title -
      content -
      isHTMLFormat -
      Returns:
      true is success
    • sendEmail

      protected boolean sendEmail(Collection<String> to, String title, String content, boolean isHTMLFormat, boolean async)
    • debounced

      protected boolean debounced(String key, int ttlMinute)
    • clean

      protected void clean(long now)
    • ping

      public List<Err> ping(String... emails)
      Specified by:
      ping in interface HealthInspector<String>