Package com.liferay.portal.kernel.util
Class SubscriptionSender
Object
com.liferay.portal.kernel.util.SubscriptionSender
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
GroupSubscriptionCheckSubscriptionSender
- Author:
- Brian Wing Shun Chan, Máté Thurzó, Raymond Augé, Sergio González, Roberto Díaz
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
protected boolean
protected long
Deprecated.As of Cavanaugh (7.4.x), with no direct replacementprotected long
protected long
protected List<FileAttachment>
protected String
protected String
protected long
protected boolean
protected String
protected String
protected String
protected String
protected long
protected ServiceContext
protected SMTPAccount
protected String
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAssetEntryPersistedSubscribers
(String assetEntryClassName, long assetEntryClassPK) 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
addPersistedSubscribers
(String className, long classPK, boolean notifyImmediately) void
addRuntimeSubscribers
(String toAddress, String toName) protected void
deleteSubscription
(Subscription subscription) void
void
long
Deprecated.As of Cavanaugh (7.4.x), with no direct replacementlong
protected boolean
hasPermission
(Subscription subscription, User user) protected boolean
hasPermission
(Subscription subscription, String className, long classPK, User user) protected Boolean
hasSubscribePermission
(PermissionChecker permissionChecker, Subscription subscription) boolean
void
boolean
isBulk()
protected void
notifyPersistedSubscriber
(Subscription subscription, boolean notifyImmediately) protected void
notifyPersistedSubscriber
(Subscription subscription, String className, long classPK, boolean notifyImmediately) protected void
notifyRuntimeSubscriber
(javax.mail.internet.InternetAddress to, Locale locale) protected void
populateNotificationEventJSONObject
(JSONObject notificationEventJSONObject) protected void
processMailMessage
(MailMessage mailMessage, Locale locale) protected void
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
void
setBulk
(boolean bulk) void
setClassName
(String className) void
setClassPK
(long classPK) void
setCompanyId
(long companyId) Deprecated.As of Cavanaugh (7.4.x), with no direct replacementvoid
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
void
setGroupId
(long groupId) void
setHtmlFormat
(boolean htmlFormat) void
setInReplyTo
(String inReplyTo) void
setLocalizedBodyMap
(Map<Locale, String> localizedBodyMap) void
<T extends Serializable & Function<Locale,
String>>
voidsetLocalizedContextAttribute
(String key, T function) <T extends Serializable & Function<Locale,
String>>
voidsetLocalizedContextAttribute
(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
void
setNotificationClassName
(String notificationClassName) void
setNotificationClassNameId
(long notificationClassNameId) Deprecated.As of Cavanaugh (7.4.x), replaced bysetNotificationClassName(String)
void
setNotificationType
(int notificationType) void
setPortletId
(String portletId) void
setReplyToAddress
(String replyToAddress) void
setScopeGroupId
(long scopeGroupId) void
setSendToCurrentUser
(boolean sendToCurrentUser) void
setServiceContext
(ServiceContext serviceContext) void
setSMTPAccount
(SMTPAccount smtpAccount) void
setSubject
(String subject) void
setUniqueMailId
(boolean uniqueMailId)
-
Field Details
-
body
-
bulk
protected boolean bulk -
companyId
Deprecated.As of Cavanaugh (7.4.x), with no direct replacement -
creatorUserId
protected long creatorUserId -
currentUserId
protected long currentUserId -
fileAttachments
-
fromAddress
-
fromName
-
groupId
protected long groupId -
htmlFormat
protected boolean htmlFormat -
inReplyTo
-
localizedBodyMap
-
localizedPortletTitleMap
-
localizedSubjectMap
-
mailId
-
portletId
-
replyToAddress
-
scopeGroupId
protected long scopeGroupId -
serviceContext
-
smtpAccount
-
subject
-
uniqueMailId
protected boolean uniqueMailId
-
-
Constructor Details
-
SubscriptionSender
public SubscriptionSender()
-
-
Method Details
-
addAssetEntryPersistedSubscribers
-
addFileAttachment
-
addFileAttachment
-
addHook
-
addPersistedSubscribers
-
addPersistedSubscribers
-
addRuntimeSubscribers
-
flushNotifications
- Throws:
Exception
-
flushNotificationsAsync
public void flushNotificationsAsync() -
getCompanyId
Deprecated.As of Cavanaugh (7.4.x), with no direct replacement -
getContextAttribute
-
getCurrentUserId
public long getCurrentUserId() -
getMailId
-
getServiceContext
-
hasSubscribers
public boolean hasSubscribers() -
initialize
- Throws:
Exception
-
isBulk
public boolean isBulk() -
sendEmailNotification
- Throws:
Exception
-
setBody
-
setBulk
public void setBulk(boolean bulk) -
setClassName
-
setClassPK
public void setClassPK(long classPK) -
setCompanyId
Deprecated.As of Cavanaugh (7.4.x), with no direct replacement -
setContextAttribute
-
setContextAttribute
-
setContextAttribute
-
setContextAttributes
-
setContextCreatorUserPrefix
-
setCreatorUserId
public void setCreatorUserId(long creatorUserId) -
setCurrentUserId
public void setCurrentUserId(long currentUserId) -
setEntryTitle
-
setEntryURL
-
setFrom
-
setGroupId
public void setGroupId(long groupId) -
setHtmlFormat
public void setHtmlFormat(boolean htmlFormat) -
setInReplyTo
-
setLocalizedBodyMap
-
setLocalizedContextAttribute
-
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
-
setLocalizedContextAttributeWithFunction
-
setLocalizedPortletTitleMap
-
setLocalizedSubjectMap
-
setMailId
-
setNotificationClassName
-
setNotificationClassNameId
Deprecated.As of Cavanaugh (7.4.x), replaced bysetNotificationClassName(String)
-
setNotificationType
public void setNotificationType(int notificationType) - See Also:
-
setPortletId
-
setReplyToAddress
-
setScopeGroupId
public void setScopeGroupId(long scopeGroupId) - See Also:
-
setSendToCurrentUser
public void setSendToCurrentUser(boolean sendToCurrentUser) -
setServiceContext
-
setSMTPAccount
-
setSubject
-
setUniqueMailId
public void setUniqueMailId(boolean uniqueMailId) -
deleteSubscription
- Throws:
Exception
-
hasPermission
protected boolean hasPermission(Subscription subscription, String className, long classPK, User user) throws Exception - Throws:
Exception
-
hasPermission
- 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
-
processMailMessage
- Throws:
Exception
-
sendEmail
- Throws:
Exception
-
sendEmailNotification
- Throws:
Exception
-
sendNotification
Deprecated.As of Mueller (7.2.x)- Throws:
Exception
-
sendNotification
- Throws:
Exception
-
sendUserNotification
Deprecated.As of Mueller (7.2.x)- Throws:
Exception
-
sendUserNotification
- Throws:
Exception
-