Class UserRegistrationListener

java.lang.Object
com.broadleafcommerce.customer.messaging.UserRegistrationListener

@DataRouteByKey("customer") public class UserRegistrationListener extends Object
Listens to customer user registration events and creates a new corresponding Customer.
  • Field Details

  • 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 the UserCreatedEvent, create a new Customer
      Parameters:
      message - the message to be processed
    • buildCustomer

      protected Customer buildCustomer(User user, String customerId)
    • 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 pending AccountInvites for the registered customer.
      Parameters:
      customer - The registered customer
      contextInfo - 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)