Class SubscriptionSender

Object
com.liferay.portal.kernel.util.SubscriptionSender
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GroupSubscriptionCheckSubscriptionSender

public class SubscriptionSender extends Object implements Serializable
Author:
Brian Wing Shun Chan, Máté Thurzó, Raymond Augé, Sergio González, Roberto Díaz
See Also:
  • Field Details

    • body

      protected String body
    • bulk

      protected boolean bulk
    • companyId

      @Deprecated protected long companyId
      Deprecated.
      As of Cavanaugh (7.4.x), with no direct replacement
    • creatorUserId

      protected long creatorUserId
    • currentUserId

      protected long currentUserId
    • fileAttachments

      protected List<FileAttachment> fileAttachments
    • fromAddress

      protected String fromAddress
    • fromName

      protected String fromName
    • groupId

      protected long groupId
    • htmlFormat

      protected boolean htmlFormat
    • inReplyTo

      protected String inReplyTo
    • localizedBodyMap

      protected Map<Locale,String> localizedBodyMap
    • localizedPortletTitleMap

      protected Map<Locale,String> localizedPortletTitleMap
    • localizedSubjectMap

      protected Map<Locale,String> localizedSubjectMap
    • mailId

      protected String mailId
    • portletId

      protected String portletId
    • replyToAddress

      protected String replyToAddress
    • scopeGroupId

      protected long scopeGroupId
    • serviceContext

      protected ServiceContext serviceContext
    • smtpAccount

      protected SMTPAccount smtpAccount
    • subject

      protected String subject
    • uniqueMailId

      protected boolean uniqueMailId
  • Constructor Details

    • SubscriptionSender

      public SubscriptionSender()
  • Method Details

    • addAssetEntryPersistedSubscribers

      public void addAssetEntryPersistedSubscribers(String assetEntryClassName, long assetEntryClassPK)
    • addFileAttachment

      public void addFileAttachment(File file)
    • addFileAttachment

      public void addFileAttachment(File file, String fileName)
    • addHook

      public <T> void addHook(SubscriptionSender.Hook.Event<T> event, SubscriptionSender.Hook<T> hook)
    • addPersistedSubscribers

      public void addPersistedSubscribers(String className, long classPK)
    • addPersistedSubscribers

      public void addPersistedSubscribers(String className, long classPK, boolean notifyImmediately)
    • addRuntimeSubscribers

      public void addRuntimeSubscribers(String toAddress, String toName)
    • flushNotifications

      public void flushNotifications() throws Exception
      Throws:
      Exception
    • flushNotificationsAsync

      public void flushNotificationsAsync()
    • getCompanyId

      @Deprecated public long getCompanyId()
      Deprecated.
      As of Cavanaugh (7.4.x), with no direct replacement
    • getContextAttribute

      public Object getContextAttribute(String key)
    • getCurrentUserId

      public long getCurrentUserId()
    • getMailId

      public String getMailId()
    • getServiceContext

      public ServiceContext getServiceContext()
    • hasSubscribers

      public boolean hasSubscribers()
    • initialize

      public void initialize() throws Exception
      Throws:
      Exception
    • isBulk

      public boolean isBulk()
    • sendEmailNotification

      public void sendEmailNotification(long userId) throws Exception
      Throws:
      Exception
    • setBody

      public void setBody(String body)
    • setBulk

      public void setBulk(boolean bulk)
    • setClassName

      public void setClassName(String className)
    • setClassPK

      public void setClassPK(long classPK)
    • setCompanyId

      @Deprecated public void setCompanyId(long companyId)
      Deprecated.
      As of Cavanaugh (7.4.x), with no direct replacement
    • setContextAttribute

      public void setContextAttribute(String key, EscapableObject<String> value)
    • setContextAttribute

      public void setContextAttribute(String key, Object value)
    • setContextAttribute

      public void setContextAttribute(String key, Object value, boolean escape)
    • setContextAttributes

      public void setContextAttributes(Object... values)
    • setContextCreatorUserPrefix

      public void setContextCreatorUserPrefix(String contextCreatorUserPrefix)
    • setCreatorUserId

      public void setCreatorUserId(long creatorUserId)
    • setCurrentUserId

      public void setCurrentUserId(long currentUserId)
    • setEntryTitle

      public void setEntryTitle(String entryTitle)
    • setEntryURL

      public void setEntryURL(String entryURL)
    • setFrom

      public void setFrom(String fromAddress, String fromName)
    • setGroupId

      public void setGroupId(long groupId)
    • setHtmlFormat

      public void setHtmlFormat(boolean htmlFormat)
    • setInReplyTo

      public void setInReplyTo(String inReplyTo)
    • setLocalizedBodyMap

      public void setLocalizedBodyMap(Map<Locale,String> localizedBodyMap)
    • setLocalizedContextAttribute

      public void setLocalizedContextAttribute(String key, EscapableLocalizableFunction value)
    • setLocalizedContextAttribute

      public <T extends Serializable & Function<Locale, String>> void setLocalizedContextAttribute(String key, T function)
    • setLocalizedContextAttribute

      public <T extends Serializable & Function<Locale, String>> void setLocalizedContextAttribute(String key, T function, boolean escape)
    • setLocalizedContextAttributeWithFunction

      public void setLocalizedContextAttributeWithFunction(String key, Function<Locale,String> function)
    • setLocalizedContextAttributeWithFunction

      public void setLocalizedContextAttributeWithFunction(String key, Function<Locale,String> function, boolean escape)
    • setLocalizedPortletTitleMap

      public void setLocalizedPortletTitleMap(Map<Locale,String> localizedPortletTitleMap)
    • setLocalizedSubjectMap

      public void setLocalizedSubjectMap(Map<Locale,String> localizedSubjectMap)
    • setMailId

      public void setMailId(String popPortletPrefix, Object... ids)
    • setNotificationClassName

      public void setNotificationClassName(String notificationClassName)
    • setNotificationClassNameId

      @Deprecated public void setNotificationClassNameId(long notificationClassNameId)
      Deprecated.
      As of Cavanaugh (7.4.x), replaced by setNotificationClassName(String)
    • setNotificationType

      public void setNotificationType(int notificationType)
      See Also:
    • setPortletId

      public void setPortletId(String portletId)
    • setReplyToAddress

      public void setReplyToAddress(String replyToAddress)
    • setScopeGroupId

      public void setScopeGroupId(long scopeGroupId)
      See Also:
    • setSendToCurrentUser

      public void setSendToCurrentUser(boolean sendToCurrentUser)
    • setServiceContext

      public void setServiceContext(ServiceContext serviceContext)
    • setSMTPAccount

      public void setSMTPAccount(SMTPAccount smtpAccount)
    • setSubject

      public void setSubject(String subject)
    • setUniqueMailId

      public void setUniqueMailId(boolean uniqueMailId)
    • deleteSubscription

      protected void deleteSubscription(Subscription subscription) throws Exception
      Throws:
      Exception
    • hasPermission

      protected boolean hasPermission(Subscription subscription, String className, long classPK, User user) throws Exception
      Throws:
      Exception
    • hasPermission

      protected boolean hasPermission(Subscription subscription, User user) throws Exception
      Throws:
      Exception
    • hasSubscribePermission

      protected Boolean hasSubscribePermission(PermissionChecker permissionChecker, Subscription subscription) throws PortalException
      Throws:
      PortalException
    • notifyPersistedSubscriber

      protected void notifyPersistedSubscriber(Subscription subscription, boolean notifyImmediately) throws Exception
      Throws:
      Exception
    • notifyPersistedSubscriber

      protected void notifyPersistedSubscriber(Subscription subscription, String className, long classPK, boolean notifyImmediately) throws Exception
      Throws:
      Exception
    • notifyRuntimeSubscriber

      protected void notifyRuntimeSubscriber(javax.mail.internet.InternetAddress to, Locale locale) throws Exception
      Throws:
      Exception
    • populateNotificationEventJSONObject

      protected void populateNotificationEventJSONObject(JSONObject notificationEventJSONObject)
    • processMailMessage

      protected void processMailMessage(MailMessage mailMessage, Locale locale) throws Exception
      Throws:
      Exception
    • sendEmail

      protected void sendEmail(javax.mail.internet.InternetAddress to, Locale locale) throws Exception
      Throws:
      Exception
    • sendEmailNotification

      protected void sendEmailNotification(User user) throws Exception
      Throws:
      Exception
    • sendNotification

      @Deprecated protected void sendNotification(User user) throws Exception
      Deprecated.
      As of Mueller (7.2.x)
      Throws:
      Exception
    • sendNotification

      protected void sendNotification(User user, boolean notifyImmediately) throws Exception
      Throws:
      Exception
    • sendUserNotification

      @Deprecated protected void sendUserNotification(User user) throws Exception
      Deprecated.
      As of Mueller (7.2.x)
      Throws:
      Exception
    • sendUserNotification

      protected void sendUserNotification(User user, boolean notifyImmediately) throws Exception
      Throws:
      Exception