Interface NotificationResolverService
- All Known Implementing Classes:
DefaultNotificationResolverService
public interface NotificationResolverService
Creates notifications for exceptions, validation failures and actions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault NotificationcreateNotificationForAction(String actionName) createNotificationForAction(String actionName, AdditionalNotificationData additionalNotificationData) ReturnsNotificationinstance for action.default NotificationcreateNotificationForException(Throwable throwable) createNotificationForException(Throwable throwable, AdditionalNotificationData additionalNotificationData) ReturnsNotificationinstance for exception.default ValidationFailureNotificationcreateNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception) createNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotificationinstance.default ValidationFailureNotificationcreateNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType) createNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotificationinstance.
-
Method Details
-
createNotificationForValidationFailure
ValidationFailureNotification createNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotificationinstance. 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'sErrorsthat will be used to resolve validation notification messages.validationFailedOwningType- class on which validation errors were foundadditionalNotificationData- additional notification data to add to notification- Returns:
ValidationFailureNotificationinstance
-
createNotificationForValidationFailure
ValidationFailureNotification createNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception, AdditionalNotificationData additionalNotificationData) ReturnsValidationFailureNotificationinstance. 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:
ValidationFailureNotificationinstance
-
createNotificationForException
Notification createNotificationForException(Throwable throwable, AdditionalNotificationData additionalNotificationData) ReturnsNotificationinstance 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:
Notificationinstance
-
createNotificationForAction
Notification createNotificationForAction(String actionName, AdditionalNotificationData additionalNotificationData) ReturnsNotificationinstance 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:
Notificationinstance
-
createNotificationForValidationFailure
default ValidationFailureNotification createNotificationForValidationFailure(org.springframework.validation.Errors errors, Class<?> validationFailedOwningType) -
createNotificationForValidationFailure
default ValidationFailureNotification createNotificationForValidationFailure(jakarta.validation.ConstraintViolationException exception) -
createNotificationForException
-
createNotificationForAction
-