Class NotificationCartApprovalRequestListener
java.lang.Object
com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
com.broadleafcommerce.notification.service.messaging.NotificationCartApprovalRequestListener
public class NotificationCartApprovalRequestListener
extends AbstractEmailNotificationMessageListener
- Author:
- Nathan Moore (nathandmoore)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a summary of an Approver. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
EMAIL_DELIVERY, messages, notificationService, tenantProvider, typeFactory, userResolver -
Constructor Summary
ConstructorsConstructorDescriptionNotificationCartApprovalRequestListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, NotificationService<Notification> notificationService, org.springframework.context.MessageSource messages, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildNotificationContext(com.jayway.jsonpath.DocumentContext jsonContext) Build theContextInfofor the current messagegetApproverCommunicationPreferenceMap(String accountId, @NonNull List<String> approverIds, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) protected StringGet the class name to identify this listener for handling message idempotency.protected StringgetMessageType(com.jayway.jsonpath.DocumentContext jsonContext) Determine which message type should be sent.protected StringgetNotificationSubject(com.jayway.jsonpath.DocumentContext jsonContext) Determine the subject to use for the email notification.getRecipients(com.jayway.jsonpath.DocumentContext jsonContext) Determine the recipients to use for the email notification.voidhandleMessage(org.springframework.messaging.Message<String> message) protected booleanvalidateShouldSendNotification(com.jayway.jsonpath.DocumentContext jsonContext) Validate that the message state is valid to send the email.Methods inherited from class com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
buildNotification, buildNotification, getDocumentContext, getIdempotentConsumptionService, getMessages, getNotificationService, getObjectMapper, getPayload, getTenantProvider, getTypeFactory, getUserResolver, handleMessageInternal, modifyNotification, modifyNotification, processMessage, resolveApplicationById, setTenantProvider, setUserResolver
-
Field Details
-
EXPECTED_STATUS
- See Also:
-
MESSAGE_TYPE
- See Also:
-
SUBJECT_MESSAGE
- See Also:
-
CART_NEW_STATUS_PATH
- See Also:
-
APPLICATION_ID_PATH
- See Also:
-
TENANT_ID_PATH
- See Also:
-
CUSTOMER_CONTEXT_ID_PATH
- See Also:
-
SUBMITTER_FULL_NAME
- See Also:
-
APPROVERS
- See Also:
-
LOCALE
- See Also:
-
ACCOUNT_ID_PATH
- See Also:
-
-
Constructor Details
-
NotificationCartApprovalRequestListener
public NotificationCartApprovalRequestListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, NotificationService<Notification> notificationService, org.springframework.context.MessageSource messages, com.fasterxml.jackson.databind.ObjectMapper objectMapper, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
handleMessage
@StreamListener("cartApprovalRequestNotificationInput") public void handleMessage(org.springframework.messaging.Message<String> message) -
getClassName
Description copied from class:AbstractEmailNotificationMessageListenerGet the class name to identify this listener for handling message idempotency.- Specified by:
getClassNamein classAbstractEmailNotificationMessageListener- Returns:
- the listener's class name
-
validateShouldSendNotification
protected boolean validateShouldSendNotification(com.jayway.jsonpath.DocumentContext jsonContext) Description copied from class:AbstractEmailNotificationMessageListenerValidate that the message state is valid to send the email.- Specified by:
validateShouldSendNotificationin classAbstractEmailNotificationMessageListener- Parameters:
jsonContext- the message payload- Returns:
- whether the email should be sent
-
getMessageType
Description copied from class:AbstractEmailNotificationMessageListenerDetermine which message type should be sent.- Specified by:
getMessageTypein classAbstractEmailNotificationMessageListener- Parameters:
jsonContext- the message payload- Returns:
- the message type to send
-
getNotificationSubject
Description copied from class:AbstractEmailNotificationMessageListenerDetermine the subject to use for the email notification.- Specified by:
getNotificationSubjectin classAbstractEmailNotificationMessageListener- Parameters:
jsonContext- the message payload- Returns:
- the subject to use for the email notification
-
getRecipients
Description copied from class:AbstractEmailNotificationMessageListenerDetermine the recipients to use for the email notification.- Specified by:
getRecipientsin classAbstractEmailNotificationMessageListener- Parameters:
jsonContext- the message payload- Returns:
- the recipients to use for the email notification
-
getApproverCommunicationPreferenceMap
-
buildNotificationContext
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildNotificationContext(com.jayway.jsonpath.DocumentContext jsonContext) Description copied from class:AbstractEmailNotificationMessageListenerBuild theContextInfofor the current message- Specified by:
buildNotificationContextin classAbstractEmailNotificationMessageListener- Parameters:
jsonContext- the payload of the message- Returns:
- the NotificationContext for the current message
-