Class NotificationService

java.lang.Object
de.bytestore.hostinger.system.service.NotificationService

@Component @Service public class NotificationService extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
    NotificationService(io.jmix.flowui.view.MessageBundle messageBundle)
    Constructs a NotificationService to manage notification-related functionality.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.vaadin.flow.component.notification.Notification
    createProcessPopup(String typeIO, io.jmix.flowui.backgroundtask.BackgroundTask backgroundTask)
    Creates a popup notification that monitors the progress of a background task.
    boolean
    Handles exceptions by displaying an error notification to the user.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • NotificationService

      public NotificationService(io.jmix.flowui.view.MessageBundle messageBundle)
      Constructs a NotificationService to manage notification-related functionality. Initializes the message bundle and configures it with a predefined message group. This service provides capabilities to create process popups for monitoring background tasks and notifying users about their progress, completion, or cancellation.
      Parameters:
      messageBundle - the message bundle used for localization and formatting of notification messages
  • Method Details

    • createProcessPopup

      public com.vaadin.flow.component.notification.Notification createProcessPopup(String typeIO, io.jmix.flowui.backgroundtask.BackgroundTask backgroundTask)
      Creates a popup notification that monitors the progress of a background task. Provides options to cancel the task and displays a success notification upon completion.
      Parameters:
      typeIO - the type or category of the task to be displayed in the popup notification
      backgroundTask - an instance of BackgroundTask to be monitored, including its progress and completion
      Returns:
    • handleException

      public boolean handleException(Exception ex)
      Handles exceptions by displaying an error notification to the user.
      Parameters:
      ex - the exception that occurred, containing the error details
      Returns: