Class NotificationServiceImpl
java.lang.Object
ch.tocco.nice2.notificationcenter.impl.NotificationServiceImpl
- All Implemented Interfaces:
NotificationService
@Component("notificationCenterNotificationServiceImpl")
public class NotificationServiceImpl
extends Object
implements NotificationService
-
Constructor Summary
ConstructorDescriptionNotificationServiceImpl
(SecurityManager securityManager, Context context, ContextManager contextManager, PrincipalService principalService, QueryBuilderFactory queryBuilderFactory, PersistenceService persistenceService, TextResources textResources, ClientType clientType) -
Method Summary
Modifier and TypeMethodDescriptioncreateNotification
(String title, String message, Notification.NotificationType notificationType) Creates a notification that is displayed on the client.void
createNotificationAfterCommit
(String title, String message, Notification.NotificationType notificationType, Collection<Entity> resultEntities) Creates a notification (in an after commit listener) that is displayed on the client Note: E.g.createNotificationWithProgress
(String title, String message, Notification.NotificationType notificationType, boolean supportsCancellation) Creates a notification that is displayed on the client.
-
Constructor Details
-
NotificationServiceImpl
public NotificationServiceImpl(SecurityManager securityManager, Context context, ContextManager contextManager, PrincipalService principalService, QueryBuilderFactory queryBuilderFactory, PersistenceService persistenceService, TextResources textResources, ClientType clientType)
-
-
Method Details
-
createNotification
public Notification createNotification(String title, String message, Notification.NotificationType notificationType) Description copied from interface:NotificationService
Creates a notification that is displayed on the client. This method should primarily be used for static events ('entity has been created'). Note: The notifications are only created if the request context is set up correctly.- Specified by:
createNotification
in interfaceNotificationService
-
createNotificationWithProgress
public NotificationWithProgress createNotificationWithProgress(String title, String message, Notification.NotificationType notificationType, boolean supportsCancellation) Description copied from interface:NotificationService
Creates a notification that is displayed on the client. This method should primarily be used for background tasks, as the progress can be updated while the task is running. Note: The notifications are only created if the request context is set up correctly.- Specified by:
createNotificationWithProgress
in interfaceNotificationService
-
findNotificationWithProgressByTaskId
- Specified by:
findNotificationWithProgressByTaskId
in interfaceNotificationService
-
createNotificationAfterCommit
public void createNotificationAfterCommit(String title, String message, Notification.NotificationType notificationType, Collection<Entity> resultEntities) Description copied from interface:NotificationService
Creates a notification (in an after commit listener) that is displayed on the client Note: E.g. This method should be used if in a listener a notification should be sent to the user. The notification is only sent if the transaction is committed. Note: The notifications are only created if the request context is set up correctly.- Specified by:
createNotificationAfterCommit
in interfaceNotificationService
-