Interface NotificationResolverService

All Known Implementing Classes:
DefaultNotificationResolverService

public interface NotificationResolverService
Creates notifications for exceptions, validation failures and actions.
  • Method Details

    • createNotificationForValidationFailure

      ValidationFailureNotification createNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType, AdditionalNotificationData additionalNotificationData)
      Returns ValidationFailureNotification instance. Default severity is
      WARNING
      . Resolved validation failure messages are added to notification messageList. Title of notification is resolved from code
      notification.validation-failed.title
      and content of notification is resolved from code:
      notification.validation-failed.content
      .
      Parameters:
      errors - Spring's Errors that will be used to resolve validation notification messages.
      validationFailedOwningType - class on which validation errors were found
      additionalNotificationData - additional notification data to add to notification
      Returns:
      ValidationFailureNotification instance
    • createNotificationForValidationFailure

      ValidationFailureNotification createNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception, AdditionalNotificationData additionalNotificationData)
      Returns ValidationFailureNotification instance. Default severity is
      WARNING
      . Resolved validation failure messages are added to notification messageList. Title of notification is resolved from code
      notification.validation-failed.title
      and content of notification is resolved from code:
      notification.validation-failed.content
      .
      Parameters:
      exception - validation exception that will be used to resolve validation notification messages.
      additionalNotificationData - additional notification data to add to notification
      Returns:
      ValidationFailureNotification instance
    • createNotificationForException

      Notification createNotificationForException(Throwable throwable, AdditionalNotificationData additionalNotificationData)
      Returns Notification instance for exception. Default severity is
      ERROR
      . Resolved error message is added as notification content. Title of notification is resolved from code
      fullyQualifiedExceptionClass.title
      and content of notification is resolved from code:
      fullyQualifiedExceptionClass.code
      .
      Parameters:
      throwable - exception for which to resolve notification
      additionalNotificationData - additional notification data to add to notification
      Returns:
      Notification instance
    • createNotificationForAction

      Notification createNotificationForAction(String actionName, AdditionalNotificationData additionalNotificationData)
      Returns Notification instance for action. Default severity is
      INFO
      . Resolved action message is added as notification content. Title of notification is resolved from code
      actionName.title
      and content of notification is resolved from code:
      actionName.code
      .
      Parameters:
      actionName - name of the action for which to resolve notification
      additionalNotificationData - additional notification data to add to notification
      Returns:
      Notification instance
    • createNotificationForValidationFailure

      default ValidationFailureNotification createNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType)
    • createNotificationForValidationFailure

      default ValidationFailureNotification createNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception)
    • createNotificationForException

      default Notification createNotificationForException(Throwable throwable)
    • createNotificationForAction

      default Notification createNotificationForAction(String actionName)