Liferay 7.0-ce-b4

com.liferay.portal.util
Class SubscriptionSender

java.lang.Object
  extended by com.liferay.portal.util.SubscriptionSender
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
GroupSubscriptionCheckSubscriptionSender

public class SubscriptionSender
extends Object
implements Serializable

See Also:
Serialized Form

Field Summary
protected  String body
           
protected  boolean bulk
           
protected  long companyId
           
protected  long creatorUserId
           
protected  long currentUserId
           
protected  List<FileAttachment> fileAttachments
           
protected  String fromAddress
           
protected  String fromName
           
protected  long groupId
           
protected  boolean htmlFormat
           
protected  String inReplyTo
           
protected  Map<Locale,String> localizedBodyMap
           
protected  Map<Locale,String> localizedPortletTitleMap
           
protected  Map<Locale,String> localizedSubjectMap
           
protected  String mailId
           
protected  String portletId
           
protected  String replyToAddress
           
protected  long scopeGroupId
           
protected  ServiceContext serviceContext
           
protected  SMTPAccount smtpAccount
           
protected  String subject
           
protected  boolean uniqueMailId
           
 
Constructor Summary
SubscriptionSender()
           
 
Method Summary
 void addFileAttachment(File file)
           
 void addFileAttachment(File file, String fileName)
           
 void addPersistedSubscribers(String className, long classPK)
           
 void addRuntimeSubscribers(String toAddress, String toName)
           
protected  void deleteSubscription(Subscription subscription)
           
 void flushNotifications()
           
 void flushNotificationsAsync()
           
 Object getContextAttribute(String key)
           
 long getCurrentUserId()
           
 String getMailId()
           
 long getUserId()
          Deprecated. As of 7.0.0, replaced by getCurrentUserId()
protected  boolean hasPermission(Subscription subscription, String className, long classPK, User user)
           
protected  boolean hasPermission(Subscription subscription, User user)
           
protected  Boolean hasSubscribePermission(PermissionChecker permissionChecker, Subscription subscription)
           
 void initialize()
           
protected  void notifyPersistedSubscriber(Subscription subscription)
           
protected  void notifyPersistedSubscriber(Subscription subscription, String className, long classPK)
           
protected  void notifyRuntimeSubscriber(javax.mail.internet.InternetAddress to, Locale locale)
           
protected  void notifySubscriber(Subscription subscription)
          Deprecated. As of 6.2.0, replaced by notifyPersistedSubscriber(Subscription)
protected  void notifySubscriber(Subscription subscription, String inferredClassName, long inferredClassPK)
          Deprecated. As of 7.0.0, replaced by notifyPersistedSubscriber(Subscription)
protected  void processMailMessage(MailMessage mailMessage, Locale locale)
           
protected  String replaceContent(String content, Locale locale)
           
protected  String replaceContent(String content, Locale locale, boolean escape)
           
protected  void sendEmail(javax.mail.internet.InternetAddress to, Locale locale)
           
protected  void sendEmailNotification(User user)
           
protected  void sendNotification(User user)
           
