Class AccountInviteAcceptanceMessageListener
java.lang.Object
com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
com.broadleafcommerce.notification.service.messaging.AccountInviteAcceptanceMessageListener
public class AccountInviteAcceptanceMessageListener
extends AbstractEmailNotificationMessageListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.broadleafcommerce.notification.service.messaging.AbstractEmailNotificationMessageListener
EMAIL_DELIVERY, messages, notificationService, tenantProvider, typeFactory, userResolver -
Constructor Summary
ConstructorsConstructorDescriptionAccountInviteAcceptanceMessageListener(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, AccountNotificationProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionprotected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildNotificationContext(com.jayway.jsonpath.DocumentContext jsonContext) Build theContextInfofor the current messageprotected StringdetermineBaseUrl(String identifierType, String identifierValue) protected voidprotected StringgetAccountId(com.jayway.jsonpath.DocumentContext jsonContext) protected StringgetAccountName(com.jayway.jsonpath.DocumentContext jsonContext) getAdditionalArgs(com.jayway.jsonpath.DocumentContext jsonContext) protected StringGet the class name to identify this listener for handling message idempotency.protected StringgetCustomerEmail(com.jayway.jsonpath.DocumentContext jsonContext) protected StringgetCustomerId(com.jayway.jsonpath.DocumentContext jsonContext) protected StringgetCustomerName(com.jayway.jsonpath.DocumentContext jsonContext) protected StringgetIdentifierType(com.jayway.jsonpath.DocumentContext context) protected StringgetIdentifierValue(com.jayway.jsonpath.DocumentContext context) protected LocalegetLocale(com.jayway.jsonpath.DocumentContext jsonContext) protected StringgetLoginUrl(String identifierType, String identifierValue, com.jayway.jsonpath.DocumentContext jsonContext) 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.protected AccountNotificationPropertiesprotected StringgetRecipientCommunicationPreferences(String accountId, String customerId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) getRecipients(com.jayway.jsonpath.DocumentContext jsonContext) Determine the recipients to use for the email notification.voidhandleMessage(org.springframework.messaging.Message<String> message) protected voidmodifyNotification(Notification notification, com.jayway.jsonpath.DocumentContext jsonContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Extension point to allow modifying the notification or context before sending to the notification serviceprotected 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, processMessage, resolveApplicationById, setTenantProvider, setUserResolver
-
Field Details
-
CUSTOMER_EMAIL
- See Also:
-
CUSTOMER_NAME
- See Also:
-
ACCOUNT_NAME
- See Also:
-
CUSTOMER_ID
- See Also:
-
ACCOUNT_ID
- See Also:
-
ADDL_ARGS
- See Also:
-
APPLICATION_ID_PATH
- See Also:
-
TENANT_ID_PATH
- See Also:
-
CUSTOMER_CONTEXT_ID_PATH
- See Also:
-
LOCALE
- See Also:
-
IDENTIFIER_TYPE
- See Also:
-
IDENTIFIER_VALUE
- See Also:
-
MESSAGE_TYPE
- See Also:
-
ACCOUNT_INVITE_ACCEPTANCE_SUBJECT
- See Also:
-
IDENTIFIER_TYPE_PARAM
- See Also:
-
IDENTIFIER_VAL_PARAM
- See Also:
-
-
Constructor Details
-
AccountInviteAcceptanceMessageListener
public AccountInviteAcceptanceMessageListener(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, AccountNotificationProperties properties)
-
-
Method Details
-
handleMessage
@StreamListener("accountInvitationAcceptanceInputNotification") public void handleMessage(org.springframework.messaging.Message<String> message) -
getAdditionalArgs
-
getCustomerEmail
-
getCustomerName
-
getAccountName
-
getCustomerId
-
getAccountId
-
getLocale
-
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
-
modifyNotification
protected void modifyNotification(Notification notification, com.jayway.jsonpath.DocumentContext jsonContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from class:AbstractEmailNotificationMessageListenerExtension point to allow modifying the notification or context before sending to the notification service- Overrides:
modifyNotificationin classAbstractEmailNotificationMessageListener- Parameters:
notification- the Notification for the current messagejsonContext- the message payloadcontext- The context of the request
-
determineSupportedResolutionTypes
protected void determineSupportedResolutionTypes() -
getLoginUrl
-
determineBaseUrl
-
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
-
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
-
getRecipientCommunicationPreferences
-
getIdentifierType
-
getIdentifierValue
-
getProperties
-