Class UserRegistrationListener
- java.lang.Object
-
- com.broadleafcommerce.customer.messaging.UserRegistrationListener
-
-
Field Summary
Fields Modifier and Type Field Description static String
USER_ID_KEY
The key to store the user's primary ID.
-
Constructor Summary
Constructors Constructor Description UserRegistrationListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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 CustomerService<Customer>
getCustomerService()
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService
getIdempotentConsumptionService()
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
protected void
validateUserPayload(User user)
-
-
-
Field Detail
-
USER_ID_KEY
public static final String USER_ID_KEY
The key to store the user's primary ID.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UserRegistrationListener
public UserRegistrationListener(com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService idempotentConsumptionService, CustomerService<Customer> customerService)
-
-
Method Detail
-
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
-
validateUserPayload
protected void validateUserPayload(User user)
-
assertIsCustomerType
protected void assertIsCustomerType(User user)
-
assertHasServiceId
protected void assertHasServiceId(User user)
-
buildContextInfo
protected com.broadleafcommerce.data.tracking.core.context.ContextInfo buildContextInfo(User user)
-
getIdempotentConsumptionService
protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionService getIdempotentConsumptionService()
-
getCustomerService
protected CustomerService<Customer> getCustomerService()
-
-