public class SubscriptionSender
extends Object
implements Serializable
Modifier and Type | Class and Description |
---|---|
static interface |
SubscriptionSender.Hook<T> |
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
SubscriptionSender() |
Modifier and Type | Method and Description |
---|---|
void |
addFileAttachment(File file) |
void |
addFileAttachment(File file,
String fileName) |
<T> void |
addHook(SubscriptionSender.Hook.Event<T> event,
SubscriptionSender.Hook<T> hook) |
void |
addPersistedSubscribers(String className,
long classPK) |
void |
addRuntimeSubscribers(String toAddress,
String toName) |
protected void |
deleteSubscription(Subscription subscription) |
void |
flushNotifications() |
void |
flushNotificationsAsync() |
long |
getCompanyId() |
Object |
getContextAttribute(String key) |
long |
getCurrentUserId() |
String |
getMailId() |
ServiceContext |
getServiceContext() |
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() |
boolean |
isBulk() |
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 |
populateNotificationEventJSONObject(JSONObject notificationEventJSONObject) |
protected void |
processMailMessage(MailMessage mailMessage,
Locale locale) |
protected String |
replaceContent(String content,
Locale locale)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
protected String |
replaceContent(String content,
Locale locale,
boolean escape)
Deprecated.
As of Judson (7.1.x), with no direct replacement
|
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 |
setLocalizedContextAttribute(String key,
EscapableLocalizableFunction value) |
<T extends Serializable & Function<Locale,String>> |
setLocalizedContextAttribute(String key,
T function) |
<T extends Serializable & Function<Locale,String>> |
setLocalizedContextAttribute(String key,
T function,
boolean escape) |
void |
setLocalizedContextAttributeWithFunction(String key,
Function<Locale,String> function) |
void |
setLocalizedContextAttributeWithFunction(String key,
Function<Locale,String> function,
boolean escape) |
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) |
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
public void addFileAttachment(File file)
public void addFileAttachment(File file, String fileName)
public <T> void addHook(SubscriptionSender.Hook.Event<T> event, SubscriptionSender.Hook<T> hook)
public void addPersistedSubscribers(String className, long classPK)
public void addRuntimeSubscribers(String toAddress, String toName)
public void flushNotifications() throws Exception
Exception
public void flushNotificationsAsync()
public long getCompanyId()
public Object getContextAttribute(String key)
public long getCurrentUserId()
public String getMailId()
public ServiceContext getServiceContext()
public void initialize() throws Exception
Exception
public boolean isBulk()
public void setBody(String body)
public void setBulk(boolean bulk)
public void setClassName(String className)
public void setClassPK(long classPK)
public void setCompanyId(long companyId)
public void setContextAttribute(String key, EscapableObject<String> value)
public void setContextAttribute(String key, Object value)
public void setContextAttribute(String key, Object value, boolean escape)
public void setContextAttributes(Object... values)
public void setContextCreatorUserPrefix(String contextCreatorUserPrefix)
public void setCreatorUserId(long creatorUserId)
public void setCurrentUserId(long currentUserId)
public void setEntryTitle(String entryTitle)
public void setEntryURL(String entryURL)
public void setFrom(String fromAddress, String fromName)
public void setGroupId(long groupId)
public void setHtmlFormat(boolean htmlFormat)
public void setInReplyTo(String inReplyTo)
public void setLocalizedBodyMap(Map<Locale,String> localizedBodyMap)
public void setLocalizedContextAttribute(String key, EscapableLocalizableFunction value)
public <T extends Serializable & Function<Locale,String>> void setLocalizedContextAttribute(String key, T function)
public <T extends Serializable & Function<Locale,String>> void setLocalizedContextAttribute(String key, T function, boolean escape)
public void setLocalizedContextAttributeWithFunction(String key, Function<Locale,String> function)
public void setLocalizedContextAttributeWithFunction(String key, Function<Locale,String> function, boolean escape)
public void setLocalizedPortletTitleMap(Map<Locale,String> localizedPortletTitleMap)
public void setLocalizedSubjectMap(Map<Locale,String> localizedSubjectMap)
public void setMailId(String popPortletPrefix, Object... ids)
public void setNotificationClassNameId(long notificationClassNameId)
public void setNotificationType(int notificationType)
UserNotificationDefinition
public void setPortletId(String portletId)
public void setReplyToAddress(String replyToAddress)
public void setScopeGroupId(long scopeGroupId)
BaseIndexer.getSiteGroupId(long)
public void setServiceContext(ServiceContext serviceContext)
public void setSMTPAccount(SMTPAccount smtpAccount)
public void setSubject(String subject)
public void setUniqueMailId(boolean uniqueMailId)
protected void deleteSubscription(Subscription subscription) throws Exception
Exception
protected boolean hasPermission(Subscription subscription, String className, long classPK, User user) throws Exception
Exception
protected boolean hasPermission(Subscription subscription, User user) throws Exception
Exception
protected Boolean hasSubscribePermission(PermissionChecker permissionChecker, Subscription subscription) throws PortalException
PortalException
protected void notifyPersistedSubscriber(Subscription subscription) throws Exception
Exception
protected void notifyPersistedSubscriber(Subscription subscription, String className, long classPK) throws Exception
Exception
protected void notifyRuntimeSubscriber(javax.mail.internet.InternetAddress to, Locale locale) throws Exception
Exception
protected void populateNotificationEventJSONObject(JSONObject notificationEventJSONObject)
protected void processMailMessage(MailMessage mailMessage, Locale locale) throws Exception
Exception
@Deprecated protected String replaceContent(String content, Locale locale) throws Exception
Exception
@Deprecated protected String replaceContent(String content, Locale locale, boolean escape) throws Exception
Exception
protected void sendEmail(javax.mail.internet.InternetAddress to, Locale locale) throws Exception
Exception
protected void sendEmailNotification(User user) throws Exception
Exception
protected void sendNotification(User user) throws Exception
Exception
protected void sendUserNotification(User user) throws Exception
Exception