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
-
Constructor Summary
ConstructorsConstructorDescriptionCustomerPersistenceHandler(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, ApplicationService<Application> applicationService, UserCreationProducer userCreationProducer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, UserLockoutService userLockoutService) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcreateNewUser(Customer customer) protected ApplicationService<Application>protected InstantgetChangeTimestamp(com.fasterxml.jackson.databind.JsonNode persistenceMessage) protected AuthorizedClientService<AuthorizedClient>String[]protected UserCreationProducerprotected Stringprotected UserLockoutServiceprotected UserMappingPropertiesServiceprotected UserResourceLockService<User>protected UserService<User>protected @NotNull UserhandleUserLockoutIfNecessary(Customer customer, User user) voidprotected booleanmapAdditionalAttributes(@NonNull Customer customer, @NonNull User user) protected IllegalArgumentExceptionprotected voidnotifyNewCustomerUserCreated(User user, Customer customer) protected CustomerparseCustomer(com.fasterxml.jackson.databind.JsonNode entityJson) voidprocessStateChange(com.fasterxml.jackson.databind.JsonNode entityJson) protected List<Application>readApplicationsForCustomer(Customer customer) Finds all applications in the data store for the givenCustomer.getCustomerContextId().protected StringreadAuthServerId(String applicationId) voidsetUserMappingPropertiesService(UserMappingPropertiesService userMappingPropertiesService) voidsetUserResourceLockService(UserResourceLockService<User> userResourceLockService) protected voidupdateExistingUser(Customer customer, Instant timestamp) protected voidupdateOrCreateUser(Customer customer, com.fasterxml.jackson.databind.JsonNode entityJson) protected booleanupdateUserFields(Customer customer, User user) Updates user fields that auth is concerned with.protected Supplier<IllegalArgumentException>userNotFound(Customer customer, String userId) Methods inherited from class com.broadleafcommerce.auth.user.listener.AuthDataUpdatePersistenceHandler
getObjectMapper, handle, isNodeNull, isValidTypeMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.common.messaging.PersistenceHandler
validate
-
Constructor Details
-
CustomerPersistenceHandler
public CustomerPersistenceHandler(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, ApplicationService<Application> applicationService, UserCreationProducer userCreationProducer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, UserLockoutService userLockoutService)
-
-
Method Details
-
hook
-
processStateChange
public void processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson) -
updateOrCreateUser
protected void updateOrCreateUser(Customer customer, com.fasterxml.jackson.databind.JsonNode entityJson) -
createNewUser
-
mapAdditionalAttributes
protected boolean mapAdditionalAttributes(@NonNull @NonNull Customer customer, @NonNull @NonNull User user) - Parameters:
customer- The customer spawning the event.user- The user to update.- Returns:
- Whether any updates occurred.
- See Also:
-
notifyNewCustomerUserCreated
-
updateExistingUser
-
updateUserFields
Updates user fields that auth is concerned with.- Parameters:
customer- The customer fromuser- The user to set fields on.- Returns:
- true if a value was updated, else false.
-
getUserId
-
userNotFound
-
parseCustomer
-
readAuthServerId
-
readApplicationsForCustomer
Finds all applications in the data store for the givenCustomer.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
-
handleUserLockoutIfNecessary
-
missingTimestampError
-
getSupportedSimpleTypeNames
-
getClientService
-
getApplicationService
-
getUserCreationProducer
-
getUserService
-
getUserLockoutService
-
getUserMappingPropertiesService
-
setUserMappingPropertiesService
@Autowired public void setUserMappingPropertiesService(UserMappingPropertiesService userMappingPropertiesService) -
getUserResourceLockService
-
setUserResourceLockService
@Autowired public void setUserResourceLockService(UserResourceLockService<User> userResourceLockService)
-