Class UserCreationListener
java.lang.Object
com.broadleafcommerce.customer.messaging.UserCreationListener
-
Field Summary
-
Constructor Summary
ConstructorDescriptionUserCreationListener
(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService) -
Method Summary
Modifier and TypeMethodDescriptionprotected CustomerService<Customer>
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
void
listen
(@NonNull org.springframework.messaging.Message<UserCreatedEvent> message) protected void
processStateChange
(@NonNull org.springframework.messaging.Message<UserCreatedEvent> message) Based on the contents of theUserCreatedEvent
, update the Customer with the providedUser
dataprotected void
updateCustomer
(User user, Customer customer) Updates an existing customer.
-
Field Details
-
USER_ID_ATTR_KEY
- See Also:
-
-
Constructor Details
-
UserCreationListener
public UserCreationListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService)
-
-
Method Details
-
listen
@StreamListener("userCreationInput") public void listen(@NonNull @NonNull org.springframework.messaging.Message<UserCreatedEvent> message) -
processStateChange
protected void processStateChange(@NonNull @NonNull org.springframework.messaging.Message<UserCreatedEvent> message) Based on the contents of theUserCreatedEvent
, update the Customer with the providedUser
data- Parameters:
message
- the message to be processed
-
updateCustomer
Updates an existing customer. We're only concerned with Auth's user_id field.- Parameters:
user
-customer
-
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService() -
getCustomerService
-