public class CustomerPersistenceHandler extends AuthDataUpdatePersistenceHandler
Constructor and Description |
---|
CustomerPersistenceHandler(UserService<User> userService,
AuthorizedClientService<AuthorizedClient> clientService,
ApplicationService<Application> applicationService,
UserCreationProducer userCreationProducer,
com.fasterxml.jackson.databind.ObjectMapper objectMapper,
UserLockoutService userLockoutService) |
Modifier and Type | Method and Description |
---|---|
protected void |
createNewUser(Customer customer) |
protected ApplicationService<Application> |
getApplicationService() |
protected Instant |
getChangeTimestamp(com.fasterxml.jackson.databind.JsonNode persistenceMessage) |
protected AuthorizedClientService<AuthorizedClient> |
getClientService() |
String[] |
getSupportedSimpleTypeNames() |
protected UserCreationProducer |
getUserCreationProducer() |
protected String |
getUserId(Customer customer) |
protected UserLockoutService |
getUserLockoutService() |
protected UserService<User> |
getUserService() |
protected @NotNull User |
handleUserLockoutIfNecessary(Customer customer,
User user) |
void |
hook(String entityJson) |
protected IllegalArgumentException |
missingTimestampError() |
protected void |
notifyNewCustomerUserCreated(User user,
Customer customer) |
protected Customer |
parseCustomer(com.fasterxml.jackson.databind.JsonNode entityJson) |
void |
processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson) |
protected List<Application> |
readApplicationsForCustomer(Customer customer)
Finds all applications in the data store for the given
Customer.getCustomerContextId() . |
protected String |
readAuthServerId(String applicationId) |
protected void |
updateExistingUser(Customer customer,
Instant timestamp) |
protected void |
updateOrCreateUser(Customer customer,
com.fasterxml.jackson.databind.JsonNode entityJson) |
protected boolean |
updateUserFields(Customer customer,
User user)
Updates user fields that auth is concerned with.
|
protected Supplier<IllegalArgumentException> |
userNotFound(Customer customer,
String userId) |
getObjectMapper, handle, isNodeNull, isValidType
public CustomerPersistenceHandler(UserService<User> userService, AuthorizedClientService<AuthorizedClient> clientService, ApplicationService<Application> applicationService, UserCreationProducer userCreationProducer, com.fasterxml.jackson.databind.ObjectMapper objectMapper, UserLockoutService userLockoutService)
@StreamListener(value="persistenceInputAuthCustomer") public void hook(String entityJson)
public void processStateChange(com.fasterxml.jackson.databind.JsonNode entityJson)
protected void updateOrCreateUser(Customer customer, com.fasterxml.jackson.databind.JsonNode entityJson)
protected void createNewUser(Customer customer)
protected void notifyNewCustomerUserCreated(User user, Customer customer)
protected boolean updateUserFields(Customer customer, User user)
customer
- The customer fromuser
- The user to set fields on.protected Supplier<IllegalArgumentException> userNotFound(Customer customer, String userId)
protected Customer parseCustomer(com.fasterxml.jackson.databind.JsonNode entityJson)
protected List<Application> readApplicationsForCustomer(Customer customer)
Customer.getCustomerContextId()
.customer
- the customer for which to find applications in the data storeCustomer.getCustomerContextId()
.
Never empty.IllegalArgumentException
- if no applications were foundprotected Instant getChangeTimestamp(com.fasterxml.jackson.databind.JsonNode persistenceMessage)
@NotNull protected @NotNull User handleUserLockoutIfNecessary(Customer customer, User user)
protected IllegalArgumentException missingTimestampError()
public String[] getSupportedSimpleTypeNames()
protected AuthorizedClientService<AuthorizedClient> getClientService()
protected ApplicationService<Application> getApplicationService()
protected UserCreationProducer getUserCreationProducer()
protected UserService<User> getUserService()
protected UserLockoutService getUserLockoutService()
Copyright © 2021. All rights reserved.