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