Class NotificationEventListener
- java.lang.Object
-
- org.nuxeo.ecm.platform.ec.notification.NotificationEventListener
-
- All Implemented Interfaces:
PostCommitEventListener
,PostCommitFilteringEventListener
public class NotificationEventListener extends Object implements PostCommitFilteringEventListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
JSF_NOTIFICATION_DOCUMENT_ID_CODEC_PREFIX
static String
NOTIFICATION_DOCUMENT_ID_CODEC_NAME
-
Constructor Summary
Constructors Constructor Description NotificationEventListener()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
acceptEvent(Event event)
Checks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
.EmailHelper
getEmailHelper()
protected List<String>
getGroupMembers(String groupId)
protected UserManager
getUserManager()
void
handleEvent(EventBundle events)
Handles the set of events that were raised during the life of an user operation.protected void
handleNotifications(Event event, List<Notification> notifs)
boolean
isInterestedInNotification(Notification notif)
void
sendNotification(Event event, DocumentEventContext ctx)
protected void
sendNotificationSignalForUser(Notification notification, String subscriptor, Event event, DocumentEventContext ctx)
void
setEmailHelper(EmailHelper emailHelper)
-
-
-
Field Detail
-
NOTIFICATION_DOCUMENT_ID_CODEC_NAME
public static final String NOTIFICATION_DOCUMENT_ID_CODEC_NAME
- See Also:
- Constant Field Values
-
JSF_NOTIFICATION_DOCUMENT_ID_CODEC_PREFIX
public static final String JSF_NOTIFICATION_DOCUMENT_ID_CODEC_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
NotificationEventListener
public NotificationEventListener()
-
-
Method Detail
-
acceptEvent
public boolean acceptEvent(Event event)
Description copied from interface:PostCommitFilteringEventListener
Checks if this event is worth passing to the asynchronousPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
.Note that the event's documents are usually disconnected into
ShallowDocumentModel
instances, which means that this method may not be able to get to all the information it would get from a standard DocumentModel implementation. If there is not enough information in the ShallowDocumentModel to decide whether this event is of interest, then this method should accept it an let the actual logic done inPostCommitEventListener.handleEvent(org.nuxeo.ecm.core.event.EventBundle)
do the final filtering.- Specified by:
acceptEvent
in interfacePostCommitFilteringEventListener
- Parameters:
event
- the event- Returns:
true
to accept it, orfalse
to ignore it
-
handleEvent
public void handleEvent(EventBundle events)
Description copied from interface:PostCommitEventListener
Handles the set of events that were raised during the life of an user operation.The events are fired as a
BundleEvent
after the transaction is committed.- Specified by:
handleEvent
in interfacePostCommitEventListener
- Parameters:
events
- the events to handle
-
handleNotifications
protected void handleNotifications(Event event, List<Notification> notifs)
-
getUserManager
protected UserManager getUserManager()
-
getGroupMembers
protected List<String> getGroupMembers(String groupId)
-
sendNotificationSignalForUser
protected void sendNotificationSignalForUser(Notification notification, String subscriptor, Event event, DocumentEventContext ctx)
-
sendNotification
public void sendNotification(Event event, DocumentEventContext ctx)
-
isInterestedInNotification
public boolean isInterestedInNotification(Notification notif)
-
getEmailHelper
public EmailHelper getEmailHelper()
-
setEmailHelper
public void setEmailHelper(EmailHelper emailHelper)
-
-