Interface NotificationResolverService
- All Known Implementing Classes:
DefaultNotificationResolverService
public interface NotificationResolverService
Creates notifications for exceptions, validation failures and actions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Notification
createNotificationForAction
(String actionName) createNotificationForAction
(String actionName, AdditionalNotificationData additionalNotificationData) ReturnsNotification
instance for action.default Notification
createNotificationForException
(Throwable throwable) createNotificationForException
(Throwable throwable, AdditionalNotificationData additionalNotificationData) ReturnsNotification
instance for exception.default ValidationFailureNotification
createNotificationForValidationFailure
(jakarta.validation.ConstraintViolationException exception) createNotificationForValidationFailure
(jakarta.validation.ConstraintViolationException exception, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotification
instance.default ValidationFailureNotification
createNotificationForValidationFailure
(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType) createNotificationForValidationFailure
(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotification
instance.
-
Method Details
-
createNotificationForValidationFailure
ValidationFailureNotification createNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotification
instance. Default severity isWARNING
. Resolved validation failure messages are added to notification messageList. Title of notification is resolved from codenotification.validation-failed.title
and content of notification is resolved from code:notification.validation-failed.content
.- Parameters:
errors
- Spring'sErrors
that will be used to resolve validation notification messages.validationFailedOwningType
- class on which validation errors were foundadditionalNotificationData
- additional notification data to add to notification- Returns:
ValidationFailureNotification
instance
-
createNotificationForValidationFailure
ValidationFailureNotification createNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotification
instance. Default severity isWARNING
. Resolved validation failure messages are added to notification messageList. Title of notification is resolved from codenotification.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) ReturnsNotification
instance for exception. Default severity isERROR
. Resolved error message is added as notification content. Title of notification is resolved from codefullyQualifiedExceptionClass.title
and content of notification is resolved from code:fullyQualifiedExceptionClass.code
.- Parameters:
throwable
- exception for which to resolve notificationadditionalNotificationData
- additional notification data to add to notification- Returns:
Notification
instance
-
createNotificationForAction
Notification createNotificationForAction(String actionName, AdditionalNotificationData additionalNotificationData) ReturnsNotification
instance for action. Default severity isINFO
. Resolved action message is added as notification content. Title of notification is resolved from codeactionName.title
and content of notification is resolved from code:actionName.code
.- Parameters:
actionName
- name of the action for which to resolve notificationadditionalNotificationData
- 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
-
createNotificationForAction
-