Class UserSubscriptionNotificationSendingHandler
- java.lang.Object
-
- org.silverpeas.core.notification.user.UserSubscriptionNotificationSendingHandler
-
- All Implemented Interfaces:
ContributionOperationContextPropertyHandler
@Technical @Service public class UserSubscriptionNotificationSendingHandler extends Object implements ContributionOperationContextPropertyHandler
This class handles the feature that permits to skip the user subscription notification sending.- Author:
- Yohann Chastagnier
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
UserSubscriptionNotificationSendingHandler()
Hidden constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static UserSubscriptionNotificationSendingHandler
get()
String
getSubscriptionNotificationUserNoteFromCurrentRequest()
Gets a user note to paste into subscription notification message from the current request.boolean
isSubscriptionNotificationEnabledForCurrentRequest()
Indicates if the user subscription notification sending is enabled for the current request.void
parseForProperty(javax.servlet.http.HttpServletRequest request)
Verifies from a request if it is indicated that subscription notification sending must be skipped for the current request (from request parameters or request headers).void
skipNotificationSend()
Forces the context by indicating to skip the sending of subscription notifications.
-
-
-
Method Detail
-
get
public static UserSubscriptionNotificationSendingHandler get()
-
parseForProperty
public void parseForProperty(javax.servlet.http.HttpServletRequest request)
Verifies from a request if it is indicated that subscription notification sending must be skipped for the current request (from request parameters or request headers).- Specified by:
parseForProperty
in interfaceContributionOperationContextPropertyHandler
- Parameters:
request
- the current HTTP request.
-
skipNotificationSend
public void skipNotificationSend()
Forces the context by indicating to skip the sending of subscription notifications.This method permits to indicate a such context by bypassing an HTTP request decoding.
The context is also registered into a thread cache, like it is done with the HTTP request decoding.
-
isSubscriptionNotificationEnabledForCurrentRequest
public boolean isSubscriptionNotificationEnabledForCurrentRequest()
Indicates if the user subscription notification sending is enabled for the current request.- Returns:
- true if enabled, false otherwise.
-
getSubscriptionNotificationUserNoteFromCurrentRequest
@Nullable public String getSubscriptionNotificationUserNoteFromCurrentRequest()
Gets a user note to paste into subscription notification message from the current request.- Returns:
- the note or null if no such note exists.
-
-