Class UserRegistrationListener
java.lang.Object
com.broadleafcommerce.customer.messaging.UserRegistrationListener
Listens to customer user registration events and creates a new corresponding
Customer.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionUserRegistrationListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidacceptPendingAccountInvites(@NonNull Customer customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Automatically accepts pendingAccountInvitesfor the registered customer.protected voidassertHasServiceId(User user) protected voidassertIsCustomerType(User user) protected com.broadleafcommerce.data.tracking.core.context.ContextInfobuildContextInfo(User user) protected CustomerbuildCustomer(User user, String customerId) protected AccountInvitePropertiesprotected AccountInviteService<AccountInvite>protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtilsprotected CustomerService<Customer>protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionServiceprotected com.broadleafcommerce.common.extension.TypeFactoryvoidlisten(@NonNull org.springframework.messaging.Message<UserCreatedEvent> message) protected voidprocessMessage(@NonNull org.springframework.messaging.Message<UserCreatedEvent> message) Based on the contents of theUserCreatedEvent, create a newCustomervoidsetAccountInviteProperties(AccountInviteProperties accountInviteProperties) voidsetAccountInviteService(AccountInviteService<AccountInvite> accountInviteService) voidsetAuthenticationUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) voidsetTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory) protected voidvalidateUserPayload(User user)
-
Field Details
-
USER_ID_KEY
The key to store the user's primary ID.- See Also:
-
-
Constructor Details
-
UserRegistrationListener
public UserRegistrationListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService)
-
-
Method Details
-
listen
@StreamListener("userRegistrationInput") public void listen(@NonNull @NonNull org.springframework.messaging.Message<UserCreatedEvent> message) -
processMessage
protected void processMessage(@NonNull @NonNull org.springframework.messaging.Message<UserCreatedEvent> message) Based on the contents of theUserCreatedEvent, create a newCustomer- Parameters:
message- the message to be processed
-
buildCustomer
-
validateUserPayload
-
assertIsCustomerType
-
assertHasServiceId
-
buildContextInfo
-
acceptPendingAccountInvites
protected void acceptPendingAccountInvites(@NonNull @NonNull Customer customer, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Automatically accepts pendingAccountInvitesfor the registered customer.- Parameters:
customer- The registered customercontextInfo- Additional sandbox and multitenant info
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getCustomerService
-
getAccountInviteService
-
setAccountInviteService
@Autowired public void setAccountInviteService(AccountInviteService<AccountInvite> accountInviteService) -
getAuthenticationUtils
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils getAuthenticationUtils() -
setAuthenticationUtils
@Autowired public void setAuthenticationUtils(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) -
getAccountInviteProperties
-
setAccountInviteProperties
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory() -
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-