Class CustomerPersistenceHandler

java.lang.Object
com.broadleafcommerce.auth.user.listener.AuthDataUpdatePersistenceHandler
com.broadleafcommerce.auth.user.listener.CustomerPersistenceHandler
All Implemented Interfaces:
com.broadleafcommerce.common.messaging.PersistenceHandler

public class CustomerPersistenceHandler extends AuthDataUpdatePersistenceHandler
  • Constructor Details

  • Method Details

    • hook

      @StreamListener("persistenceInputAuthCustomer") public void hook(String entityJson)
    • processStateChange

      public void processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson)
    • updateOrCreateUser

      protected void updateOrCreateUser(Customer customer, com.fasterxml.jackson.databind.JsonNode entityJson)
    • createNewUser

      protected void createNewUser(Customer customer)
    • notifyNewCustomerUserCreated

      protected void notifyNewCustomerUserCreated(User user, Customer customer)
    • updateExistingUser

      protected void updateExistingUser(Customer customer, Instant timestamp)
    • updateUserFields

      protected boolean updateUserFields(Customer customer, User user)
      Updates user fields that auth is concerned with.
      Parameters:
      customer - The customer from
      user - The user to set fields on.
      Returns:
      true if a value was updated, else false.
    • getUserId

      protected String getUserId(Customer customer)
    • userNotFound

      protected Supplier<IllegalArgumentException> userNotFound(Customer customer, String userId)
    • parseCustomer

      protected Customer parseCustomer(com.fasterxml.jackson.databind.JsonNode entityJson)
    • readAuthServerId

      protected String readAuthServerId(String applicationId)
    • readApplicationsForCustomer

      protected List<Application> readApplicationsForCustomer(Customer customer)
      Finds all applications in the data store for the given Customer.getCustomerContextId().
      Parameters:
      customer - the customer for which to find applications in the data store
      Returns:
      the applications in the data store for the Customer.getCustomerContextId(). Never empty.
      Throws:
      IllegalArgumentException - if no applications were found
    • getChangeTimestamp

      protected Instant getChangeTimestamp(com.fasterxml.jackson.databind.JsonNode persistenceMessage)
    • handleUserLockoutIfNecessary

      @NotNull protected @NotNull User handleUserLockoutIfNecessary(Customer customer, User user)
    • missingTimestampError

      protected IllegalArgumentException missingTimestampError()
    • getSupportedSimpleTypeNames

      public String[] getSupportedSimpleTypeNames()
    • getClientService

      protected AuthorizedClientService<AuthorizedClient> getClientService()
    • getApplicationService

      protected ApplicationService<Application> getApplicationService()
    • getUserCreationProducer

      protected UserCreationProducer getUserCreationProducer()
    • getUserService

      protected UserService<User> getUserService()
    • getUserLockoutService

      protected UserLockoutService getUserLockoutService()