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 UserService<User>protected @NotNull UserhandleUserLockoutIfNecessary(Customer customer, User user) voidprotected 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) 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
-
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
-