protected  void sendUserNotification(User user)
           
 void setBody(String body)
           
 void setBulk(boolean bulk)
           
 void setClassName(String className)
           
 void setClassPK(long classPK)
           
 void setCompanyId(long companyId)
           
 void setContextAttribute(String key, EscapableObject<String> value)
           
 void setContextAttribute(String key, Object value)
           
 void setContextAttribute(String key, Object value, boolean escape)
           
 void setContextAttributes(Object... values)
           
 void setContextCreatorUserPrefix(String contextCreatorUserPrefix)
           
 void setCreatorUserId(long creatorUserId)
           
 void setCurrentUserId(long currentUserId)
           
 void setEntryTitle(String entryTitle)
           
 void setEntryURL(String entryURL)
           
 void setFrom(String fromAddress, String fromName)
           
 void setGroupId(long groupId)
           
 void setHtmlFormat(boolean htmlFormat)
           
 void setInReplyTo(String inReplyTo)
           
 void setLocalizedBodyMap(Map<Locale,String> localizedBodyMap)
           
 void setLocalizedPortletTitleMap(Map<Locale,String> localizedPortletTitleMap)
           
 void setLocalizedSubjectMap(Map<Locale,String> localizedSubjectMap)
           
 void setMailId(String popPortletPrefix, Object... ids)
           
 void setNotificationClassNameId(long notificationClassNameId)
           
 void setNotificationType(int notificationType)
           
 void setPortletId(String portletId)
           
 void setReplyToAddress(String replyToAddress)
           
 void setScopeGroupId(long scopeGroupId)
           
 void setServiceContext(ServiceContext serviceContext)
           
 void setSMTPAccount(SMTPAccount smtpAccount)
           
 void setSubject(String subject)
           
 void setUniqueMailId(boolean uniqueMailId)
           
 void setUserId(long userId)
          Deprecated. As of 7.0.0, replaced by setCurrentUserId(long)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

body

protected String body

bulk

protected boolean bulk

companyId

protected long companyId

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 Detail

SubscriptionSender

public SubscriptionSender()
Method Detail

addFileAttachment

public void addFileAttachment(File file)

addFileAttachment

public void addFileAttachment(File file,
                              String fileName)

addPersistedSubscribers

public void addPersistedSubscribers(String className,
                                    long classPK)

addRuntimeSubscribers

public void addRuntimeSubscribers(String toAddress,
                                  String toName)

flushNotifications

public void flushNotifications()
                        throws Exception
Throws:
Exception

flushNotificationsAsync

public void flushNotificationsAsync()

getContextAttribute

public Object getContextAttribute(String key)

getCurrentUserId

public long getCurrentUserId()

getMailId

public String getMailId()

getUserId

@Deprecated
public long getUserId()
Deprecated. As of 7.0.0, replaced by getCurrentUserId()


initialize

public void initialize()
                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

public void setCompanyId(long companyId)

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)

setLocalizedPortletTitleMap

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

setLocalizedSubjectMap

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

setMailId

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

setNotificationClassNameId

public void setNotificationClassNameId(long notificationClassNameId)

setNotificationType

public void setNotificationType(int notificationType)
See Also:
UserNotificationDefinition

setPortletId

public void setPortletId(String portletId)

setReplyToAddress

public void setReplyToAddress(String replyToAddress)

setScopeGroupId

public void setScopeGroupId(long scopeGroupId)
See Also:
BaseIndexer.getSiteGroupId(long)

setServiceContext

public void setServiceContext(ServiceContext serviceContext)

setSMTPAccount

public void setSMTPAccount(SMTPAccount smtpAccount)

setSubject

public void setSubject(String subject)

setUniqueMailId

public void setUniqueMailId(boolean uniqueMailId)

setUserId

@Deprecated
public void setUserId(long userId)
Deprecated. As of 7.0.0, replaced by setCurrentUserId(long)


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)
                                  throws Exception
Throws:
Exception

notifyPersistedSubscriber

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

notifyRuntimeSubscriber

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

notifySubscriber

@Deprecated
protected void notifySubscriber(Subscription subscription)
                         throws Exception
Deprecated. As of 6.2.0, replaced by notifyPersistedSubscriber(Subscription)

Throws:
Exception

notifySubscriber

@Deprecated
protected void notifySubscriber(Subscription subscription,
                                           String inferredClassName,
                                           long inferredClassPK)
                         throws Exception
Deprecated. As of 7.0.0, replaced by notifyPersistedSubscriber(Subscription)

Throws:
Exception

processMailMessage

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

replaceContent

protected String replaceContent(String content,
                                Locale locale)
                         throws Exception
Throws:
Exception

replaceContent

protected String replaceContent(String content,
                                Locale locale,
                                boolean escape)
                         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

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

sendUserNotification

protected void sendUserNotification(User user)
                             throws Exception
Throws:
Exception

Liferay 7.0-ce-b4