Class UserRegistrationListener
java.lang.Object
com.broadleafcommerce.customer.messaging.UserRegistrationListener
Listens to customer user registration events and creates a new corresponding
Customer
.-
Field Summary
-
Constructor Summary
ConstructorDescriptionUserRegistrationListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
acceptPendingAccountInvites
(@NonNull Customer customer, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Automatically accepts pendingAccountInvites
for the registered customer.protected void
assertHasServiceId
(User user) protected void
assertIsCustomerType
(User user) protected com.broadleafcommerce.data.tracking.core.context.ContextInfo
buildContextInfo
(User user) protected Customer
buildCustomer
(User user, String customerId) protected AccountInviteProperties
protected AccountInviteService<AccountInvite>
protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils
protected CustomerService<Customer>
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
protected com.broadleafcommerce.common.extension.TypeFactory
void
listen
(@NonNull org.springframework.messaging.Message<UserCreatedEvent> message) protected void
processMessage
(@NonNull org.springframework.messaging.Message<UserCreatedEvent> message) Based on the contents of theUserCreatedEvent
, create a newCustomer
void
setAccountInviteProperties
(AccountInviteProperties accountInviteProperties) void
setAccountInviteService
(AccountInviteService<AccountInvite> accountInviteService) void
setAuthenticationUtils
(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils) void
setTypeFactory
(com.broadleafcommerce.common.extension.TypeFactory typeFactory) protected void
validateUserPayload
(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 pendingAccountInvites
for 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)
-