Class UserRegistrationListener
- java.lang.Object
-
- com.broadleafcommerce.customer.messaging.UserRegistrationListener
-
-
Field Summary
Fields Modifier and Type Field Description static StringUSER_ID_KEYThe 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 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 AccountInvitePropertiesgetAccountInviteProperties()protected AccountInviteService<AccountInvite>getAccountInviteService()protected com.broadleafcommerce.resource.security.utils.service.AuthenticationUtilsgetAuthenticationUtils()protected CustomerService<Customer>getCustomerService()protected com.broadleafcommerce.common.messaging.service.IdempotentMessageConsumptionServicegetIdempotentConsumptionService()protected com.broadleafcommerce.common.extension.TypeFactorygetTypeFactory()voidlisten(@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 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)
-
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
protected CustomerService<Customer> getCustomerService()
-
getAccountInviteService
protected AccountInviteService<AccountInvite> 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
protected AccountInviteProperties getAccountInviteProperties()
-
setAccountInviteProperties
@Autowired public void setAccountInviteProperties(AccountInviteProperties accountInviteProperties)
-
getTypeFactory
protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
-
setTypeFactory
@Autowired public void setTypeFactory(com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-